Skip to content

Commit

Permalink
Add applied MixinInfo to target class rather than mixin class
Browse files Browse the repository at this point in the history
In MixinInfo#postApply, the MixinInfo reference was being added to the
ClassInfo of the mixin itself, rather than the classes the mixin is
applied to. This meant that Mixins.getMixinsForClass would only return
MixinInfo on mixin classes themselves, not their target classes, and
ClassInfo#getAppliedMixins() was empty for target classes.
This change fixes the behaviour to resolve the ClassInfo of the target
class and add the MixinInfo to that.
  • Loading branch information
comp500 committed Oct 8, 2021
1 parent 2accda5 commit f5aaca5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ public void postApply(String transformedName, ClassNode targetClass) throws Exce
}

this.parent.postApply(transformedName, targetClass);
this.info.addAppliedMixin(this);
ClassInfo.fromClassNode(targetClass).addAppliedMixin(this);
}

/* (non-Javadoc)
Expand Down

0 comments on commit f5aaca5

Please sign in to comment.