Skip to content

Commit

Permalink
Expose info of mixins targeting a class and info from a mixin class
Browse files Browse the repository at this point in the history
Allow external code to query the list of mixins that target a class,
including mixins that were not applied, by exposing getMixins; this
method wasn't used internally but exposing it allows external error
handlers greater visibility of mixins targeting a class.

ClassInfo.mixin is also exposed with getMixinInfo to allow external
code to retrieve mixin metadata from a class. This supersedes the need
for some other methods like isMixin and isLoadable, but these are kept
for compatibility.
  • Loading branch information
comp500 committed Aug 14, 2023
1 parent f304b20 commit 1240888
Showing 1 changed file with 9 additions and 2 deletions.
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

0 comments on commit 1240888

Please sign in to comment.