@@ -83,9 +83,7 @@ public T make(String className, String typeName) throws ConfigurationException {
8383 }
8484
8585 Class <?> theClass = Class .forName (className );
86- // System.out.println("DEBUG: class=" + className + ", typeName=" + typeName + ": Passed Class.forName()");
8786 obj = theClass .newInstance ();
88- // System.out.println("DEBUG: class=" + className + ", typeName=" + typeName + ": Passed Class.newInstance()");
8987
9088 return (T )obj ; // Eclipse warning here if @SupressWarnings omitted.
9189
@@ -104,25 +102,23 @@ public T make(String className, String typeName) throws ConfigurationException {
104102 //
105103 // Good reference:
106104 // http://java.sun.com/docs/books/tutorial/reflect/member/ctorTrouble.html
105+ //
106+ // Issue 66 - Removed System.out calls as we are throwing an exception in each of these cases
107+ // anyhow.
107108 } catch ( IllegalArgumentException ex ) {
108109 errMsg = ex .toString () + " " + typeName + " type name cannot be null or empty." ;
109- System .out .println (errMsg );
110110 throw new ConfigurationException (errMsg , ex );
111111 }catch ( ClassNotFoundException ex ) {
112112 errMsg = ex .toString () + " " + typeName + " class (" + className + ") must be in class path." ;
113- System .out .println (errMsg );
114113 throw new ConfigurationException (errMsg , ex );
115114 } catch ( InstantiationException ex ) {
116115 errMsg = ex .toString () + " " + typeName + " class (" + className + ") must be concrete." ;
117- System .out .println (errMsg );
118116 throw new ConfigurationException (errMsg , ex );
119117 } catch ( IllegalAccessException ex ) {
120118 errMsg = ex .toString () + " " + typeName + " class (" + className + ") must have a public, no-arg constructor." ;
121- System .out .println (errMsg );
122119 throw new ConfigurationException (errMsg , ex );
123120 } catch ( ClassCastException ex ) {
124121 errMsg = ex .toString () + " " + typeName + " class (" + className + ") must be a subtype of T in ObjFactory<T>" ;
125- System .out .println (errMsg );
126122 throw new ConfigurationException (errMsg , ex );
127123 } catch ( Exception ex ) {
128124 // Because we are using reflection, we want to catch any checked or unchecked Exceptions and
@@ -135,7 +131,6 @@ public T make(String className, String typeName) throws ConfigurationException {
135131 // unaltered???
136132 //
137133 errMsg = ex .toString () + " " + typeName + " class (" + className + ") CTOR threw exception." ;
138- System .out .println (errMsg );
139134 throw new ConfigurationException (errMsg , ex );
140135 }
141136 }
0 commit comments