aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/core/lombok/eclipse/handlers/HandleStandardException.java8
-rw-r--r--src/core/lombok/javac/handlers/HandleStandardException.java6
2 files changed, 13 insertions, 1 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleStandardException.java b/src/core/lombok/eclipse/handlers/HandleStandardException.java
index 1a2542f4..def6e495 100755
--- a/src/core/lombok/eclipse/handlers/HandleStandardException.java
+++ b/src/core/lombok/eclipse/handlers/HandleStandardException.java
@@ -48,7 +48,13 @@ public class HandleStandardException extends EclipseAnnotationHandler<StandardEx
EclipseNode typeNode = annotationNode.up();
if (!isClass(typeNode)) {
- annotationNode.addError("@StandardException is only supported on a class.");
+ annotationNode.addError("@StandardException is only supported on a class");
+ return;
+ }
+
+ TypeDeclaration classDef = (TypeDeclaration) typeNode.get();
+ if (classDef.superclass == null) {
+ annotationNode.addError("@StandardException requires that you extend a Throwable type");
return;
}
diff --git a/src/core/lombok/javac/handlers/HandleStandardException.java b/src/core/lombok/javac/handlers/HandleStandardException.java
index 39913a90..ea1a0c5c 100644
--- a/src/core/lombok/javac/handlers/HandleStandardException.java
+++ b/src/core/lombok/javac/handlers/HandleStandardException.java
@@ -59,6 +59,12 @@ public class HandleStandardException extends JavacAnnotationHandler<StandardExce
return;
}
+ JCClassDecl classDef = (JCClassDecl) typeNode.get();
+ if (classDef.extending == null) {
+ annotationNode.addError("@StandardException requires that you extend a Throwable type");
+ return;
+ }
+
AccessLevel access = annotation.getInstance().access();
if (access == null) access = AccessLevel.PUBLIC;
if (access == AccessLevel.NONE) {