commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1142095 - /commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java
Date Fri, 01 Jul 2011 21:19:13 GMT
Author: simonetripodi
Date: Fri Jul  1 21:19:13 2011
New Revision: 1142095

URL: http://svn.apache.org/viewvc?rev=1142095&view=rev
Log:
no reason to throw an hard to interpret NPE late, better raising an exception as soon as classes
cannot be load, much easier to debug - rule init and rule invocation could happen in different
times

Modified:
    commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java

Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java?rev=1142095&r1=1142094&r2=1142095&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java
(original)
+++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java
Fri Jul  1 21:19:13 2011
@@ -342,10 +342,11 @@ public class CallMethodRule
                 }
                 catch ( ClassNotFoundException e )
                 {
+                    String errorMessage = format( "[CallMethodRule] Cannot load class %s
at position %s",
+                                                  this.paramClassNames[i], i );
                     // use the digester log
-                    digester.getLogger().error( format( "[CallMethodRule] Cannot load class
%s",
-                                                        this.paramClassNames[i] ), e );
-                    this.paramTypes[i] = null; // Will cause NPE later
+                    digester.getLogger().error( errorMessage, e );
+                    throw new RuntimeException( errorMessage, e );
                 }
             }
         }



Mime
View raw message