camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r905171 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/util/ObjectHelper.java test/java/org/apache/camel/util/ObjectHelperTest.java
Date Mon, 01 Feb 2010 02:33:44 GMT
Author: ningjiang
Date: Mon Feb  1 02:33:44 2010
New Revision: 905171

URL: http://svn.apache.org/viewvc?rev=905171&view=rev
Log:
CAMEL-2431 ObjectHelper.normalizeClassName should not filter the '-' charactor

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/util/ObjectHelperTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java?rev=905171&r1=905170&r2=905171&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java Mon Feb 
1 02:33:44 2010
@@ -1084,7 +1084,7 @@
     public static String normalizeClassName(String name) {
         StringBuffer sb = new StringBuffer(name.length());
         for (char ch : name.toCharArray()) {
-            if (ch == '.' || ch == '[' || ch == ']' || Character.isJavaIdentifierPart(ch))
{
+            if (ch == '.' || ch == '[' || ch == ']' || ch == '-' || Character.isJavaIdentifierPart(ch))
{
                 sb.append(ch);
             }
         }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/util/ObjectHelperTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/util/ObjectHelperTest.java?rev=905171&r1=905170&r2=905171&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/util/ObjectHelperTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/util/ObjectHelperTest.java Mon Feb
 1 02:33:44 2010
@@ -268,4 +268,10 @@
         Iterator<Object> it = ObjectHelper.createIterator(msg);
         assertFalse(it.hasNext());
     }
+    
+    public void testNormalizeClassName() {
+        assertEquals("Should get the right class name", "my.package-info", ObjectHelper.normalizeClassName("my.package-info"));
+        assertEquals("Should get the right class name", "Integer[]", ObjectHelper.normalizeClassName("Integer[]
\r"));
+        assertEquals("Should get the right class name", "Hello_World", ObjectHelper.normalizeClassName("Hello_World"));
+    }
 }



Mime
View raw message