diff options
| author | 2014-09-14 23:56:43 -0400 | |
|---|---|---|
| committer | 2014-09-14 23:56:43 -0400 | |
| commit | 72e918a5134c2bf747a476284bcfa1bd2ef2fa21 (patch) | |
| tree | 2fd256d6a8bbe38b7b9fe1892f444a8c29de08ef /src/cuchaz/enigma/analysis/SourceIndex.java | |
| parent | added test to check constructor references (diff) | |
| download | enigma-fork-72e918a5134c2bf747a476284bcfa1bd2ef2fa21.tar.gz enigma-fork-72e918a5134c2bf747a476284bcfa1bd2ef2fa21.tar.xz enigma-fork-72e918a5134c2bf747a476284bcfa1bd2ef2fa21.zip | |
added tests to check constructor tokens
fixed a bug with constructor tokens too
Diffstat (limited to '')
| -rw-r--r-- | src/cuchaz/enigma/analysis/SourceIndex.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cuchaz/enigma/analysis/SourceIndex.java b/src/cuchaz/enigma/analysis/SourceIndex.java index 1a5a80d..b777f9f 100644 --- a/src/cuchaz/enigma/analysis/SourceIndex.java +++ b/src/cuchaz/enigma/analysis/SourceIndex.java | |||
| @@ -20,7 +20,7 @@ import com.google.common.collect.Lists; | |||
| 20 | import com.google.common.collect.Maps; | 20 | import com.google.common.collect.Maps; |
| 21 | import com.google.common.collect.Multimap; | 21 | import com.google.common.collect.Multimap; |
| 22 | import com.strobel.decompiler.languages.Region; | 22 | import com.strobel.decompiler.languages.Region; |
| 23 | import com.strobel.decompiler.languages.java.ast.Identifier; | 23 | import com.strobel.decompiler.languages.java.ast.AstNode; |
| 24 | 24 | ||
| 25 | import cuchaz.enigma.mapping.Entry; | 25 | import cuchaz.enigma.mapping.Entry; |
| 26 | 26 | ||
| @@ -56,7 +56,7 @@ public class SourceIndex | |||
| 56 | return m_source; | 56 | return m_source; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | public Token getToken( Identifier node ) | 59 | public Token getToken( AstNode node ) |
| 60 | { | 60 | { |
| 61 | // get a token for this node's region | 61 | // get a token for this node's region |
| 62 | Region region = node.getRegion(); | 62 | Region region = node.getRegion(); |
| @@ -71,7 +71,7 @@ public class SourceIndex | |||
| 71 | ); | 71 | ); |
| 72 | 72 | ||
| 73 | // for tokens representing inner classes, make sure we only get the simple name | 73 | // for tokens representing inner classes, make sure we only get the simple name |
| 74 | int pos = node.getName().lastIndexOf( '$' ); | 74 | int pos = node.toString().lastIndexOf( '$' ); |
| 75 | if( pos >= 0 ) | 75 | if( pos >= 0 ) |
| 76 | { | 76 | { |
| 77 | token.end -= pos + 1; | 77 | token.end -= pos + 1; |
| @@ -92,7 +92,7 @@ public class SourceIndex | |||
| 92 | return token; | 92 | return token; |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | public void addReference( Identifier node, EntryReference<Entry,Entry> deobfReference ) | 95 | public void addReference( AstNode node, EntryReference<Entry,Entry> deobfReference ) |
| 96 | { | 96 | { |
| 97 | Token token = getToken( node ); | 97 | Token token = getToken( node ); |
| 98 | if( token != null ) | 98 | if( token != null ) |
| @@ -102,7 +102,7 @@ public class SourceIndex | |||
| 102 | } | 102 | } |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | public void addDeclaration( Identifier node, Entry deobfEntry ) | 105 | public void addDeclaration( AstNode node, Entry deobfEntry ) |
| 106 | { | 106 | { |
| 107 | Token token = getToken( node ); | 107 | Token token = getToken( node ); |
| 108 | if( token != null ) | 108 | if( token != null ) |