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

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 UTC