diff options
author | Manoj Palat | 2021-04-08 07:48:29 +0000 |
---|---|---|
committer | Manoj Palat | 2021-04-15 08:48:21 +0000 |
commit | 403185497e790a56b32d8caaa11d3911659d5749 (patch) | |
tree | 06e48f85b90370709b4b02e97f470c4804c6654b | |
parent | 35a65c41a6b1eba449d05b80ce0df45d95668352 (diff) | |
download | eclipse.jdt.core-403185497e790a56b32d8caaa11d3911659d5749.tar.gz eclipse.jdt.core-403185497e790a56b32d8caaa11d3911659d5749.tar.xz eclipse.jdt.core-403185497e790a56b32d8caaa11d3911659d5749.zip |
Bug 562324 - [11][compiler] ClassFormatError caused by var
declaration - Safety Net
Change-Id: Iecef461262d8ba8b4d6b28a3cca0aea59b30860b
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/178999
Tested-by: JDT Bot <jdt-bot@eclipse.org>
Reviewed-by: Manoj Palat <manpalat@in.ibm.com>
-rw-r--r-- | org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java index 96323858cd..5290f113da 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java @@ -163,6 +163,7 @@ public class ClassFile implements TypeConstants, TypeIds { // that collection contains all the remaining bytes of the .class file public int headerOffset; public Map<TypeBinding, Boolean> innerClassesBindings; + public Set<String> innerClassConstantPoolNames; public Set<SourceTypeBinding> nestMembers; public List<ASTNode> bootstrapMethods = null; public int methodCount; @@ -6030,7 +6031,13 @@ public class ClassFile implements TypeConstants, TypeIds { if (this.innerClassesBindings == null) { this.innerClassesBindings = new HashMap<>(INNER_CLASSES_SIZE); } + if (this.innerClassConstantPoolNames == null) { + this.innerClassConstantPoolNames = new HashSet<>(); + } ReferenceBinding innerClass = (ReferenceBinding) binding; + char[] name = innerClass.constantPoolName(); + if (name == null || !this.innerClassConstantPoolNames.add(new String(name))) + return; this.innerClassesBindings.put(innerClass.erasure().unannotated(), onBottomForBug445231); // should not emit yet another inner class for Outer.@Inner Inner. ReferenceBinding enclosingType = innerClass.enclosingType(); while (enclosingType != null @@ -6117,6 +6124,9 @@ public class ClassFile implements TypeConstants, TypeIds { if (this.innerClassesBindings != null) { this.innerClassesBindings.clear(); } + if (this.innerClassConstantPoolNames != null) { + this.innerClassConstantPoolNames.clear(); + } if (this.nestMembers != null) { this.nestMembers.clear(); } |