diff options
| author | 2014-08-20 22:30:12 -0400 | |
|---|---|---|
| committer | 2014-08-20 22:30:12 -0400 | |
| commit | bdb61cf849c67f7da6a0bb7c047b506d8462058f (patch) | |
| tree | f76ffd0c4d6c965164e836f089a0cf397eb1ab8e /src/cuchaz | |
| parent | missed a file (diff) | |
| download | enigma-bdb61cf849c67f7da6a0bb7c047b506d8462058f.tar.gz enigma-bdb61cf849c67f7da6a0bb7c047b506d8462058f.tar.xz enigma-bdb61cf849c67f7da6a0bb7c047b506d8462058f.zip | |
fixed recognition of inner class tokens
fixed recognition of reference tokens in constructors
Diffstat (limited to 'src/cuchaz')
| -rw-r--r-- | src/cuchaz/enigma/analysis/SourceIndexClassVisitor.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/cuchaz/enigma/analysis/SourceIndexClassVisitor.java b/src/cuchaz/enigma/analysis/SourceIndexClassVisitor.java index 2d4c0f57..52570886 100644 --- a/src/cuchaz/enigma/analysis/SourceIndexClassVisitor.java +++ b/src/cuchaz/enigma/analysis/SourceIndexClassVisitor.java | |||
| @@ -14,6 +14,7 @@ import com.google.common.collect.HashMultiset; | |||
| 14 | import com.google.common.collect.Multiset; | 14 | import com.google.common.collect.Multiset; |
| 15 | import com.strobel.assembler.metadata.FieldDefinition; | 15 | import com.strobel.assembler.metadata.FieldDefinition; |
| 16 | import com.strobel.assembler.metadata.MethodDefinition; | 16 | import com.strobel.assembler.metadata.MethodDefinition; |
| 17 | import com.strobel.assembler.metadata.TypeDefinition; | ||
| 17 | import com.strobel.assembler.metadata.TypeReference; | 18 | import com.strobel.assembler.metadata.TypeReference; |
| 18 | import com.strobel.decompiler.languages.TextLocation; | 19 | import com.strobel.decompiler.languages.TextLocation; |
| 19 | import com.strobel.decompiler.languages.java.ast.ConstructorDeclaration; | 20 | import com.strobel.decompiler.languages.java.ast.ConstructorDeclaration; |
| @@ -45,6 +46,16 @@ public class SourceIndexClassVisitor extends SourceIndexVisitor | |||
| 45 | @Override | 46 | @Override |
| 46 | public Void visitTypeDeclaration( TypeDeclaration node, SourceIndex index ) | 47 | public Void visitTypeDeclaration( TypeDeclaration node, SourceIndex index ) |
| 47 | { | 48 | { |
| 49 | // is this this class, or a subtype? | ||
| 50 | TypeDefinition def = node.getUserData( Keys.TYPE_DEFINITION ); | ||
| 51 | ClassEntry classEntry = new ClassEntry( def.getInternalName() ); | ||
| 52 | if( !classEntry.equals( m_classEntry ) ) | ||
| 53 | { | ||
| 54 | // it's a sub-type, recurse | ||
| 55 | index.addDeclaration( node.getNameToken(), classEntry ); | ||
| 56 | return node.acceptVisitor( new SourceIndexClassVisitor( classEntry ), index ); | ||
| 57 | } | ||
| 58 | |||
| 48 | return recurse( node, index ); | 59 | return recurse( node, index ); |
| 49 | } | 60 | } |
| 50 | 61 | ||
| @@ -84,7 +95,7 @@ public class SourceIndexClassVisitor extends SourceIndexVisitor | |||
| 84 | ConstructorEntry constructorEntry = new ConstructorEntry( classEntry, def.getSignature() ); | 95 | ConstructorEntry constructorEntry = new ConstructorEntry( classEntry, def.getSignature() ); |
| 85 | index.addDeclaration( node.getNameToken(), constructorEntry ); | 96 | index.addDeclaration( node.getNameToken(), constructorEntry ); |
| 86 | 97 | ||
| 87 | return recurse( node, index ); | 98 | return node.acceptVisitor( new SourceIndexBehaviorVisitor( constructorEntry ), index ); |
| 88 | } | 99 | } |
| 89 | 100 | ||
| 90 | @Override | 101 | @Override |