diff --git a/src/main/java/org/spongepowered/asm/mixin/Shadow.java b/src/main/java/org/spongepowered/asm/mixin/Shadow.java index fcbaa5ca..c411e205 100644 --- a/src/main/java/org/spongepowered/asm/mixin/Shadow.java +++ b/src/main/java/org/spongepowered/asm/mixin/Shadow.java @@ -56,7 +56,7 @@ public @interface Shadow { * * *

All of these declarations are semantically equivalent, however the third and fourth are the most expressive in terms of making their - * intentions clear, and thus specifying prefix is recommended, since it aids readability and maintainability.

+ * intentions clear, and thus specifying prefix is recommended, since it aids readability and maintainability.

* *

Note that specifying a prefix does not enforce use of the prefix, the behaviour of prefix is such that the prefix * will be stripped from the start of the method name as long as the method name actually starts with the prefix! This has important diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/At.java b/src/main/java/org/spongepowered/asm/mixin/injection/At.java index 46c5f0b4..a1144020 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/At.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/At.java @@ -82,7 +82,9 @@ public @interface At { /** * Target member used by INVOKE, INVOKE_STRING and FIELD. This must be specified as a fully-qualified member path including the class name - * and signature. Failing to fully-qualify the target member will result in an error at obfuscation time. + * and signature. Failing to fully-qualify the target member will result in an error at obfuscation time. + * + * @return target reference for supported InjectionPoint types */ public String target() default ""; @@ -90,7 +92,9 @@ public @interface At { * Ordinal offset. Many InjectionPoints will return every opcode matching their criteria, specifying ordinal allows a particular opcode * to be identified from the returned list. The default value of -1 does not alter the behaviour and returns all matching opcodes. Specifying a * value of 0 or higher returns only the requested opcode (if one exists: for example specifying an ordinal of 4 when only 2 opcodes are - * matched by the InjectionPoint is not going to work particularly well!) + * matched by the InjectionPoint is not going to work particularly well!) + * + * @return ordinal value for supported InjectionPoint types */ public int ordinal() default -1; diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeFieldAccess.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeFieldAccess.java index a319f0c8..50c15508 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeFieldAccess.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeFieldAccess.java @@ -31,7 +31,7 @@ import org.spongepowered.asm.mixin.injection.struct.InjectionPointData; /** *

This injection point searches for GETFIELD and PUTFIELD (and static equivalent) opcodes matching its arguments and returns a list of insns - * immediately prior to matching instructions. It accepts the following parameters from {@link org.spongepowered.asm.mixin.injection.At At}:

+ * immediately prior to matching instructions. It accepts the following parameters from {@link org.spongepowered.asm.mixin.injection.At At}:

* *
*
target
@@ -43,9 +43,10 @@ import org.spongepowered.asm.mixin.injection.struct.InjectionPointData; * specify an ordinal of 2 (ordinals are zero-indexed). The default value is -1 which supresses ordinal matching *
* - *

Example:

+ * 

Example:

+ *
  *   @At(value = "FIELD", target="field_5678_z:I", opcode = Opcodes.GETFIELD)
- *

+ *
* *

Note that like all standard injection points, this class matches the insn itself, putting the injection point immediately before the * access in question. Use the {@link org.spongepowered.asm.mixin.injection.At#shift shift} specifier to adjust the matched opcode as necessary.

diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeInvoke.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeInvoke.java index 10f29512..cffcff41 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeInvoke.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeInvoke.java @@ -38,7 +38,7 @@ import org.spongepowered.asm.mixin.injection.struct.MemberInfo; /** *

This injection point searches for INVOKEVIRTUAL, INVOKESTATIC and INVOKESPECIAL opcodes matching its arguments and returns a list of insns - * immediately prior to matching instructions. It accepts the following parameters from {@link org.spongepowered.asm.mixin.injection.At At}:

+ * immediately prior to matching instructions. It accepts the following parameters from {@link org.spongepowered.asm.mixin.injection.At At}:

* *
*
target
@@ -48,9 +48,10 @@ import org.spongepowered.asm.mixin.injection.struct.MemberInfo; * can specify an ordinal of 2 (ordinals are zero-indexed). The default value is -1 which supresses ordinal matching *
* - *

Example:

+ * 

Example:

+ *
  *   @At(value = "INVOKE", target="func_1234_a(III)V")
- *

+ *
* *

Note that like all standard injection points, this class matches the insn itself, putting the injection point immediately before the * access in question. Use the {@link org.spongepowered.asm.mixin.injection.At#shift shift} specifier to adjust the matched opcode as necessary.

diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeNew.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeNew.java index 797f7181..0ab8d3e2 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeNew.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeNew.java @@ -36,7 +36,7 @@ import org.spongepowered.asm.mixin.injection.struct.InjectionPointData; /** *

This injection point searches for NEW opcodes matching its arguments and returns a list of insns immediately prior to matching instructions. It - * accepts the following parameters from {@link org.spongepowered.asm.mixin.injection.At At}:

+ * accepts the following parameters from {@link org.spongepowered.asm.mixin.injection.At At}:

* *
*
named argument class
@@ -47,9 +47,10 @@ import org.spongepowered.asm.mixin.injection.struct.InjectionPointData; * matching *
* - *

Example:

+ * 

Example:

+ *
  *   @At(value = "NEW", args = { "class=java/lang/String" })
- *

+ *
* *

Note that like all standard injection points, this class matches the insn itself, putting the injection point immediately before the * access in question. Use the {@link org.spongepowered.asm.mixin.injection.At#shift shift} specifier to adjust the matched opcode as necessary.

diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeReturn.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeReturn.java index 204d85b3..cc85bb0c 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeReturn.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeReturn.java @@ -48,13 +48,14 @@ import org.spongepowered.asm.mixin.injection.struct.InjectionPointData; * (ordinals are zero-indexed). The default value is -1 which supresses ordinal matching * * - *

Example:

+ * 

Example:

+ *
  *   @At(value = "RETURN")
*
- * Note that if value is the only parameter specified, it can be omitted: + *

Note that if value is the only parameter specified, it can be omitted:

*
  *   @At("RETURN")
- *

+ *
*/ public class BeforeReturn extends InjectionPoint { diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeStringInvoke.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeStringInvoke.java index 9fc8cbda..76f6c84c 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeStringInvoke.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeStringInvoke.java @@ -55,10 +55,11 @@ import org.spongepowered.asm.mixin.injection.struct.MemberInfo; *
The value of the LDC node to look for prior to the method invocation
* * - *

Example:

+ * 

Example:

+ *
  *   @At(value = "INVOKE_STRING", target="startSection(Ljava/lang/String;)V", args = { "ldc=root" })
*
- * Notice the use of the named argument "ldc" which specifies the value of the target LDC node.

+ *

Notice the use of the named argument "ldc" which specifies the value of the target LDC node.

* *

Note that like all standard injection points, this class matches the insn itself, putting the injection point immediately before the * access in question. Use the {@link org.spongepowered.asm.mixin.injection.At#shift shift} specifier to adjust the matched opcode as necessary.

diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/JumpInsnPoint.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/JumpInsnPoint.java index a6074501..38706de7 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/points/JumpInsnPoint.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/JumpInsnPoint.java @@ -37,7 +37,7 @@ import org.spongepowered.asm.mixin.injection.struct.InjectionPointData; /** *

This injection point searches for JUMP opcodes (if, try/catch, continue, break, conditional assignment, etc.) with either a particular opcode * or at a particular ordinal in the method body (eg. "the Nth JUMP insn" where N is the ordinal of the instruction). By default it returns all JUMP - * instructions in a method body. It accepts the following parameters from {@link org.spongepowered.asm.mixin.injection.At At}:

+ * instructions in a method body. It accepts the following parameters from {@link org.spongepowered.asm.mixin.injection.At At}:

* *
*
opcode
@@ -49,9 +49,10 @@ import org.spongepowered.asm.mixin.injection.struct.InjectionPointData; * can specify an ordinal of 1 (ordinals are zero-indexed). The default value is -1 which supresses ordinal matching *
* - *

Example:

+ * 

Example:

+ *
  *   @At(value = "JUMP", opcode = Opcodes.IFLE, ordinal = 2)
- *

+ *
* *

Note that like all standard injection points, this class matches the insn itself, putting the injection point immediately before the * access in question. Use the {@link org.spongepowered.asm.mixin.injection.At#shift shift} specifier to adjust the matched opcode as necessary.

diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/MethodHead.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/MethodHead.java index 484853d3..501fa910 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/points/MethodHead.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/MethodHead.java @@ -35,9 +35,10 @@ import org.spongepowered.asm.mixin.injection.struct.InjectionPointData; *

This injection point simply returns the first instruction in the target method body, allowing the injection to be placed at the "head" of the * target method. It accepts no parameters and only returns a single insn in all circumstances.

* - *

Example:

+ * 

Example:

+ *
  *   @At("HEAD")
- *

+ *
*/ public class MethodHead extends InjectionPoint { 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 4460996f..3d870be2 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 @@ -36,7 +36,8 @@ import org.spongepowered.asm.mixin.transformer.MixinData; *

Information bundle about a member (method or field) parsed from a String token in another annotation, this is used where target members need to * be specified as Strings in order to parse the String representation to something useful.

* - *

Some examples:

+ * 

Some examples:

+ *
  *   // references a method or field called func_1234_a, if there are multiple members with the same signature, matches the first occurrence
  *   func_1234_a
  *   
@@ -50,7 +51,7 @@ import org.spongepowered.asm.mixin.transformer.MixinData;
  *   field_5678_z:Ljava/lang/String;
  *   
  *   // references a ctor which takes a single String argument 
- *   (Ljava/lang/String;)V
+ *   <init>(Ljava/lang/String;)V
  *   
  *   // references a method called func_1234_a in class foo.bar.Baz
  *   Lfoo/bar/Baz;func_1234_a
@@ -62,8 +63,8 @@ import org.spongepowered.asm.mixin.transformer.MixinData;
  *   Lfoo/bar/Baz;func_1234_a(DDD)V
  *   
  *   // alternate syntax for the same
- *   foo.bar.Baz.func_1234_a(DDD)V
- *

+ * foo.bar.Baz.func_1234_a(DDD)V
+ *
*/ public class MemberInfo { diff --git a/src/main/java/org/spongepowered/asm/util/ASMHelper.java b/src/main/java/org/spongepowered/asm/util/ASMHelper.java index b9f84a91..15159650 100644 --- a/src/main/java/org/spongepowered/asm/util/ASMHelper.java +++ b/src/main/java/org/spongepowered/asm/util/ASMHelper.java @@ -491,7 +491,6 @@ public class ASMHelper { * @param enumClass Class of enum containing the enum constant to search for * @param defaultValue Value to return if the specified key isn't found * @return duck-typed annotation value or defaultValue if missing - * @throws NoSuchFieldException */ public static > T getAnnotationValue(AnnotationNode annotationNode, String key, Class enumClass, T defaultValue) { String[] value = ASMHelper.getAnnotationValue(annotationNode, key);