diff --git a/extra/formatter.xml b/extra/formatter.xml new file mode 100644 index 000000000..ff2400053 --- /dev/null +++ b/extra/formatter.xml @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extra/mixin.importorder b/extra/mixin.importorder new file mode 100644 index 000000000..44b374b5e --- /dev/null +++ b/extra/mixin.importorder @@ -0,0 +1,7 @@ +#Organize Import Order +#Thu Jan 07 16:47:26 GMT 2016 +4=com +3=org +2=javax +1=java +0=\# diff --git a/src/agent/java/org/spongepowered/tools/agent/MixinAgent.java b/src/agent/java/org/spongepowered/tools/agent/MixinAgent.java index 156a22521..fa63b736f 100644 --- a/src/agent/java/org/spongepowered/tools/agent/MixinAgent.java +++ b/src/agent/java/org/spongepowered/tools/agent/MixinAgent.java @@ -24,13 +24,6 @@ */ package org.spongepowered.tools.agent; -import net.minecraft.launchwrapper.Launch; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.spongepowered.asm.mixin.transformer.MixinReloadException; -import org.spongepowered.asm.mixin.transformer.MixinTransformer; -import org.spongepowered.asm.mixin.transformer.debug.IHotSwap; - import java.lang.instrument.ClassDefinition; import java.lang.instrument.ClassFileTransformer; import java.lang.instrument.IllegalClassFormatException; @@ -39,6 +32,14 @@ import java.util.ArrayList; import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.spongepowered.asm.mixin.transformer.MixinReloadException; +import org.spongepowered.asm.mixin.transformer.MixinTransformer; +import org.spongepowered.asm.mixin.transformer.debug.IHotSwap; + +import net.minecraft.launchwrapper.Launch; + /** * An agent that re-transforms a mixin's target classes if the mixin has been * redefined. Basically this agent enables hot-swapping of mixins. diff --git a/src/agent/java/org/spongepowered/tools/agent/MixinAgentClassLoader.java b/src/agent/java/org/spongepowered/tools/agent/MixinAgentClassLoader.java index eb9ea2fc3..af84e57ab 100644 --- a/src/agent/java/org/spongepowered/tools/agent/MixinAgentClassLoader.java +++ b/src/agent/java/org/spongepowered/tools/agent/MixinAgentClassLoader.java @@ -24,6 +24,9 @@ */ package org.spongepowered.tools.agent; +import java.util.HashMap; +import java.util.Map; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.spongepowered.asm.lib.ClassWriter; @@ -32,9 +35,6 @@ import org.spongepowered.asm.lib.Type; import org.spongepowered.asm.mixin.MixinEnvironment; -import java.util.HashMap; -import java.util.Map; - /** * Class loader that is used to load fake mixin classes so that they can be * re-defined. diff --git a/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixin.java b/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixin.java index 3473619cc..f9ba32762 100644 --- a/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixin.java +++ b/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixin.java @@ -44,8 +44,6 @@ import javax.lang.model.type.TypeMirror; import javax.tools.Diagnostic.Kind; -import net.minecraftforge.srg2source.rangeapplier.MethodData; - import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.struct.InvalidMemberDescriptorException; import org.spongepowered.asm.mixin.injection.struct.MemberInfo; @@ -58,6 +56,8 @@ import org.spongepowered.tools.obfuscation.IMixinValidator.ValidationPass; import org.spongepowered.tools.obfuscation.struct.Message; +import net.minecraftforge.srg2source.rangeapplier.MethodData; + /** * Information about a mixin stored during processing diff --git a/src/ap/java/org/spongepowered/tools/obfuscation/TargetObfuscationEnvironment.java b/src/ap/java/org/spongepowered/tools/obfuscation/TargetObfuscationEnvironment.java index ebb40b204..22dc6660f 100644 --- a/src/ap/java/org/spongepowered/tools/obfuscation/TargetObfuscationEnvironment.java +++ b/src/ap/java/org/spongepowered/tools/obfuscation/TargetObfuscationEnvironment.java @@ -37,9 +37,9 @@ import javax.lang.model.type.DeclaredType; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; +import javax.tools.Diagnostic.Kind; import javax.tools.FileObject; import javax.tools.StandardLocation; -import javax.tools.Diagnostic.Kind; import org.spongepowered.asm.mixin.injection.struct.MemberInfo; import org.spongepowered.asm.mixin.injection.struct.ReferenceMapper; diff --git a/src/bridge/java/org/spongepowered/asm/bridge/RemapperAdapterFML.java b/src/bridge/java/org/spongepowered/asm/bridge/RemapperAdapterFML.java index 206ec1c59..165966cdd 100644 --- a/src/bridge/java/org/spongepowered/asm/bridge/RemapperAdapterFML.java +++ b/src/bridge/java/org/spongepowered/asm/bridge/RemapperAdapterFML.java @@ -24,12 +24,12 @@ */ package org.spongepowered.asm.bridge; -import org.objectweb.asm.commons.Remapper; -import org.spongepowered.asm.mixin.extensibility.IRemapper; - import java.lang.reflect.Field; import java.lang.reflect.Method; +import org.objectweb.asm.commons.Remapper; +import org.spongepowered.asm.mixin.extensibility.IRemapper; + public class RemapperAdapterFML extends RemapperAdapter { private final Method mdUnmap; diff --git a/src/main/java/org/spongepowered/asm/launch/MixinBootstrap.java b/src/main/java/org/spongepowered/asm/launch/MixinBootstrap.java index 1a0dbeb7a..fb5fa891e 100644 --- a/src/main/java/org/spongepowered/asm/launch/MixinBootstrap.java +++ b/src/main/java/org/spongepowered/asm/launch/MixinBootstrap.java @@ -26,13 +26,13 @@ import java.util.List; -import net.minecraft.launchwrapper.Launch; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.spongepowered.asm.mixin.MixinEnvironment; import org.spongepowered.asm.mixin.MixinEnvironment.Phase; +import net.minecraft.launchwrapper.Launch; + /** * Bootstaps the mixin subsystem. This class acts as a bridge between the mixin * subsystem and the tweaker or coremod which is boostrapping it. Without this diff --git a/src/main/java/org/spongepowered/asm/launch/MixinLaunchAgentAbstract.java b/src/main/java/org/spongepowered/asm/launch/MixinLaunchAgentAbstract.java index 30747daa6..94b969ec2 100644 --- a/src/main/java/org/spongepowered/asm/launch/MixinLaunchAgentAbstract.java +++ b/src/main/java/org/spongepowered/asm/launch/MixinLaunchAgentAbstract.java @@ -24,12 +24,12 @@ */ package org.spongepowered.asm.launch; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - import java.io.File; import java.net.URI; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + /** * Launch agent base class diff --git a/src/main/java/org/spongepowered/asm/launch/MixinLaunchAgentFML.java b/src/main/java/org/spongepowered/asm/launch/MixinLaunchAgentFML.java index bdd866239..e2b32bdb3 100644 --- a/src/main/java/org/spongepowered/asm/launch/MixinLaunchAgentFML.java +++ b/src/main/java/org/spongepowered/asm/launch/MixinLaunchAgentFML.java @@ -30,11 +30,12 @@ import java.net.URI; import java.util.List; +import org.spongepowered.asm.mixin.MixinEnvironment; +import org.spongepowered.asm.mixin.extensibility.IRemapper; + import net.minecraft.launchwrapper.ITweaker; import net.minecraft.launchwrapper.Launch; import net.minecraft.launchwrapper.LaunchClassLoader; -import org.spongepowered.asm.mixin.MixinEnvironment; -import org.spongepowered.asm.mixin.extensibility.IRemapper; /** * Launch agent for use under FML. diff --git a/src/main/java/org/spongepowered/asm/launch/MixinTweaker.java b/src/main/java/org/spongepowered/asm/launch/MixinTweaker.java index daba55860..56d294814 100644 --- a/src/main/java/org/spongepowered/asm/launch/MixinTweaker.java +++ b/src/main/java/org/spongepowered/asm/launch/MixinTweaker.java @@ -32,16 +32,16 @@ import java.util.List; import java.util.Map; -import net.minecraft.launchwrapper.ITweaker; -import net.minecraft.launchwrapper.Launch; -import net.minecraft.launchwrapper.LaunchClassLoader; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.spongepowered.asm.mixin.MixinEnvironment; import org.spongepowered.asm.mixin.MixinEnvironment.CompatibilityLevel; import org.spongepowered.asm.mixin.MixinEnvironment.Phase; +import net.minecraft.launchwrapper.ITweaker; +import net.minecraft.launchwrapper.Launch; +import net.minecraft.launchwrapper.LaunchClassLoader; + /** * TweakClass for running mixins in production. Being a tweaker ensures that we diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/struct/InjectionPointData.java b/src/main/java/org/spongepowered/asm/mixin/injection/struct/InjectionPointData.java index ffd148aef..0709b6a17 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/struct/InjectionPointData.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/struct/InjectionPointData.java @@ -28,6 +28,7 @@ import java.util.List; import java.util.Map; +import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.transformer.IReferenceMapperContext; diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/struct/MemberInfo.java b/src/main/java/org/spongepowered/asm/mixin/injection/struct/MemberInfo.java index 4f904c930..b5ce7c9c5 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/struct/MemberInfo.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/struct/MemberInfo.java @@ -24,8 +24,6 @@ */ package org.spongepowered.asm.mixin.injection.struct; -import net.minecraftforge.srg2source.rangeapplier.MethodData; - import org.spongepowered.asm.lib.Type; import org.spongepowered.asm.lib.tree.AbstractInsnNode; import org.spongepowered.asm.lib.tree.FieldInsnNode; @@ -33,6 +31,8 @@ import org.spongepowered.asm.mixin.transformer.IReferenceMapperContext; import org.spongepowered.asm.util.SignaturePrinter; +import net.minecraftforge.srg2source.rangeapplier.MethodData; + /** *

Information bundle about a member (method or field) parsed from a String diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/struct/ReferenceMapper.java b/src/main/java/org/spongepowered/asm/mixin/injection/struct/ReferenceMapper.java index 7be5e8f1b..d06e2bc21 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/struct/ReferenceMapper.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/struct/ReferenceMapper.java @@ -31,12 +31,12 @@ import java.util.HashMap; import java.util.Map; -import net.minecraft.launchwrapper.Launch; - import com.google.common.collect.Maps; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import net.minecraft.launchwrapper.Launch; + public final class ReferenceMapper implements Serializable { private static final long serialVersionUID = 2L; diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/InterfaceInfo.java b/src/main/java/org/spongepowered/asm/mixin/transformer/InterfaceInfo.java index d51321db6..a6ea42e12 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/InterfaceInfo.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/InterfaceInfo.java @@ -30,6 +30,7 @@ import org.spongepowered.asm.lib.Type; import org.spongepowered.asm.lib.tree.AnnotationNode; import org.spongepowered.asm.lib.tree.MethodNode; +import org.spongepowered.asm.mixin.Interface; import org.spongepowered.asm.mixin.transformer.ClassInfo.Method; import org.spongepowered.asm.mixin.transformer.meta.MixinRenamed; import org.spongepowered.asm.util.ASMHelper; diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinApplicator.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinApplicator.java index 65bb13fce..98dbe626b 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinApplicator.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinApplicator.java @@ -48,8 +48,9 @@ import org.spongepowered.asm.lib.tree.MethodNode; import org.spongepowered.asm.mixin.Intrinsic; import org.spongepowered.asm.mixin.MixinEnvironment; -import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.MixinEnvironment.Option; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.struct.InjectionInfo; import org.spongepowered.asm.mixin.transformer.meta.MixinMerged; import org.spongepowered.asm.mixin.transformer.meta.MixinRenamed; diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinConfig.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinConfig.java index 9e2324698..9f0dcda87 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinConfig.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinConfig.java @@ -34,13 +34,11 @@ import java.util.Map; import java.util.Set; -import net.minecraft.launchwrapper.Launch; - import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.spongepowered.asm.lib.tree.ClassNode; import org.spongepowered.asm.launch.MixinInitialisationError; +import org.spongepowered.asm.lib.tree.ClassNode; import org.spongepowered.asm.mixin.MixinEnvironment; import org.spongepowered.asm.mixin.MixinEnvironment.Option; import org.spongepowered.asm.mixin.extensibility.IMixinConfig; @@ -52,6 +50,8 @@ import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; +import net.minecraft.launchwrapper.Launch; + /** * Mixin configuration bundle */ diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinInfo.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinInfo.java index 86bce5d92..49933c6ae 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinInfo.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinInfo.java @@ -32,9 +32,6 @@ import java.util.List; import java.util.Set; -import net.minecraft.launchwrapper.Launch; -import net.minecraft.launchwrapper.LaunchClassLoader; - import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -61,6 +58,9 @@ import com.google.common.base.Functions; import com.google.common.collect.Lists; +import net.minecraft.launchwrapper.Launch; +import net.minecraft.launchwrapper.LaunchClassLoader; + /** * Runtime information bundle about a mixin */ diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinTargetContext.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinTargetContext.java index ebfaa67e0..eff6a03e7 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinTargetContext.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinTargetContext.java @@ -36,8 +36,8 @@ import org.spongepowered.asm.lib.Opcodes; import org.spongepowered.asm.lib.Type; import org.spongepowered.asm.lib.tree.*; -import org.spongepowered.asm.mixin.MixinEnvironment.CompatibilityLevel; import org.spongepowered.asm.mixin.MixinEnvironment; +import org.spongepowered.asm.mixin.MixinEnvironment.CompatibilityLevel; import org.spongepowered.asm.mixin.SoftOverride; import org.spongepowered.asm.mixin.injection.struct.ReferenceMapper; import org.spongepowered.asm.mixin.injection.struct.Target; diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/TreeInfo.java b/src/main/java/org/spongepowered/asm/mixin/transformer/TreeInfo.java index 9c9dfeb42..fbbd17caf 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/TreeInfo.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/TreeInfo.java @@ -28,9 +28,6 @@ import java.io.InputStream; import java.net.URLClassLoader; -import net.minecraft.launchwrapper.IClassTransformer; -import net.minecraft.launchwrapper.Launch; - import org.apache.commons.io.IOUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -39,6 +36,9 @@ import org.spongepowered.asm.mixin.MixinEnvironment; import org.spongepowered.asm.mixin.transformer.MixinTransformer.ReEntranceState; +import net.minecraft.launchwrapper.IClassTransformer; +import net.minecraft.launchwrapper.Launch; + /** * Base class for "info" objects which use ASM tree API to do stuff, with things */ diff --git a/src/main/java/org/spongepowered/asm/transformers/TreeTransformer.java b/src/main/java/org/spongepowered/asm/transformers/TreeTransformer.java index cefca54dd..ed2174dbd 100644 --- a/src/main/java/org/spongepowered/asm/transformers/TreeTransformer.java +++ b/src/main/java/org/spongepowered/asm/transformers/TreeTransformer.java @@ -24,13 +24,13 @@ */ package org.spongepowered.asm.transformers; -import net.minecraft.launchwrapper.IClassTransformer; - import org.spongepowered.asm.lib.ClassReader; import org.spongepowered.asm.lib.ClassWriter; import org.spongepowered.asm.lib.tree.ClassNode; import org.spongepowered.asm.mixin.transformer.MixinClassWriter; +import net.minecraft.launchwrapper.IClassTransformer; + /** * Base class for transformers which work with ASM tree model */