diff options
| author | 2018-10-28 22:23:01 +0100 | |
|---|---|---|
| committer | 2018-10-28 22:23:01 +0100 | |
| commit | a7c525f2c3b5faddd86d85212c4ac3cb6e36a35e (patch) | |
| tree | 82468897f37c0674056744d6b128b47f7e2ce105 /src/main/java/cuchaz/enigma/analysis/JarIndex.java | |
| parent | update to ASM 7.0 (diff) | |
| download | enigma-fork-a7c525f2c3b5faddd86d85212c4ac3cb6e36a35e.tar.gz enigma-fork-a7c525f2c3b5faddd86d85212c4ac3cb6e36a35e.tar.xz enigma-fork-a7c525f2c3b5faddd86d85212c4ac3cb6e36a35e.zip | |
expose AccessFlags over Access
Diffstat (limited to 'src/main/java/cuchaz/enigma/analysis/JarIndex.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/JarIndex.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/cuchaz/enigma/analysis/JarIndex.java b/src/main/java/cuchaz/enigma/analysis/JarIndex.java index 64ea795..a87d8c3 100644 --- a/src/main/java/cuchaz/enigma/analysis/JarIndex.java +++ b/src/main/java/cuchaz/enigma/analysis/JarIndex.java | |||
| @@ -25,7 +25,7 @@ public class JarIndex { | |||
| 25 | 25 | ||
| 26 | private Set<ClassEntry> obfClassEntries; | 26 | private Set<ClassEntry> obfClassEntries; |
| 27 | private TranslationIndex translationIndex; | 27 | private TranslationIndex translationIndex; |
| 28 | private Map<Entry, Access> access; | 28 | private Map<Entry, AccessFlags> access; |
| 29 | private Multimap<ClassEntry, FieldDefEntry> fields; | 29 | private Multimap<ClassEntry, FieldDefEntry> fields; |
| 30 | private Multimap<ClassEntry, MethodDefEntry> methods; | 30 | private Multimap<ClassEntry, MethodDefEntry> methods; |
| 31 | private Multimap<String, MethodDefEntry> methodImplementations; | 31 | private Multimap<String, MethodDefEntry> methodImplementations; |
| @@ -112,14 +112,14 @@ public class JarIndex { | |||
| 112 | protected void indexField(ClassDefEntry owner, int access, String name, String desc, String signature) { | 112 | 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)); | 113 | FieldDefEntry fieldEntry = new FieldDefEntry(owner, name, new TypeDescriptor(desc), Signature.createTypedSignature(signature), new AccessFlags(access)); |
| 114 | this.translationIndex.indexField(fieldEntry); | 114 | this.translationIndex.indexField(fieldEntry); |
| 115 | this.access.put(fieldEntry, Access.get(access)); | 115 | this.access.put(fieldEntry, owner.getAccess()); |
| 116 | this.fields.put(fieldEntry.getOwnerClassEntry(), fieldEntry); | 116 | this.fields.put(fieldEntry.getOwnerClassEntry(), fieldEntry); |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | protected void indexMethod(ClassDefEntry owner, int access, String name, String desc, String signature) { | 119 | 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)); | 120 | MethodDefEntry methodEntry = new MethodDefEntry(owner, name, new MethodDescriptor(desc), Signature.createSignature(signature), new AccessFlags(access)); |
| 121 | this.translationIndex.indexMethod(methodEntry); | 121 | this.translationIndex.indexMethod(methodEntry); |
| 122 | this.access.put(methodEntry, Access.get(access)); | 122 | this.access.put(methodEntry, owner.getAccess()); |
| 123 | this.methods.put(methodEntry.getOwnerClassEntry(), methodEntry); | 123 | this.methods.put(methodEntry.getOwnerClassEntry(), methodEntry); |
| 124 | 124 | ||
| 125 | if (new AccessFlags(access).isSynthetic()) { | 125 | if (new AccessFlags(access).isSynthetic()) { |
| @@ -231,7 +231,13 @@ public class JarIndex { | |||
| 231 | return this.translationIndex; | 231 | return this.translationIndex; |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | @Deprecated | ||
| 234 | public Access getAccess(Entry entry) { | 235 | public Access getAccess(Entry entry) { |
| 236 | AccessFlags flags = getAccessFlags(entry); | ||
| 237 | return flags != null ? Access.get(flags) : null; | ||
| 238 | } | ||
| 239 | |||
| 240 | public AccessFlags getAccessFlags(Entry entry) { | ||
| 235 | return this.access.get(entry); | 241 | return this.access.get(entry); |
| 236 | } | 242 | } |
| 237 | 243 | ||