From 0064c534273d9fb877f7e570f7a430060c88a5fb Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Thu, 10 Sep 2020 10:20:12 +0200 Subject: Add record support --- src/core/lombok/eclipse/handlers/HandleUtilityClass.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/core/lombok/eclipse/handlers/HandleUtilityClass.java') diff --git a/src/core/lombok/eclipse/handlers/HandleUtilityClass.java b/src/core/lombok/eclipse/handlers/HandleUtilityClass.java index 2349f839..338aab0d 100644 --- a/src/core/lombok/eclipse/handlers/HandleUtilityClass.java +++ b/src/core/lombok/eclipse/handlers/HandleUtilityClass.java @@ -70,13 +70,8 @@ public class HandleUtilityClass extends EclipseAnnotationHandler { } private static boolean checkLegality(EclipseNode typeNode, EclipseNode errorNode) { - TypeDeclaration typeDecl = null; - if (typeNode.get() instanceof TypeDeclaration) typeDecl = (TypeDeclaration) typeNode.get(); - int modifiers = typeDecl == null ? 0 : typeDecl.modifiers; - boolean notAClass = (modifiers & (ClassFileConstants.AccInterface | ClassFileConstants.AccAnnotation | ClassFileConstants.AccEnum)) != 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 (can't be an interface, enum, annotation, or record)."); return false; } -- cgit