diff options
Diffstat (limited to 'src/cuchaz/enigma/analysis/SourceIndexClassVisitor.java')
| -rw-r--r-- | src/cuchaz/enigma/analysis/SourceIndexClassVisitor.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/cuchaz/enigma/analysis/SourceIndexClassVisitor.java b/src/cuchaz/enigma/analysis/SourceIndexClassVisitor.java index e2ff300..d6692f6 100644 --- a/src/cuchaz/enigma/analysis/SourceIndexClassVisitor.java +++ b/src/cuchaz/enigma/analysis/SourceIndexClassVisitor.java | |||
| @@ -26,11 +26,10 @@ import com.strobel.decompiler.languages.java.ast.TypeDeclaration; | |||
| 26 | import com.strobel.decompiler.languages.java.ast.VariableInitializer; | 26 | import com.strobel.decompiler.languages.java.ast.VariableInitializer; |
| 27 | 27 | ||
| 28 | import cuchaz.enigma.mapping.BehaviorEntry; | 28 | import cuchaz.enigma.mapping.BehaviorEntry; |
| 29 | import cuchaz.enigma.mapping.BehaviorEntryFactory; | ||
| 30 | import cuchaz.enigma.mapping.ClassEntry; | 29 | import cuchaz.enigma.mapping.ClassEntry; |
| 31 | import cuchaz.enigma.mapping.ConstructorEntry; | 30 | import cuchaz.enigma.mapping.ConstructorEntry; |
| 31 | import cuchaz.enigma.mapping.EntryFactory; | ||
| 32 | import cuchaz.enigma.mapping.FieldEntry; | 32 | import cuchaz.enigma.mapping.FieldEntry; |
| 33 | import cuchaz.enigma.mapping.Signature; | ||
| 34 | import cuchaz.enigma.mapping.Type; | 33 | import cuchaz.enigma.mapping.Type; |
| 35 | 34 | ||
| 36 | public class SourceIndexClassVisitor extends SourceIndexVisitor { | 35 | public class SourceIndexClassVisitor extends SourceIndexVisitor { |
| @@ -69,12 +68,13 @@ public class SourceIndexClassVisitor extends SourceIndexVisitor { | |||
| 69 | @Override | 68 | @Override |
| 70 | public Void visitMethodDeclaration(MethodDeclaration node, SourceIndex index) { | 69 | public Void visitMethodDeclaration(MethodDeclaration node, SourceIndex index) { |
| 71 | MethodDefinition def = node.getUserData(Keys.METHOD_DEFINITION); | 70 | MethodDefinition def = node.getUserData(Keys.METHOD_DEFINITION); |
| 72 | ClassEntry classEntry = new ClassEntry(def.getDeclaringType().getInternalName()); | 71 | BehaviorEntry behaviorEntry = EntryFactory.getBehaviorEntry(def); |
| 73 | BehaviorEntry behaviorEntry = BehaviorEntryFactory.create(classEntry, def.getName(), def.getSignature()); | ||
| 74 | AstNode tokenNode = node.getNameToken(); | 72 | AstNode tokenNode = node.getNameToken(); |
| 73 | |||
| 75 | if (behaviorEntry instanceof ConstructorEntry) { | 74 | if (behaviorEntry instanceof ConstructorEntry) { |
| 76 | ConstructorEntry constructorEntry = (ConstructorEntry)behaviorEntry; | 75 | ConstructorEntry constructorEntry = (ConstructorEntry)behaviorEntry; |
| 77 | if (constructorEntry.isStatic()) { | 76 | if (constructorEntry.isStatic()) { |
| 77 | // for static initializers, check elsewhere for the token node | ||
| 78 | tokenNode = node.getModifiers().firstOrNullObject(); | 78 | tokenNode = node.getModifiers().firstOrNullObject(); |
| 79 | } | 79 | } |
| 80 | } | 80 | } |
| @@ -85,8 +85,7 @@ public class SourceIndexClassVisitor extends SourceIndexVisitor { | |||
| 85 | @Override | 85 | @Override |
| 86 | public Void visitConstructorDeclaration(ConstructorDeclaration node, SourceIndex index) { | 86 | public Void visitConstructorDeclaration(ConstructorDeclaration node, SourceIndex index) { |
| 87 | MethodDefinition def = node.getUserData(Keys.METHOD_DEFINITION); | 87 | MethodDefinition def = node.getUserData(Keys.METHOD_DEFINITION); |
| 88 | ClassEntry classEntry = new ClassEntry(def.getDeclaringType().getInternalName()); | 88 | ConstructorEntry constructorEntry = EntryFactory.getConstructorEntry(def); |
| 89 | ConstructorEntry constructorEntry = new ConstructorEntry(classEntry, new Signature(def.getSignature())); | ||
| 90 | index.addDeclaration(node.getNameToken(), constructorEntry); | 89 | index.addDeclaration(node.getNameToken(), constructorEntry); |
| 91 | return node.acceptVisitor(new SourceIndexBehaviorVisitor(constructorEntry), index); | 90 | return node.acceptVisitor(new SourceIndexBehaviorVisitor(constructorEntry), index); |
| 92 | } | 91 | } |