Refactor annotation handling in the AP

This commit is contained in:
Mumfrey committed 2016-11-23 17:53:43 +00:00
1 parent 4934071ee7
commit c007eabc31
18 files changed
+378 -258

No files matched your search

@@ -26,7 +26,6 @@ package org.spongepowered.tools.obfuscation;
import java.lang.reflect.Method;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.ExecutableElement;
import javax.tools.Diagnostic.Kind;
@@ -44,7 +43,7 @@ class AnnotatedMixinElementHandlerOverwrite extends AnnotatedMixinElementHandler
*/
static class AnnotatedElementOverwrite extends AnnotatedElement<ExecutableElement> {
public AnnotatedElementOverwrite(ExecutableElement element, AnnotationMirror annotation) {
public AnnotatedElementOverwrite(ExecutableElement element, AnnotationHandle annotation) {
super(element, annotation);
}
@@ -113,8 +112,8 @@ class AnnotatedMixinElementHandlerOverwrite extends AnnotatedMixinElementHandler
try {
this.addMethodMappings(elem.getSimpleName(), elem.getDesc(), obfData);
} catch (MappingConflictException ex) {
this.ap.printMessage(Kind.ERROR, "Mapping conflict for @Overwrite method: " + ex.getNew().getSimpleName() + " for target " + target
+ " conflicts with existing mapping " + ex.getOld().getSimpleName(), elem.getElement(), elem.getAnnotation());
elem.printMessage(this.ap, Kind.ERROR, "Mapping conflict for @Overwrite method: " + ex.getNew().getSimpleName() + " for target " + target
+ " conflicts with existing mapping " + ex.getOld().getSimpleName());
return false;
}
return true;