diff --git a/build.gradle b/build.gradle index ba391cc0..141b8076 100644 --- a/build.gradle +++ b/build.gradle @@ -81,12 +81,12 @@ repositories { sourceSets { legacy { ext.languageVersion = 8 - ext.compatibility = '1.6' + ext.compatibility = '1.8' } main { compileClasspath += legacy.output ext.languageVersion = 8 - ext.compatibility = '1.6' + ext.compatibility = '1.8' } ap { compileClasspath += main.output @@ -96,13 +96,13 @@ sourceSets { fernflower { compileClasspath += main.output ext.languageVersion = 8 - ext.compatibility = '1.6' + ext.compatibility = '1.8' ext.modularityExcluded = true } agent { compileClasspath += main.output ext.languageVersion = 8 - ext.compatibility = '1.6' + ext.compatibility = '1.8' } bridge { compileClasspath += main.output @@ -322,7 +322,7 @@ checkstyle { "year" : project.inceptionYear ] configFile = file("checkstyle.xml") - toolVersion = '8.44' + toolVersion = '10.17.0' } // Source compiler configuration diff --git a/checkstyle.xml b/checkstyle.xml index 1109c4ac..48e5470c 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -9,7 +9,7 @@ Description: none --> - + @@ -131,13 +131,6 @@ - - - - - - - diff --git a/src/main/java/org/spongepowered/asm/mixin/FabricUtil.java b/src/main/java/org/spongepowered/asm/mixin/FabricUtil.java index d4ff7530..f68c3ed3 100644 --- a/src/main/java/org/spongepowered/asm/mixin/FabricUtil.java +++ b/src/main/java/org/spongepowered/asm/mixin/FabricUtil.java @@ -33,9 +33,25 @@ public final class FabricUtil { public static final String KEY_COMPATIBILITY = "fabric-compat"; // fabric mixin version compatibility boundaries, (major * 1000 + minor) * 1000 + patch + + /** + * Fabric compatibility version 0.9.2 + */ public static final int COMPATIBILITY_0_9_2 = 9002; // 0.9.2+mixin.0.8.2 incompatible local variable handling + + /** + * Fabric compatibility version 0.10.0 + */ public static final int COMPATIBILITY_0_10_0 = 10000; // 0.10.0+mixin.0.8.4 + + /** + * Fabric compatibility version 0.14.0 + */ public static final int COMPATIBILITY_0_14_0 = 14000; // 0.14.0+mixin.0.8.6 + + /** + * Latest compatibility version + */ public static final int COMPATIBILITY_LATEST = COMPATIBILITY_0_14_0; public static String getModId(IMixinConfig config) { @@ -65,4 +81,7 @@ public final class FabricUtil { return defaultValue; } } + + private FabricUtil() { + } } diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/callback/CallbackInjector.java b/src/main/java/org/spongepowered/asm/mixin/injection/callback/CallbackInjector.java index 0687a66b..9494ee9f 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/callback/CallbackInjector.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/callback/CallbackInjector.java @@ -570,7 +570,9 @@ public class CallbackInjector extends Injector { } } this.invokeCallback(callback, callbackMethod); - if (callback.usesCallbackInfo) this.injectCancellationCode(callback); + if (callback.usesCallbackInfo) { + this.injectCancellationCode(callback); + } callback.inject(); this.info.notifyInjected(callback.target); diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/invoke/util/InvokeUtil.java b/src/main/java/org/spongepowered/asm/mixin/injection/invoke/util/InvokeUtil.java index 8e874ed6..a57279b0 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/invoke/util/InvokeUtil.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/invoke/util/InvokeUtil.java @@ -32,7 +32,7 @@ import org.spongepowered.asm.mixin.injection.struct.InjectionNodes.InjectionNode import java.util.Arrays; -public class InvokeUtil { +public final class InvokeUtil { public static Type[] getOriginalArgs(InjectionNode node) { return Type.getArgumentTypes(((MethodInsnNode) node.getOriginalTarget()).desc); } @@ -47,4 +47,7 @@ public class InvokeUtil { } return currentArgs; } + + private InvokeUtil() { + } } diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/struct/InjectionNodes.java b/src/main/java/org/spongepowered/asm/mixin/injection/struct/InjectionNodes.java index e2175600..86bacb2f 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/struct/InjectionNodes.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/struct/InjectionNodes.java @@ -30,7 +30,6 @@ import java.util.Map; import org.objectweb.asm.tree.AbstractInsnNode; import org.spongepowered.asm.util.Bytecode; -import org.spongepowered.asm.util.CompareUtil; /** * Used to keep track of instruction nodes in a {@link Target} method which are @@ -198,7 +197,7 @@ public class InjectionNodes extends ArrayList { */ @Override public int compareTo(InjectionNode other) { - return other == null ? Integer.MAX_VALUE : CompareUtil.compare(this.hashCode(), other.hashCode()); + return other == null ? Integer.MAX_VALUE : Integer.compare(this.hashCode(), other.hashCode()); } /* (non-Javadoc) diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/ClassInfo.java b/src/main/java/org/spongepowered/asm/mixin/transformer/ClassInfo.java index 538198cd..c718286a 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/ClassInfo.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/ClassInfo.java @@ -232,7 +232,11 @@ public final class ClassInfo { * Frame local size */ public final int size; - public final int rawSize; // Fabric non-adjusted frame size for legacy support + + /** + * Fabric: non-adjusted frame size for legacy support + */ + public final int rawSize; FrameData(int index, int type, int locals, int size) { this.index = index; diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MethodMapper.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MethodMapper.java index 5c83b5be..8cbb9d08 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MethodMapper.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MethodMapper.java @@ -122,11 +122,11 @@ class MethodMapper { String mod = MethodMapper.getMixinSourceId(mixin, ""); String methodName = method.name; if (!mod.isEmpty()) { - //It's common for mods to prefix their own handlers, let's account for that happening - if (methodName.startsWith(mod) && methodName.length() > mod.length() + 1 && Chars.contains(new char[] {'_', '$'}, methodName.charAt(mod.length()))) { - methodName = methodName.substring(mod.length() + 1); - } - mod += '$'; + //It's common for mods to prefix their own handlers, let's account for that happening + if (methodName.startsWith(mod) && methodName.length() > mod.length() + 1 && Chars.contains(new char[] {'_', '$'}, methodName.charAt(mod.length()))) { + methodName = methodName.substring(mod.length() + 1); + } + mod += '$'; } String methodUID = MethodMapper.getMethodUID(methodName, method.desc, !method.isSurrogate()); return String.format("%s$%s%s$%s%s", prefix, classUID, methodUID, mod, methodName); @@ -145,18 +145,18 @@ class MethodMapper { String uniqueIndex = Integer.toHexString(this.nextUniqueMethodIndex++); String methodName = method.name; if (method instanceof MethodNodeEx) { - String mod = MethodMapper.getMixinSourceId(mixin, ""); - if (!mod.isEmpty()) { - //It's rarer for mods to prefix their @Unique methods, but let's account for it anyway - if (methodName.startsWith(mod) && methodName.length() > mod.length() + 1 && Chars.contains(new char[] {'_', '$'}, methodName.charAt(mod.length()))) { - methodName = methodName.substring(mod.length() + 1); - } - if (preservePrefix) { - methodName += '$' + mod; - } else { - methodName = mod + '$' + methodName; - } - } + String mod = MethodMapper.getMixinSourceId(mixin, ""); + if (!mod.isEmpty()) { + //It's rarer for mods to prefix their @Unique methods, but let's account for it anyway + if (methodName.startsWith(mod) && methodName.length() > mod.length() + 1 && Chars.contains(new char[] {'_', '$'}, methodName.charAt(mod.length()))) { + methodName = methodName.substring(mod.length() + 1); + } + if (preservePrefix) { + methodName += '$' + mod; + } else { + methodName = mod + '$' + methodName; + } + } } String pattern = preservePrefix ? "%2$s_$md$%1$s$%3$s" : "md%s$%s$%s"; return String.format(pattern, sessionId.substring(30), methodName, uniqueIndex); diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinApplicatorStandard.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinApplicatorStandard.java index 67989926..2bf01716 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinApplicatorStandard.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinApplicatorStandard.java @@ -781,7 +781,7 @@ class MixinApplicatorStandard { /** * Finds a method in the target class - * @param searchFor + * @param searchFor The method node to search for * * @return Target method matching searchFor, or null if not found */ @@ -797,7 +797,7 @@ class MixinApplicatorStandard { /** * Finds a field in the target class - * @param searchFor + * @param searchFor The field node to search for * * @return Target field matching searchFor, or null if not found */ 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 ee91220b..d3a550f5 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinConfig.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinConfig.java @@ -59,7 +59,6 @@ import org.spongepowered.asm.mixin.transformer.ext.Extensions; import org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException; import org.spongepowered.asm.service.IMixinService; import org.spongepowered.asm.service.MixinService; -import org.spongepowered.asm.util.CompareUtil; import org.spongepowered.asm.util.VersionNumber; import com.google.common.base.Strings; @@ -1374,7 +1373,7 @@ final class MixinConfig implements Comparable, IMixinConfig { return 0; } if (other.priority == this.priority) { - return CompareUtil.compare(this.order, other.order); + return Integer.compare(this.order, other.order); } else { return (this.priority < other.priority) ? -1 : 1; } 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 ce87922d..0a445e8c 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinInfo.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinInfo.java @@ -73,7 +73,6 @@ import org.spongepowered.asm.util.Bytecode; import org.spongepowered.asm.util.LanguageFeatures; import org.spongepowered.asm.util.asm.ASM; import org.spongepowered.asm.util.asm.MethodNodeEx; -import org.spongepowered.asm.util.CompareUtil; import org.spongepowered.asm.util.perf.Profiler; import org.spongepowered.asm.util.perf.Profiler.Section; @@ -1342,7 +1341,7 @@ class MixinInfo implements Comparable, IMixinInfo { return 0; } if (other.priority == this.priority) { - return CompareUtil.compare(this.order, other.order); + return Integer.compare(this.order, other.order); } else { return (this.priority < other.priority) ? -1 : 1; } diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinInheritanceTracker.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinInheritanceTracker.java index e76e2012..e6e26ca6 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinInheritanceTracker.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinInheritanceTracker.java @@ -38,62 +38,70 @@ import org.spongepowered.asm.mixin.transformer.MixinConfig.IListener; import org.spongepowered.asm.util.Bytecode; public enum MixinInheritanceTracker implements IListener { - INSTANCE; + INSTANCE; - @Override - public void onPrepare(MixinInfo mixin) { - } + @Override + public void onPrepare(MixinInfo mixin) { + } - @Override - public void onInit(MixinInfo mixin) { - ClassInfo mixinInfo = mixin.getClassInfo(); - assert mixinInfo.isMixin(); //The mixin should certainly be a mixin + @Override + public void onInit(MixinInfo mixin) { + ClassInfo mixinInfo = mixin.getClassInfo(); + assert mixinInfo.isMixin(); //The mixin should certainly be a mixin - for (ClassInfo superType = mixinInfo.getSuperClass(); superType != null && superType.isMixin(); superType = superType.getSuperClass()) { - List children = parentMixins.get(superType.getName()); + for (ClassInfo superType = mixinInfo.getSuperClass(); superType != null && superType.isMixin(); superType = superType.getSuperClass()) { + List children = parentMixins.get(superType.getName()); - if (children == null) { - parentMixins.put(superType.getName(), children = new ArrayList()); - } + if (children == null) { + parentMixins.put(superType.getName(), children = new ArrayList()); + } - children.add(mixin); - } - } + children.add(mixin); + } + } - public List findOverrides(ClassInfo owner, String name, String desc) { - return findOverrides(owner.getName(), name, desc); - } + public List findOverrides(ClassInfo owner, String name, String desc) { + return findOverrides(owner.getName(), name, desc); + } - public List findOverrides(String owner, String name, String desc) { - List children = parentMixins.get(owner); - if (children == null) return Collections.emptyList(); + public List findOverrides(String owner, String name, String desc) { + List children = parentMixins.get(owner); + if (children == null) { + return Collections.emptyList(); + } - List out = new ArrayList(children.size()); + List out = new ArrayList(children.size()); - for (MixinInfo child : children) { - ClassNode node = child.getClassNode(ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); + for (MixinInfo child : children) { + ClassNode node = child.getClassNode(ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); - MethodNode method = Bytecode.findMethod(node, name, desc); - if (method == null || Bytecode.isStatic(method)) continue; + MethodNode method = Bytecode.findMethod(node, name, desc); + if (method == null || Bytecode.isStatic(method)) { + continue; + } - switch (Bytecode.getVisibility(method)) { - case PRIVATE: - break; + switch (Bytecode.getVisibility(method)) { + case PRIVATE: + break; - case PACKAGE: - int ownerSplit = owner.lastIndexOf('/'); - int childSplit = node.name.lastIndexOf('/'); - //There is a reasonable chance mixins are in the same package, so it is viable that a package private method is overridden - if (ownerSplit != childSplit || (ownerSplit > 0 && !owner.regionMatches(0, node.name, 0, ownerSplit + 1))) break; + case PACKAGE: + int ownerSplit = owner.lastIndexOf('/'); + int childSplit = node.name.lastIndexOf('/'); + //There is a reasonable chance mixins are in the same package, so it is viable that a package private method is overridden + if (ownerSplit != childSplit || (ownerSplit > 0 && !owner.regionMatches(0, node.name, 0, ownerSplit + 1))) { + break; + } - default: - out.add(method); - break; - } - } + out.add(method); + break; + default: + out.add(method); + break; + } + } - return out.isEmpty() ? Collections.emptyList() : out; - } + return out.isEmpty() ? Collections.emptyList() : out; + } - private final Map> parentMixins = new HashMap>(); + private final Map> parentMixins = new HashMap>(); } \ No newline at end of file diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinPreProcessorInterface.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinPreProcessorInterface.java index 55c493d9..a01aa57f 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinPreProcessorInterface.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinPreProcessorInterface.java @@ -140,7 +140,7 @@ class MixinPreProcessorInterface extends MixinPreProcessorStandard { //Making a field non-final will result in verification crashes, so @Mutable is always a mistake if (Annotations.getVisible(field, Mutable.class) != null) { - throw new InvalidInterfaceMixinException(this.mixin, String.format("@Shadow field %s.%s is marked as mutable. This is not allowed.", + throw new InvalidInterfaceMixinException(this.mixin, String.format("@Shadow field %s.%s is marked as mutable. This is not allowed.", this.mixin, field.name)); } diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinPreProcessorStandard.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinPreProcessorStandard.java index 8b5b5313..5be4f8f2 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinPreProcessorStandard.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinPreProcessorStandard.java @@ -649,13 +649,13 @@ class MixinPreProcessorStandard { iter.remove(); continue; } else if (!Bytecode.compareFlags(mixinField, target, Opcodes.ACC_STATIC)) { - if (isShadow) { - throw new InvalidMixinException(this.mixin, String.format("STATIC modifier of @Shadow field %s in %s does not match the target", - mixinField.name, this.mixin)); - } else { - throw new InvalidMixinException(this.mixin, String.format("Field %s in %s conflicts with %sstatic field in the target (%s)", - mixinField.name, mixin, Bytecode.isStatic(target) ? "" : "non-", context.getTarget())); - } + if (isShadow) { + throw new InvalidMixinException(this.mixin, String.format("STATIC modifier of @Shadow field %s in %s does not match the target", + mixinField.name, this.mixin)); + } else { + throw new InvalidMixinException(this.mixin, String.format("Field %s in %s conflicts with %sstatic field in the target (%s)", + mixinField.name, mixin, Bytecode.isStatic(target) ? "" : "non-", context.getTarget())); + } } if (!Bytecode.compareFlags(mixinField, target, Opcodes.ACC_STATIC)) { diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinProcessor.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinProcessor.java index d67cc10b..2cfa27c3 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinProcessor.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinProcessor.java @@ -543,7 +543,7 @@ class MixinProcessor { this.handleMixinPrepareError(config, ex, environment); } catch (Exception ex) { String message = ex.getMessage(); - MixinProcessor.logger.error("Error encountered whilst initialising mixin config '" + config.getName() + "' from mod '"+org.spongepowered.asm.mixin.FabricUtil.getModId(config)+"': " + message, ex); + MixinProcessor.logger.error("Error encountered whilst initialising mixin config '" + config.getName() + "' from mod '" + org.spongepowered.asm.mixin.FabricUtil.getModId(config) + "': " + message, ex); } } @@ -570,7 +570,7 @@ class MixinProcessor { this.handleMixinPrepareError(config, ex, environment); } catch (Exception ex) { String message = ex.getMessage(); - MixinProcessor.logger.error("Error encountered during mixin config postInit step '" + config.getName() + "' from mod '"+org.spongepowered.asm.mixin.FabricUtil.getModId(config)+ "': " + message, ex); + MixinProcessor.logger.error("Error encountered during mixin config postInit step '" + config.getName() + "' from mod '" + org.spongepowered.asm.mixin.FabricUtil.getModId(config) + "': " + message, ex); } } diff --git a/src/main/java/org/spongepowered/asm/service/MixinService.java b/src/main/java/org/spongepowered/asm/service/MixinService.java index d4a752e2..6c54333a 100644 --- a/src/main/java/org/spongepowered/asm/service/MixinService.java +++ b/src/main/java/org/spongepowered/asm/service/MixinService.java @@ -221,7 +221,9 @@ public final class MixinService { if (serviceCls != null) { try { IMixinService service = (IMixinService) Class.forName(serviceCls).getConstructor().newInstance(); - if (!service.isValid()) throw new RuntimeException("invalid service "+serviceCls+" configured via system property"); + if (!service.isValid()) { + throw new RuntimeException("invalid service " + serviceCls + " configured via system property"); + } return service; } catch (ReflectiveOperationException e) { diff --git a/src/main/java/org/spongepowered/asm/util/CompareUtil.java b/src/main/java/org/spongepowered/asm/util/CompareUtil.java deleted file mode 100644 index 7b1be4f9..00000000 --- a/src/main/java/org/spongepowered/asm/util/CompareUtil.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of Mixin, licensed under the MIT License (MIT). - * - * Copyright (c) SpongePowered - * Copyright (c) contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.spongepowered.asm.util; - -/** - * Comparison helpers. - */ -public final class CompareUtil { - private CompareUtil() { - - } - - /** - * Officially added in Java 7. - */ - public static int compare(int a, int b) { - return ((a < b) ? -1 : ((a == b) ? 0 : 1)); - } - - public static int compare(long a, long b) { - return ((a < b) ? -1 : ((a == b) ? 0 : 1)); - } -} diff --git a/src/main/java/org/spongepowered/asm/util/JavaVersion.java b/src/main/java/org/spongepowered/asm/util/JavaVersion.java index c95c9330..9382f27b 100644 --- a/src/main/java/org/spongepowered/asm/util/JavaVersion.java +++ b/src/main/java/org/spongepowered/asm/util/JavaVersion.java @@ -97,25 +97,25 @@ public abstract class JavaVersion { */ public static final double JAVA_18 = 18.0; - /** - * Version number for Java 19 - */ - public static final double JAVA_19 = 19.0; + /** + * Version number for Java 19 + */ + public static final double JAVA_19 = 19.0; - /** - * Version number for Java 20 - */ - public static final double JAVA_20 = 20.0; + /** + * Version number for Java 20 + */ + public static final double JAVA_20 = 20.0; - /** - * Version number for Java 21 - */ - public static final double JAVA_21 = 21.0; + /** + * Version number for Java 21 + */ + public static final double JAVA_21 = 21.0; - /** - * Version number for Java 22 - */ - public static final double JAVA_22 = 22.0; + /** + * Version number for Java 22 + */ + public static final double JAVA_22 = 22.0; private static double current = 0.0; diff --git a/src/main/java/org/spongepowered/asm/util/Locals.java b/src/main/java/org/spongepowered/asm/util/Locals.java index 4f62ce35..0fcc960c 100644 --- a/src/main/java/org/spongepowered/asm/util/Locals.java +++ b/src/main/java/org/spongepowered/asm/util/Locals.java @@ -328,6 +328,7 @@ public final class Locals { * bear in mind that if the specified node is itself a STORE opcode, * then we will be looking at the state of the locals PRIOR to its * invocation + * @param fabricCompatibility Fabric compatibility level * @return A sparse array containing a view (hopefully) of the locals at the * specified location */ @@ -335,7 +336,7 @@ public final class Locals { if (fabricCompatibility >= org.spongepowered.asm.mixin.FabricUtil.COMPATIBILITY_0_10_0) { return Locals.getLocalsAt(classNode, method, node, Settings.DEFAULT); } else { - return getLocalsAt_0_9_2(classNode, method, node); + return getLocalsAt092(classNode, method, node); } } @@ -580,7 +581,7 @@ public final class Locals { return frame; } - private static LocalVariableNode[] getLocalsAt_0_9_2(ClassNode classNode, MethodNode method, AbstractInsnNode node) { + private static LocalVariableNode[] getLocalsAt092(ClassNode classNode, MethodNode method, AbstractInsnNode node) { for (int i = 0; i < 3 && (node instanceof LabelNode || node instanceof LineNumberNode); i++) { node = Locals.nextNode(method.instructions, node); } diff --git a/src/main/java/org/spongepowered/asm/util/VersionNumber.java b/src/main/java/org/spongepowered/asm/util/VersionNumber.java index d764dd36..ff9e8b06 100644 --- a/src/main/java/org/spongepowered/asm/util/VersionNumber.java +++ b/src/main/java/org/spongepowered/asm/util/VersionNumber.java @@ -141,7 +141,7 @@ public final class VersionNumber implements Comparable, Serializa if (other == null) { return 1; } - return CompareUtil.compare(this.value, other.value); + return Long.compare(this.value, other.value); } /* (non-Javadoc)