Browse Source

Improve annotation processor error messages (#370)

pull/376/head
GunoH 5 years ago committed by GitHub
parent
commit
c10e9bc60c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java

6
pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java

@ -239,11 +239,13 @@ public class ExtensionAnnotationProcessor extends AbstractProcessor {
// pickup the first interface
if (extensionPointElements.isEmpty() && ignoreExtensionPoint) {
if (interfaces.isEmpty()) {
error(extensionElement, "%s is not an extension (it doesn't implement any interface)", extensionElement);
error(extensionElement, "Cannot use %s as extension point with %s compiler arg (it doesn't implement any interface)",
extensionElement, IGNORE_EXTENSION_POINT);
} else if (interfaces.size() == 1) {
extensionPointElements.add(getElement(interfaces.get(0)));
} else {
error(extensionElement, "%s is not an extension (it implements multiple interfaces)", extensionElement);
error(extensionElement, "Cannot use %s as extension point with %s compiler arg (it implements multiple interfaces)",
extensionElement, IGNORE_EXTENSION_POINT);
}
}
}

Loading…
Cancel
Save