From 4fd9442a6e3bc2c783daef205a9400596c858dce Mon Sep 17 00:00:00 2001 From: James Bellenger Date: Tue, 17 Sep 2024 13:09:36 -0700 Subject: init --- src/main/javassist/CtClassType.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main') diff --git a/src/main/javassist/CtClassType.java b/src/main/javassist/CtClassType.java index f4345e0a..5d3dc5b5 100644 --- a/src/main/javassist/CtClassType.java +++ b/src/main/javassist/CtClassType.java @@ -932,14 +932,17 @@ class CtClassType extends CtClass { ClassFile cf2 = c.getClassFile2(); InnerClassesAttribute ica = (InnerClassesAttribute)cf.getAttribute( InnerClassesAttribute.tag); + InnerClassesAttribute ica2 = new InnerClassesAttribute(cf2.getConstPool()); + int flags = (cf2.getAccessFlags() & ~AccessFlag.SUPER) | AccessFlag.STATIC; + if (ica == null) { ica = new InnerClassesAttribute(cf.getConstPool()); cf.addAttribute(ica); } - ica.append(c.getName(), this.getName(), name, - (cf2.getAccessFlags() & ~AccessFlag.SUPER) | AccessFlag.STATIC); - cf2.addAttribute(ica.copy(cf2.getConstPool(), null)); + ica.append(c.getName(), this.getName(), name, flags); + ica2.append(c.getName(), this.getName(), name, flags); + cf2.addAttribute(ica2); return c; } -- cgit v1.2.3