Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and improvements for retrieving IMixinInfo from ClassInfo #529

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,8 @@ void addAppliedMixin(MixinInfo mixin) {
/**
* Get all mixins which target this class
*/
Set<MixinInfo> getMixins() {
return this.isMixin ? Collections.<MixinInfo>emptySet() : Collections.<MixinInfo>unmodifiableSet(this.mixins);
public Set<IMixinInfo> getMixins() {
return this.isMixin ? Collections.<IMixinInfo>emptySet() : Collections.<IMixinInfo>unmodifiableSet(this.mixins);
}

/**
Expand All @@ -955,6 +955,13 @@ public Set<IMixinInfo> getAppliedMixins() {
public boolean isMixin() {
return this.isMixin;
}

/**
* Get mixin metadata for this class, if it is a mixin
*/
public IMixinInfo getMixinInfo() {
return this.mixin;
}

/**
* Get whether this class is loadable mixin
Expand Down
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