Respect remap on Mixin for At, allow annot to override mixin, fixes #177

This commit is contained in:
Mumfrey committed 2017-05-15 14:16:21 +01:00
1 parent ffc72c7ab6
commit 3329a3d084
3 files changed
+10 -4

No files matched your search

@@ -95,6 +95,10 @@ class AnnotatedMixinElementHandlerInjector extends AnnotatedMixinElementHandler
this.state = state;
}
public boolean shouldRemap() {
return this.at.getBoolean("remap", this.state.shouldRemap());
}
public AnnotationHandle getAt() {
return this.at;
}
@@ -121,6 +125,7 @@ class AnnotatedMixinElementHandlerInjector extends AnnotatedMixinElementHandler
public void notifyRemapped() {
this.state.notifyRemapped();
}
}
AnnotatedMixinElementHandlerInjector(IMixinAnnotationProcessor ap, AnnotatedMixin mixin) {
@@ -211,7 +216,7 @@ class AnnotatedMixinElementHandlerInjector extends AnnotatedMixinElementHandler
this.ap.printMessage(Kind.ERROR, "Injector in interface is unsupported", elem.getElement());
}
if (!elem.getAt().getBoolean("remap", true)) {
if (!elem.shouldRemap()) {
return;
}
@@ -483,7 +483,7 @@ final class AnnotatedMixins implements IMixinAnnotationProcessor, ITokenProvider
}
private boolean shouldRemap(AnnotatedMixin mixinClass, AnnotationHandle annotation) {
return mixinClass.remap() && annotation.getBoolean("remap", true);
return annotation.getBoolean("remap", mixinClass.remap());
}
/**