Some small changes to ClassUtils and StringUtils.

 

-Nathan

Index: src/java/org/apache/commons/lang/ClassUtils.java
===================================================================
--- src/java/org/apache/commons/lang/ClassUtils.java    (revision 230932)
+++ src/java/org/apache/commons/lang/ClassUtils.java    (working copy)
@@ -166,7 +166,7 @@
         if (cls == null) {
             return StringUtils.EMPTY;
         }
-        return getPackageName(cls.getName());
+        return cls.getPackage().getName();
     }
     
     /**
@@ -502,5 +502,4 @@
         }
         return cls.getName().indexOf(INNER_CLASS_SEPARATOR_CHAR) >= 0;
     }
-
 }
Index: src/java/org/apache/commons/lang/StringUtils.java
===================================================================
--- src/java/org/apache/commons/lang/StringUtils.java   (revision 230932)
+++ src/java/org/apache/commons/lang/StringUtils.java   (working copy)
@@ -3210,11 +3210,7 @@
             if (str.charAt(lastIdx - 1) == CharUtils.CR) {
                 lastIdx--;
             }
-        } else if (last == CharUtils.CR) {
-            // why is this block empty?
-            // just to skip incrementing the index?
-          ;
-        } else {
+        } else if (last != CharUtils.CR) {
             lastIdx++;
         }
         return str.substring(0, lastIdx);

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to