diff --git a/src/main/java/org/spongepowered/asm/mixin/struct/MemberRef.java b/src/main/java/org/spongepowered/asm/mixin/struct/MemberRef.java index 985cec013..58872b125 100644 --- a/src/main/java/org/spongepowered/asm/mixin/struct/MemberRef.java +++ b/src/main/java/org/spongepowered/asm/mixin/struct/MemberRef.java @@ -331,6 +331,15 @@ public void setHandle(int tag, String owner, String name, String desc, boolean i */ public abstract void setDesc(String desc); + /** + * Whether the owner of this member is a mixin. + * @return Whether the owner of this member is a mixin. + */ + public boolean ownerIsMixin() { + String owner = getOwner(); + return !owner.startsWith("[") && ClassInfo.forName(owner).isMixin(); + } + @Override public String toString() { return String.format("%s for %s.%s%s%s", Bytecode.getOpcodeName(this.getOpcode()), this.getOwner(), this.getName(), this.isField() ? ":" : "", diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinTargetContext.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinTargetContext.java index a97fc0b78..3c891756f 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinTargetContext.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinTargetContext.java @@ -600,7 +600,7 @@ private void transformMethodRef(MethodNode method, Iterator it } else if (this.detachedSuper || this.inheritsFromMixin) { if (methodRef.getOpcode() == Opcodes.INVOKESPECIAL) { this.updateStaticBinding(method, methodRef); - } else if (methodRef.getOpcode() == Opcodes.INVOKEVIRTUAL && ClassInfo.forName(methodRef.getOwner()).isMixin()) { + } else if (methodRef.getOpcode() == Opcodes.INVOKEVIRTUAL && methodRef.ownerIsMixin()) { this.updateDynamicBinding(method, methodRef); } } @@ -903,7 +903,7 @@ private void updateBinding(MethodNode method, MemberRef methodRef, Traversal tra + " but is mixin."); } methodRef.setOwner(superMethod.getImplementor().getName()); - } else if (ClassInfo.forName(methodRef.getOwner()).isMixin()) { + } else if (methodRef.ownerIsMixin()) { throw new MixinTransformerError("Error resolving " + methodRef + " in " + this); } }