camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r771353 - /camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
Date Mon, 04 May 2009 16:32:32 GMT
Author: davsclaus
Date: Mon May  4 16:32:31 2009
New Revision: 771353

URL: http://svn.apache.org/viewvc?rev=771353&view=rev
Log:
CAMEL-1573: Fixed bug in ObjectHelper.loadClass not being able to load byte[] class.

Modified:
    camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java

Modified: camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java?rev=771353&r1=771352&r2=771353&view=diff
==============================================================================
--- camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
(original)
+++ camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
Mon May  4 16:32:31 2009
@@ -481,6 +481,11 @@
         // must clean the name so its pure java name, eg remoing \n or whatever people can
do in the Spring XML
         name = normalizeClassName(name);
 
+        // special for byte[] as its common to use
+        if ("java.lang.byte[]".equals(name) || "byte[]".equals(name)) {
+            return byte[].class;
+        }
+
         // try context class loader first
         Class clazz = doLoadClass(name, Thread.currentThread().getContextClassLoader());
         if (clazz == null) {
@@ -858,7 +863,7 @@
     public static String normalizeClassName(String name) {
         StringBuffer sb = new StringBuffer(name.length());
         for (char ch : name.toCharArray()) {
-            if (ch == '.' || Character.isJavaIdentifierPart(ch)) {
+            if (ch == '.'  || ch == '[' || ch == ']' || Character.isJavaIdentifierPart(ch))
{
                 sb.append(ch);
             }
         }



Mime
View raw message