commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r980562 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java
Date Thu, 29 Jul 2010 20:22:59 GMT
Author: mbenson
Date: Thu Jul 29 20:22:58 2010
New Revision: 980562

URL: http://svn.apache.org/viewvc?rev=980562&view=rev
Log:
use 1.5 method for determining inner class-ness; null safety is really the only remaining
advantage of #isInnerClass.  This goes nicely with r919340

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java?rev=980562&r1=980561&r2=980562&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java Thu Jul
29 20:22:58 2010
@@ -730,10 +730,7 @@ public class ClassUtils {
      *  false if not or <code>null</code>
      */
     public static boolean isInnerClass(Class<?> cls) {
-        if (cls == null) {
-            return false;
-        }
-        return cls.getName().indexOf(INNER_CLASS_SEPARATOR_CHAR) >= 0;
+        return cls != null && cls.getEnclosingClass() != null;
     }
 
     // Class loading



Mime
View raw message