diff options
author | Shigeru Chiba <chibash@users.noreply.github.com> | 2024-09-29 15:01:47 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-29 15:01:47 +0900 |
commit | c3bbec234c53cbb80f97491e92fbeb68c4957aa2 (patch) | |
tree | 2901f98cd0503ff358c9238dbd250e2b6cb98095 /src/main/javassist/CtClassType.java | |
parent | 3cf49c0e6a9a23eb609ef4831782f3f02124975c (diff) | |
parent | 4fd9442a6e3bc2c783daef205a9400596c858dce (diff) | |
download | javassist-c3bbec234c53cbb80f97491e92fbeb68c4957aa2.tar.gz javassist-c3bbec234c53cbb80f97491e92fbeb68c4957aa2.zip |
Merge pull request #491 from jbellenger/jbellenger-multiple-nested-classes
reduced InnerClasses propagation
Diffstat (limited to 'src/main/javassist/CtClassType.java')
-rw-r--r-- | src/main/javassist/CtClassType.java | 9 |
1 files changed, 6 insertions, 3 deletions
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; } |