77import com .telerik .metadata .desc .MethodDescriptor ;
88
99import org .apache .bcel .classfile .Attribute ;
10+ import org .apache .bcel .classfile .ConstantClass ;
11+ import org .apache .bcel .classfile .ConstantPool ;
1012import org .apache .bcel .classfile .ConstantUtf8 ;
1113import org .apache .bcel .classfile .Field ;
1214import org .apache .bcel .classfile .InnerClass ;
@@ -36,19 +38,14 @@ private void init() {
3638 return ;
3739 }
3840 boolean found = false ;
41+ String fullClassName = this .getClassName (clazz .getClassNameIndex ());
3942 for (Attribute a : clazz .getAttributes ()) {
4043 if (a instanceof InnerClasses ) {
4144 InnerClass [] i = ((InnerClasses ) a ).getInnerClasses ();
4245 for (InnerClass ic : i ) {
46+ String innerClassName = this .getClassName (ic .getInnerClassIndex ());
4347
44- ConstantUtf8 cname = (ConstantUtf8 ) clazz
45- .getConstantPool ().getConstant (ic .getInnerNameIndex ());
46- if (cname == null ) {
47- continue ;
48- }
49-
50- String innerClassname = cname .getBytes ();
51- if (name .equals (innerClassname )) {
48+ if (fullClassName .equals (innerClassName )) {
5249 int flags = ic .getInnerAccessFlags ();
5350 clazz .setAccessFlags (flags );
5451 found = true ;
@@ -63,6 +60,19 @@ private void init() {
6360 }
6461 }
6562
63+ private String getClassName (int classIndex ) {
64+ ConstantPool constantPool = clazz .getConstantPool ();
65+ ConstantClass innerClassNameIndex = (ConstantClass )constantPool .getConstant (classIndex );
66+ if (innerClassNameIndex == null ) {
67+ return null ;
68+ }
69+ ConstantUtf8 className = (ConstantUtf8 )constantPool .getConstant (innerClassNameIndex .getNameIndex ());
70+ if (className == null ) {
71+ return null ;
72+ }
73+ return className .getBytes ();
74+ }
75+
6676 @ Override
6777 public boolean isClass () {
6878 return clazz .isClass ();
0 commit comments