From 260b2fd56c800bd0f8328edee1e46dc5ccfde176 Mon Sep 17 00:00:00 2001 From: chiba Date: Tue, 5 Oct 2010 09:42:29 +0000 Subject: [PATCH] fixed JASSIST-121 git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@575 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- src/main/javassist/CtClassType.java | 19 ++++++++----------- 1 file 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()]); -- 2.39.5