diff options
| author | 2015-01-13 23:25:04 -0500 | |
|---|---|---|
| committer | 2015-01-13 23:25:04 -0500 | |
| commit | 959cb5fd4f9586ec3bd265b452fe25fe1db82e3f (patch) | |
| tree | bdd8a2c52c2fe053ba3460614bde8542e5378dbe /test/cuchaz/enigma/TestSourceIndex.java | |
| parent | got rid of gradle in favor of ivy+ssjb (diff) | |
| download | enigma-fork-959cb5fd4f9586ec3bd265b452fe25fe1db82e3f.tar.gz enigma-fork-959cb5fd4f9586ec3bd265b452fe25fe1db82e3f.tar.xz enigma-fork-959cb5fd4f9586ec3bd265b452fe25fe1db82e3f.zip | |
source format change
don't hate me too much if you were planning a big merge. =P
Diffstat (limited to 'test/cuchaz/enigma/TestSourceIndex.java')
| -rw-r--r-- | test/cuchaz/enigma/TestSourceIndex.java | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/test/cuchaz/enigma/TestSourceIndex.java b/test/cuchaz/enigma/TestSourceIndex.java index dc6ca7e..fb385e0 100644 --- a/test/cuchaz/enigma/TestSourceIndex.java +++ b/test/cuchaz/enigma/TestSourceIndex.java | |||
| @@ -21,35 +21,27 @@ import com.strobel.decompiler.languages.java.ast.CompilationUnit; | |||
| 21 | 21 | ||
| 22 | import cuchaz.enigma.mapping.ClassEntry; | 22 | import cuchaz.enigma.mapping.ClassEntry; |
| 23 | 23 | ||
| 24 | public class TestSourceIndex | 24 | public class TestSourceIndex { |
| 25 | { | 25 | |
| 26 | @Test | 26 | @Test |
| 27 | public void indexEverything( ) | 27 | public void indexEverything() throws Exception { |
| 28 | throws Exception | 28 | Deobfuscator deobfuscator = new Deobfuscator(new File("input/1.8.jar")); |
| 29 | { | ||
| 30 | Deobfuscator deobfuscator = new Deobfuscator( new File( "input/1.8.jar" ) ); | ||
| 31 | 29 | ||
| 32 | // get all classes that aren't inner classes | 30 | // get all classes that aren't inner classes |
| 33 | Set<ClassEntry> classEntries = Sets.newHashSet(); | 31 | Set<ClassEntry> classEntries = Sets.newHashSet(); |
| 34 | for( ClassEntry obfClassEntry : deobfuscator.getJarIndex().getObfClassEntries() ) | 32 | for (ClassEntry obfClassEntry : deobfuscator.getJarIndex().getObfClassEntries()) { |
| 35 | { | 33 | if (!obfClassEntry.isInnerClass()) { |
| 36 | if( !obfClassEntry.isInnerClass() ) | 34 | classEntries.add(obfClassEntry); |
| 37 | { | ||
| 38 | classEntries.add( obfClassEntry ); | ||
| 39 | } | 35 | } |
| 40 | } | 36 | } |
| 41 | 37 | ||
| 42 | for( ClassEntry obfClassEntry : classEntries ) | 38 | for (ClassEntry obfClassEntry : classEntries) { |
| 43 | { | 39 | try { |
| 44 | try | 40 | CompilationUnit tree = deobfuscator.getSourceTree(obfClassEntry.getName()); |
| 45 | { | 41 | String source = deobfuscator.getSource(tree); |
| 46 | CompilationUnit tree = deobfuscator.getSourceTree( obfClassEntry.getName() ); | 42 | deobfuscator.getSourceIndex(tree, source); |
| 47 | String source = deobfuscator.getSource( tree ); | 43 | } catch (Throwable t) { |
| 48 | deobfuscator.getSourceIndex( tree, source ); | 44 | throw new Error("Unable to index " + obfClassEntry, t); |
| 49 | } | ||
| 50 | catch( Throwable t ) | ||
| 51 | { | ||
| 52 | throw new Error( "Unable to index " + obfClassEntry, t ); | ||
| 53 | } | 45 | } |
| 54 | } | 46 | } |
| 55 | } | 47 | } |