Author: bayard
Date: Wed Sep  5 03:06:41 2007
New Revision: 572929

URL: http://svn.apache.org/viewvc?rev=572929&view=rev
Log:
Bringing over minor edits and a thrown ClassCastException from enums.Enum

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java

Modified: 
commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java
URL: 
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java?rev=572929&r1=572928&r2=572929&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java 
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java 
Wed Sep  5 03:06:41 2007
@@ -548,7 +548,7 @@
             // classes are in the same class loader.
             return iName.equals(((Enum) other).iName);
         } else {
-            // This and other are in different class loaders, we must use 
reflection.
+            // This and other are in different class loaders, we must check 
indirectly
             if (other.getClass().getName().equals(this.getClass().getName()) 
== false) {
                 return false;
             }
@@ -589,6 +589,8 @@
             if (other.getClass().getName().equals(this.getClass().getName())) {
                 return iName.compareTo( getNameInOtherClassLoader(other) );
             }
+            throw new ClassCastException(
+                    "Different enum class '" + 
ClassUtils.getShortClassName(other.getClass()) + "'");
         }
         return iName.compareTo(((Enum) other).iName);
     }


Reply via email to