aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorShigeru Chiba <chibash@users.noreply.github.com>2024-09-29 15:01:47 +0900
committerGitHub <noreply@github.com>2024-09-29 15:01:47 +0900
commitc3bbec234c53cbb80f97491e92fbeb68c4957aa2 (patch)
tree2901f98cd0503ff358c9238dbd250e2b6cb98095 /src/main
parent3cf49c0e6a9a23eb609ef4831782f3f02124975c (diff)
parent4fd9442a6e3bc2c783daef205a9400596c858dce (diff)
downloadjavassist-c3bbec234c53cbb80f97491e92fbeb68c4957aa2.tar.gz
javassist-c3bbec234c53cbb80f97491e92fbeb68c4957aa2.zip
Merge pull request #491 from jbellenger/jbellenger-multiple-nested-classes
reduced InnerClasses propagation
Diffstat (limited to 'src/main')
-rw-r--r--src/main/javassist/CtClassType.java9
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;
}