From 45e2670e71a4090d4831da851ee825779fef2947 Mon Sep 17 00:00:00 2001 From: Dan Roque Date: Sun, 29 Mar 2015 17:13:23 -0400 Subject: [PATCH] Check all injector targets before failing. Fixes matchAll with ctors. --- .../asm/mixin/injection/callback/CallbackInjector.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 57ed1527..51ce2454 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 @@ -290,7 +290,10 @@ public class CallbackInjector extends Injector { MethodNode callbackMethod = this.methodNode; if (!callback.getDescriptor().equals(this.methodNode.desc)) { - + if (this.info.getTargets().size() != 0) { + return; // Look for a match in other targets before failing + } + if (callback.canCaptureLocals) { // First check whether there is a compatible method in the class // the method must have an identical name and an appropriate @@ -329,6 +332,7 @@ public class CallbackInjector extends Injector { this.injectCancellationCode(callback); callback.inject(); + this.info.getTargets().clear(); } /**