From: chiba Date: Tue, 5 Oct 2010 09:42:29 +0000 (+0000) Subject: fixed JASSIST-121 X-Git-Tag: rel_3_17_1_ga~82 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=260b2fd56c800bd0f8328edee1e46dc5ccfde176;p=javassist.git fixed JASSIST-121 git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@575 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- diff --git a/src/main/javassist/CtClassType.java b/src/main/javassist/CtClassType.java index 0dcbc82b..dad5db7a 100644 --- a/src/main/javassist/CtClassType.java +++ b/src/main/javassist/CtClassType.java @@ -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()]);