fix minor bug in BeforeInvoke.find logic

This commit is contained in:
asie committed 2019-09-16 19:07:19 +02:00
1 parent fd2f2c79c5
commit 53cd1b8951
1 file changed
+6 -4
@@ -158,13 +158,15 @@ public class BeforeInvoke extends InjectionPoint {
this.log("{} is searching for an injection point in method with descriptor {}", this.className, desc);
boolean hasDescriptor = this.target instanceof ITargetSelectorByName && ((ITargetSelectorByName)this.target).getDesc() == null;
if (!this.find(desc, insns, nodes, this.target, SearchType.STRICT) && hasDescriptor && this.allowPermissive) {
boolean found = this.find(desc, insns, nodes, this.target, SearchType.STRICT);
if (!found && hasDescriptor && this.allowPermissive) {
this.logger.warn("STRICT match for {} using \"{}\" in {} returned 0 results, attempting permissive search. "
+ "To inhibit permissive search set mixin.env.allowPermissiveMatch=false", this.className, this.target, this.context);
return this.find(desc, insns, nodes, this.target, SearchType.PERMISSIVE);
found = this.find(desc, insns, nodes, this.target, SearchType.PERMISSIVE);
}
return true;
return found;
}
protected boolean find(String desc, InsnList insns, Collection<AbstractInsnNode> nodes, ITargetSelector selector, SearchType searchType) {