camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1156108 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
Date Wed, 10 Aug 2011 11:24:47 GMT
Author: ningjiang
Date: Wed Aug 10 11:24:46 2011
New Revision: 1156108

URL: http://svn.apache.org/viewvc?rev=1156108&view=rev
Log:
CAMEL-4322 Fixed the issue of AnnotationTypeConverterLoader doesn't try all the classloaders
to load the converter class

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java?rev=1156108&r1=1156107&r2=1156108&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
Wed Aug 10 11:24:46 2011
@@ -161,18 +161,22 @@ public class AnnotationTypeConverterLoad
         for (String name : packageNames) {
             // must be a FQN class name by having an upper case letter
             if (StringHelper.hasUpperCase(name)) {
+                Class<?> clazz = null;
                 for (ClassLoader loader : resolver.getClassLoaders()) {
                     try {
-                        Class<?> clazz = loader.loadClass(name);
+                        clazz = loader.loadClass(name);
                         LOG.trace("Loaded {} as class {}", name, clazz);
                         classes.add(clazz);
                         // class founder, so no need to load it with another class loader
                         break;
                     } catch (Throwable e) {
-                        // ignore as its not a class (will be package scan afterwards)
-                        packages.add(name);
+                        // do nothing here
                     }
                 }
+                if (clazz == null) {
+                    // ignore as its not a class (will be package scan afterwards)
+                    packages.add(name);
+                }
             } else {
                 // ignore as its not a class (will be package scan afterwards)
                 packages.add(name);



Mime
View raw message