W3C home > Mailing lists > Public > www-validator-cvs@w3.org > September 2009

2006/unicorn/src/org/w3c/unicorn/input InputFactory.java,1.2,1.3 FileItemInputModule.java,1.2,1.3

From: Jean-Guilhem Rouel via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 03 Sep 2009 17:34:55 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MjGD2-0005YK-0J@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/input
In directory hutz:/tmp/cvs-serv21302/src/org/w3c/unicorn/input

Modified Files:
	InputFactory.java FileItemInputModule.java 
Log Message:
InputModules were not added to the map so dispose could not be called on all InputModules

Index: FileItemInputModule.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/input/FileItemInputModule.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- FileItemInputModule.java	28 Aug 2009 12:40:04 -0000	1.2
+++ FileItemInputModule.java	3 Sep 2009 17:34:53 -0000	1.3
@@ -93,8 +93,8 @@
 	 * Dispose the object
 	 */
 	public void dispose() {
-		InputModule.logger.trace("dispose");
 		if (null != this.aFileItem) {
+			InputModule.logger.trace("dispose");
 			this.aFileItem.delete();
 			this.aFileItem = null;
 		}

Index: InputFactory.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/input/InputFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- InputFactory.java	28 Aug 2009 12:40:04 -0000	1.2
+++ InputFactory.java	3 Sep 2009 17:34:53 -0000	1.3
@@ -112,11 +112,12 @@
 			InputFactory.logger.debug("Input method : " + aEnumInputMethod
 					+ ".");
 		}
-		final InputModule aInputModule = this.mapOfInputModule
-				.get(aEnumInputMethod);
+		InputModule aInputModule = this.mapOfInputModule.get(aEnumInputMethod);
+
 		if (null != aInputModule) {
 			return aInputModule;
 		}
+		
 		return this.createInputModule(aEnumInputMethod);
 	}
 
@@ -136,15 +137,24 @@
 			InputFactory.logger.debug("Input method : " + aEnumInputMethod
 					+ ".");
 		}
+		
+		InputModule module;		
 		switch (aEnumInputMethod) {
 		case DIRECT:
-			return new DirectInputModule(this.aInputModuleDefault);
+			module = new DirectInputModule(this.aInputModuleDefault);
+			break;
 		case UPLOAD:
-			return new FakeUploadInputModule(this.aInputModuleDefault);
+			module = new FakeUploadInputModule(this.aInputModuleDefault);
+			break;
 		case URI:
-			return new URIInputModule(this.aInputModuleDefault);
+			module = new URIInputModule(this.aInputModuleDefault);
+			break;
+		default:
+			module = null;
 		}
-		return null;
+		mapOfInputModule.put(aEnumInputMethod, module);
+		
+		return module;
 	}
 
 	public MimeType getMimeType() {
Received on Thursday, 3 September 2009 17:35:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:13 GMT