diff options
| author | 2018-10-28 22:27:22 +0100 | |
|---|---|---|
| committer | 2018-10-28 22:27:22 +0100 | |
| commit | 069d02024e8fa870b5dfd2d8cce1fd88d19f30d6 (patch) | |
| tree | 48559000de505adb93a24df1f3c83924ebab2694 | |
| parent | expose AccessFlags over Access (diff) | |
| download | enigma-069d02024e8fa870b5dfd2d8cce1fd88d19f30d6.tar.gz enigma-069d02024e8fa870b5dfd2d8cce1fd88d19f30d6.tar.xz enigma-069d02024e8fa870b5dfd2d8cce1fd88d19f30d6.zip | |
expose AccessFlags correctly
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/JarIndex.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/cuchaz/enigma/analysis/JarIndex.java b/src/main/java/cuchaz/enigma/analysis/JarIndex.java index a87d8c37..f6338a27 100644 --- a/src/main/java/cuchaz/enigma/analysis/JarIndex.java +++ b/src/main/java/cuchaz/enigma/analysis/JarIndex.java | |||
| @@ -106,20 +106,22 @@ public class JarIndex { | |||
| 106 | throw new IllegalArgumentException("Class cannot be its own interface! " + name); | 106 | throw new IllegalArgumentException("Class cannot be its own interface! " + name); |
| 107 | } | 107 | } |
| 108 | } | 108 | } |
| 109 | return this.translationIndex.indexClass(access, name, signature, superName, interfaces); | 109 | ClassDefEntry entry = this.translationIndex.indexClass(access, name, signature, superName, interfaces); |
| 110 | this.access.put(entry, entry.getAccess()); | ||
| 111 | return entry; | ||
| 110 | } | 112 | } |
| 111 | 113 | ||
| 112 | protected void indexField(ClassDefEntry owner, int access, String name, String desc, String signature) { | 114 | protected void indexField(ClassDefEntry owner, int access, String name, String desc, String signature) { |
| 113 | FieldDefEntry fieldEntry = new FieldDefEntry(owner, name, new TypeDescriptor(desc), Signature.createTypedSignature(signature), new AccessFlags(access)); | 115 | FieldDefEntry fieldEntry = new FieldDefEntry(owner, name, new TypeDescriptor(desc), Signature.createTypedSignature(signature), new AccessFlags(access)); |
| 114 | this.translationIndex.indexField(fieldEntry); | 116 | this.translationIndex.indexField(fieldEntry); |
| 115 | this.access.put(fieldEntry, owner.getAccess()); | 117 | this.access.put(fieldEntry, fieldEntry.getAccess()); |
| 116 | this.fields.put(fieldEntry.getOwnerClassEntry(), fieldEntry); | 118 | this.fields.put(fieldEntry.getOwnerClassEntry(), fieldEntry); |
| 117 | } | 119 | } |
| 118 | 120 | ||
| 119 | protected void indexMethod(ClassDefEntry owner, int access, String name, String desc, String signature) { | 121 | protected void indexMethod(ClassDefEntry owner, int access, String name, String desc, String signature) { |
| 120 | MethodDefEntry methodEntry = new MethodDefEntry(owner, name, new MethodDescriptor(desc), Signature.createSignature(signature), new AccessFlags(access)); | 122 | MethodDefEntry methodEntry = new MethodDefEntry(owner, name, new MethodDescriptor(desc), Signature.createSignature(signature), new AccessFlags(access)); |
| 121 | this.translationIndex.indexMethod(methodEntry); | 123 | this.translationIndex.indexMethod(methodEntry); |
| 122 | this.access.put(methodEntry, owner.getAccess()); | 124 | this.access.put(methodEntry, methodEntry.getAccess()); |
| 123 | this.methods.put(methodEntry.getOwnerClassEntry(), methodEntry); | 125 | this.methods.put(methodEntry.getOwnerClassEntry(), methodEntry); |
| 124 | 126 | ||
| 125 | if (new AccessFlags(access).isSynthetic()) { | 127 | if (new AccessFlags(access).isSynthetic()) { |