]> source.dussan.org Git - javassist.git/commitdiff
fixed JASSIST-121
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Tue, 5 Oct 2010 09:42:29 +0000 (09:42 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Tue, 5 Oct 2010 09:42:29 +0000 (09:42 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@575 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/CtClassType.java

index 0dcbc82b8e9369ddc81518cf1c64eea54afb9123..dad5db7a628666775054b699ef480a9edfabe561 100644 (file)
@@ -401,20 +401,17 @@ class CtClassType extends CtClass {
         if (ica == null)
             return new CtClass[0];
 
-        String thisName = cf.getName();
+        String thisName = cf.getName() + "$";
         int n = ica.tableLength();
         ArrayList list = new ArrayList(n);
         for (int i = 0; i < n; i++) {
-            String outer = ica.outerClass(i);
-            /*
-             * If a nested class is local or anonymous,
-             * the outer_class_info_index is 0.
-             */
-            if (outer == null || outer.equals(thisName)) {
-                String inner = ica.innerClass(i);
-                if (inner != null)
-                    list.add(classPool.get(inner));
-            }
+            String name = ica.innerClass(i);
+            if (name != null)
+                if (name.startsWith(thisName)) {
+                    // if it is an immediate nested class
+                    if (name.lastIndexOf('$') < thisName.length())
+                        list.add(classPool.get(name));
+                }
         }
 
         return (CtClass[])list.toArray(new CtClass[list.size()]);