aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/HandleUtilityClass.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleUtilityClass.java')
-rw-r--r--src/core/lombok/javac/handlers/HandleUtilityClass.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/core/lombok/javac/handlers/HandleUtilityClass.java b/src/core/lombok/javac/handlers/HandleUtilityClass.java
index cb8a72ad..e006cc47 100644
--- a/src/core/lombok/javac/handlers/HandleUtilityClass.java
+++ b/src/core/lombok/javac/handlers/HandleUtilityClass.java
@@ -67,13 +67,8 @@ public class HandleUtilityClass extends JavacAnnotationHandler<UtilityClass> {
}
private static boolean checkLegality(JavacNode typeNode, JavacNode errorNode) {
- JCClassDecl typeDecl = null;
- if (typeNode.get() instanceof JCClassDecl) typeDecl = (JCClassDecl) typeNode.get();
- long modifiers = typeDecl == null ? 0 : typeDecl.mods.flags;
- boolean notAClass = (modifiers & (Flags.INTERFACE | Flags.ANNOTATION | Flags.ENUM)) != 0;
-
- if (typeDecl == null || notAClass) {
- errorNode.addError("@UtilityClass is only supported on a class (can't be an interface, enum, or annotation).");
+ if (!isClass(typeNode)) {
+ errorNode.addError("@UtilityClass is only supported on a class.");
return false;
}