diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2010-10-05 09:42:29 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2010-10-05 09:42:29 +0000 |
commit | 260b2fd56c800bd0f8328edee1e46dc5ccfde176 (patch) | |
tree | c79fcc86610fa4331ff023695805ed51dd19a35d /src/main/javassist/CtClassType.java | |
parent | 4b05c10a1e3591547e669d116538949c0cb3905f (diff) | |
download | javassist-260b2fd56c800bd0f8328edee1e46dc5ccfde176.tar.gz javassist-260b2fd56c800bd0f8328edee1e46dc5ccfde176.zip |
fixed JASSIST-121
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@575 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/CtClassType.java')
-rw-r--r-- | src/main/javassist/CtClassType.java | 19 |
1 files changed, 8 insertions, 11 deletions
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()]); |