Improvement: Only check for final method overrides if debug.verify is enabled.

The verifier will catch this anyway, this just gives us a better error which blames the particular mixin, but it's very expensive to check so best avoided in the default case.
This commit is contained in:
LlamaLad7 committed 2025-10-11 22:38:55 +01:00
1 parent b0be3b2550
commit 10af73058a
1 file changed
+1 -1
@@ -544,7 +544,7 @@ public class MixinTargetContext extends ClassContext implements IMixinContext {
}
}
if (Bytecode.isVirtual(method)) {
if (this.getEnvironment().getOption(Option.DEBUG_VERIFY) && Bytecode.isVirtual(method)) {
Method superMethod = this.targetClassInfo.findMethodInHierarchy(method, SearchType.SUPER_CLASSES_ONLY, Traversal.ALL, 0);
if (superMethod != null && superMethod.isFinal()) {
throw new InvalidMixinException(this.mixin, String.format("%s%s in %s overrides a final method from %s",