commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r652590 - in /commons/sandbox/nabla/trunk/src/main: java/org/apache/commons/nabla/automatic/analysis/ resources/META-INF/localization/
Date Thu, 01 May 2008 17:43:28 GMT
Author: luc
Date: Thu May  1 10:43:27 2008
New Revision: 652590

URL: http://svn.apache.org/viewvc?rev=652590&view=rev
Log:
fixed an empty catch block found by PMD

Modified:
    commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/automatic/analysis/ClassDifferentiator.java
    commons/sandbox/nabla/trunk/src/main/resources/META-INF/localization/ExceptionsMessages.properties
    commons/sandbox/nabla/trunk/src/main/resources/META-INF/localization/ExceptionsMessages_fr.properties

Modified: commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/automatic/analysis/ClassDifferentiator.java
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/automatic/analysis/ClassDifferentiator.java?rev=652590&r1=652589&r2=652590&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/automatic/analysis/ClassDifferentiator.java
(original)
+++ commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/automatic/analysis/ClassDifferentiator.java
Thu May  1 10:43:27 2008
@@ -105,11 +105,19 @@
         final Class<UnivariateDifferentiable> uDerClass = UnivariateDifferentiable.class;
         boolean isDifferentiable = false;
         for (String interf : interfaces) {
+            String interfName = interf.replace('/', '.');
+            Class<?> interfClass = null;
             try {
-                isDifferentiable =
-                    isDifferentiable || uDerClass.isAssignableFrom(Class.forName(interf.replace('/',
'.')));
+                interfClass = Class.forName(interfName);
             } catch (ClassNotFoundException cnfe) {
-                // simply ignore this inaccessible interface
+                // this should never occur since class has already been loaded
+                // and an instance already exists ...
+                errorReporter.register(new DifferentiationException("interface {0} not found
" +
+                                                                    "while differentiating
class {1}",
+                                                                    interfName, name));
+            }
+            if (interfClass != null) {
+                isDifferentiable = isDifferentiable || uDerClass.isAssignableFrom(interfClass);
             }
         }
 
@@ -121,8 +129,9 @@
                                 UnivariateDerivative.class.getName().replace('.', '/')
                             });
         } else {
-            errorReporter.register(new DifferentiationException("the {0} class does not implement
the {1} interface",
-                                                           name, uDerClass.getName()));
+            errorReporter.register(new DifferentiationException("the {0} class does not implement
" +
+                                                                "the {1} interface",
+                                                                name, uDerClass.getName()));
         }
 
         specificMembersAdded = false;

Modified: commons/sandbox/nabla/trunk/src/main/resources/META-INF/localization/ExceptionsMessages.properties
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/resources/META-INF/localization/ExceptionsMessages.properties?rev=652590&r1=652589&r2=652590&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/resources/META-INF/localization/ExceptionsMessages.properties
(original)
+++ commons/sandbox/nabla/trunk/src/main/resources/META-INF/localization/ExceptionsMessages.properties
Thu May  1 10:43:27 2008
@@ -31,6 +31,9 @@
   class {0} instantiation from an instance of class {1} failed ({2})
 
 # org.apache.commons.nabla.automatic.ClassDifferentiator
+interface\ {0}\ not\ found\ while\ differentiating\ class\ {1} = \
+  interface {0} not found while differentiating class {1}
+
 the\ {0}\ class\ does\ not\ implement\ the\ {1}\ interface = \
   the {0} class does not implement the {1} interface
 

Modified: commons/sandbox/nabla/trunk/src/main/resources/META-INF/localization/ExceptionsMessages_fr.properties
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/resources/META-INF/localization/ExceptionsMessages_fr.properties?rev=652590&r1=652589&r2=652590&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/resources/META-INF/localization/ExceptionsMessages_fr.properties
(original)
+++ commons/sandbox/nabla/trunk/src/main/resources/META-INF/localization/ExceptionsMessages_fr.properties
Thu May  1 10:43:27 2008
@@ -31,6 +31,9 @@
   class {0} instantiation from an instance of class {1} failed ({2})
 
 # org.apache.commons.nabla.automatic.ClassDifferentiator
+interface\ {0}\ not\ found\ while\ differentiating\ class\ {1} = \
+  interface {0} non trouv\u00e9e lors de la diff\u00e9rentiation de la classe {1}
+
 the\ {0}\ class\ does\ not\ implement\ the\ {1}\ interface = \
   la classe {0} n''implante pas l''interface {1}
 



Mime
View raw message