From 6e464ea251cab63c776ece0b2a356f1498ffa294 Mon Sep 17 00:00:00 2001 From: Thog Date: Wed, 8 Mar 2017 08:17:04 +0100 Subject: Follow Fabric guidelines --- src/test/java/cuchaz/enigma/TestSourceIndex.java | 30 ++++++++++-------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'src/test/java/cuchaz/enigma/TestSourceIndex.java') diff --git a/src/test/java/cuchaz/enigma/TestSourceIndex.java b/src/test/java/cuchaz/enigma/TestSourceIndex.java index 58d9ca9..6e9e5ae 100644 --- a/src/test/java/cuchaz/enigma/TestSourceIndex.java +++ b/src/test/java/cuchaz/enigma/TestSourceIndex.java @@ -4,27 +4,26 @@ * are made available under the terms of the GNU Lesser General Public * License v3.0 which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl.html - * + * * Contributors: * Jeff Martin - initial API and implementation ******************************************************************************/ -package cuchaz.enigma; - -import java.io.File; -import java.util.Set; -import java.util.jar.JarFile; -import org.junit.Test; +package cuchaz.enigma; import com.google.common.collect.Sets; import com.strobel.decompiler.languages.java.ast.CompilationUnit; - import cuchaz.enigma.mapping.ClassEntry; +import org.junit.Test; + +import java.io.File; +import java.util.Set; +import java.util.jar.JarFile; public class TestSourceIndex { @Test public void indexEverything() - throws Exception { + throws Exception { // Figure out where Minecraft is... final String mcDir = System.getProperty("enigma.test.minecraftdir"); File mcJar = null; @@ -32,20 +31,17 @@ public class TestSourceIndex { String osname = System.getProperty("os.name").toLowerCase(); if (osname.contains("nix") || osname.contains("nux") || osname.contains("solaris")) { mcJar = new File(System.getProperty("user.home"), ".minecraft/versions/1.8.3/1.8.3.jar"); - } - else if (osname.contains("mac") || osname.contains("darwin")) { + } else if (osname.contains("mac") || osname.contains("darwin")) { mcJar = new File(System.getProperty("user.home"), "Library/Application Support/minecraft/versions/1.8.3/1.8.3.jar"); - } - else if (osname.contains("win")) { + } else if (osname.contains("win")) { mcJar = new File(System.getenv("AppData"), ".minecraft/versions/1.8.3/1.8.3.jar"); } - } - else { + } else { mcJar = new File(mcDir, "versions/1.8.3/1.8.3.jar"); } Deobfuscator deobfuscator = new Deobfuscator(new JarFile(mcJar)); - + // get all classes that aren't inner classes Set classEntries = Sets.newHashSet(); for (ClassEntry obfClassEntry : deobfuscator.getJarIndex().getObfClassEntries()) { @@ -53,7 +49,7 @@ public class TestSourceIndex { classEntries.add(obfClassEntry); } } - + for (ClassEntry obfClassEntry : classEntries) { try { CompilationUnit tree = deobfuscator.getSourceTree(obfClassEntry.getName()); -- cgit v1.2.3