commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang ClassUtilsTest.java
Date Tue, 31 Dec 2002 22:32:24 GMT
scolebourne    2002/12/31 14:32:24

  Modified:    lang/src/java/org/apache/commons/lang ClassUtils.java
               lang/src/test/org/apache/commons/lang ClassUtilsTest.java
  Log:
  Fix to handle anonymous inner classes
  
  Revision  Changes    Path
  1.8       +2 -2      jakarta-commons/lang/src/java/org/apache/commons/lang/ClassUtils.java
  
  Index: ClassUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/ClassUtils.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ClassUtils.java	23 Dec 2002 00:32:24 -0000	1.7
  +++ ClassUtils.java	31 Dec 2002 22:32:23 -0000	1.8
  @@ -499,7 +499,7 @@
           if (cls == null) {
               throw new IllegalArgumentException("The class must not be null");
           }
  -        return (cls.getDeclaringClass() != null);
  +        return (cls.getName().indexOf('$') >= 0);
       }
       
   }
  
  
  
  1.2       +3 -1      jakarta-commons/lang/src/test/org/apache/commons/lang/ClassUtilsTest.java
  
  Index: ClassUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/ClassUtilsTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ClassUtilsTest.java	15 Dec 2002 19:36:08 -0000	1.1
  +++ ClassUtilsTest.java	31 Dec 2002 22:32:23 -0000	1.2
  @@ -252,6 +252,8 @@
       public void test_isInnerClass_Class() {
           assertEquals(true, ClassUtils.isInnerClass(Inner.class));
           assertEquals(true, ClassUtils.isInnerClass(Map.Entry.class));
  +        assertEquals(true, ClassUtils.isInnerClass(new Cloneable() {
  +        }.getClass()));
           assertEquals(false, ClassUtils.isInnerClass(this.getClass()));
           assertEquals(false, ClassUtils.isInnerClass(String.class));
           try {
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message