diff --git a/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java b/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java index 5bc59ce3..9881e1c5 100644 --- a/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java +++ b/src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java @@ -394,6 +394,8 @@ public class MixinEnvironment { /** * Get the phase for this environment + * + * @return the phase */ public Phase getPhase() { return this.phase; @@ -441,6 +443,8 @@ public class MixinEnvironment { /** * Get all registered error handlers for this environment + * + * @return set of error handler class names */ public Set getErrorHandlerClasses() { return Collections.unmodifiableSet(this.errorHandlers); @@ -448,6 +452,8 @@ public class MixinEnvironment { /** * Get the active mixin transformer instance (if any) + * + * @return active mixin transformer instance */ public Object getActiveTransformer() { return Launch.blackboard.get(MixinEnvironment.TRANSFORMER_KEY); @@ -497,6 +503,8 @@ public class MixinEnvironment { /** * Get the current mixin subsystem version + * + * @return current version */ public String getVersion() { return (String)Launch.blackboard.get(MixinBootstrap.INIT_KEY); @@ -536,6 +544,8 @@ public class MixinEnvironment { /** * Returns (and generates if necessary) the transformer delegation list for * this environment. + * + * @return current transformer delegation list (read-only) */ public List getTransformers() { if (this.transformers == null) { @@ -548,7 +558,7 @@ public class MixinEnvironment { /** * Adds a transformer to the transformer exclusions list * - * @param name + * @param name Class transformer exclusion to add */ public void addTransformerExclusion(String name) { MixinEnvironment.excludeTransformers.add(name); @@ -560,7 +570,7 @@ public class MixinEnvironment { /** * Map a class name back to its obfuscated counterpart * - * @param className + * @param className class name to unmap * @return obfuscated name for the specified deobfuscated reference */ public String unmap(String className) { @@ -662,6 +672,8 @@ public class MixinEnvironment { /** * Gets the default environment + * + * @return the {@link Phase#DEFAULT DEFAULT} environment */ public static MixinEnvironment getDefaultEnvironment() { return MixinEnvironment.getEnvironment(Phase.DEFAULT); @@ -669,6 +681,8 @@ public class MixinEnvironment { /** * Gets the current environment + * + * @return the currently active environment */ public static MixinEnvironment getCurrentEnvironment() { if (MixinEnvironment.currentEnvironment == null) { diff --git a/src/main/java/org/spongepowered/asm/mixin/extensibility/IMixinConfig.java b/src/main/java/org/spongepowered/asm/mixin/extensibility/IMixinConfig.java index b46dfed2..3ae1d1fa 100644 --- a/src/main/java/org/spongepowered/asm/mixin/extensibility/IMixinConfig.java +++ b/src/main/java/org/spongepowered/asm/mixin/extensibility/IMixinConfig.java @@ -26,37 +26,52 @@ package org.spongepowered.asm.mixin.extensibility; import java.util.Set; +/** + * Interface for loaded mixin configurations + */ public interface IMixinConfig { /** * Get the name of the file from which this configuration object was * initialised + * + * @return the config filename (resource name) */ public abstract String getName(); /** * Get the package containing all mixin classes + * + * @return the base package name for this config */ public abstract String getMixinPackage(); /** * Get the priority + * + * @return the priority */ public abstract int getPriority(); /** * Get the companion plugin, if available + * + * @return the companion plugin instance or null if no plugin */ public abstract IMixinConfigPlugin getPlugin(); /** * True if this mixin is required (failure to apply a defined mixin * is an error condition). + * + * @return true if this config is marked as required */ public abstract boolean isRequired(); /** * Get targets for this configuration + * + * @return target classes of mixins in this config */ public abstract Set getTargets(); diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/struct/Target.java b/src/main/java/org/spongepowered/asm/mixin/injection/struct/Target.java index fa00663c..10c8b0b8 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/struct/Target.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/struct/Target.java @@ -108,6 +108,8 @@ public class Target { /** * Get the original max locals of the method + * + * @return the original max locals value */ public int getMaxLocals() { return this.maxLocals; @@ -115,6 +117,8 @@ public class Target { /** * Get the original max stack of the method + * + * @return the original max stack value */ public int getMaxStack() { return this.maxStack; @@ -122,6 +126,8 @@ public class Target { /** * Get the current max locals of the method + * + * @return the current max local value */ public int getCurrentMaxLocals() { return this.method.maxLocals; @@ -129,6 +135,8 @@ public class Target { /** * Get the current max stack of the method + * + * @return the current max stack value */ public int getCurrentMaxStack() { return this.method.maxStack; @@ -136,6 +144,8 @@ public class Target { /** * Allocate a new local variable for the method + * + * @return the allocated local index */ public int allocateLocal() { return this.allocateLocals(1); @@ -159,7 +169,6 @@ public class Target { * first stack index of the allocated range * * @param locals number of locals to allocate - * @return the first local variable index of the allocated range */ public void addToLocals(int locals) { this.setMaxLocals(this.maxLocals + locals); 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 89010fed..3829e98b 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinTargetContext.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinTargetContext.java @@ -586,7 +586,7 @@ public class MixinTargetContext implements IReferenceMapperContext { /** * Get shadow methods in this mixin * - * @return + * @return shadow methods in the mixin */ public List getShadowMethods() { return this.shadowMethods; @@ -595,7 +595,7 @@ public class MixinTargetContext implements IReferenceMapperContext { /** * Get methods to mixin * - * @return + * @return non-shadow methods in the mixin */ public List getMethods() { return this.classNode.methods; @@ -604,7 +604,7 @@ public class MixinTargetContext implements IReferenceMapperContext { /** * Get shadow fields in this mixin * - * @return + * @return shadow fields in the mixin */ public List getShadowFields() { return this.shadowFields; @@ -613,7 +613,7 @@ public class MixinTargetContext implements IReferenceMapperContext { /** * Get fields to mixin * - * @return + * @return non-shadow fields in the mixin */ public List getFields() { return this.classNode.fields; 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 a4196d4f..624b0e0f 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/TreeInfo.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/TreeInfo.java @@ -60,8 +60,10 @@ abstract class TreeInfo { } /** - * @param classBytes - * @param flags + * Gets an ASM Tree for the supplied class bytecode + * + * @param classBytes Class bytecode + * @param flags ClassReader flags * @return ASM Tree view of the specified class */ protected static ClassNode getClassNode(byte[] classBytes, int flags) { @@ -72,9 +74,14 @@ abstract class TreeInfo { } /** - * @param className - * @param runTransformers + * Loads class bytecode from the classpath + * + * @param className Name of the class to load + * @param runTransformers True to run the loaded bytecode through the + * delegate transformer chain * @return Transformed class bytecode for the specified class + * @throws ClassNotFoundException if the specified class could not be loaded + * @throws IOException if an error occurs whilst reading the specified class */ protected static byte[] loadClass(String className, boolean runTransformers) throws ClassNotFoundException, IOException { String transformedName = className.replace('/', '.'); diff --git a/src/main/java/org/spongepowered/asm/util/PrettyPrinter.java b/src/main/java/org/spongepowered/asm/util/PrettyPrinter.java index 6810c7bb..046018ed 100644 --- a/src/main/java/org/spongepowered/asm/util/PrettyPrinter.java +++ b/src/main/java/org/spongepowered/asm/util/PrettyPrinter.java @@ -93,16 +93,21 @@ public class PrettyPrinter { } /** - * @param array - * @return + * Add elements of the array to the output, one per line + * + * @param array Array of objects to print + * @return fluent interface */ public PrettyPrinter add(Object[] array) { return this.add(array, "%s"); } /** - * @param array - * @return + * Add elements of the array to the output, one per line + * + * @param array Array of objects to print + * @param format Format for each row + * @return fluent interface */ public PrettyPrinter add(Object[] array, String format) { for (Object element : array) {