diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2021-03-22 08:03:42 +0100 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2021-03-22 08:03:42 +0100 |
commit | bcd05a01b14705678dfd280989fa5071b627a234 (patch) | |
tree | 55f5af9b2b158c37f9d04b7ec27aad048d4e1ffd /src/core/lombok/eclipse/handlers/HandleData.java | |
parent | ade900b82b8205bb439ac9d6d99dff0c3af6e10f (diff) | |
parent | fa0b5249cf5fee28d9be13ecdf0225f651f686aa (diff) | |
download | lombok-bcd05a01b14705678dfd280989fa5071b627a234.tar.gz lombok-bcd05a01b14705678dfd280989fa5071b627a234.tar.bz2 lombok-bcd05a01b14705678dfd280989fa5071b627a234.zip |
Merge branch 'records'
# Conflicts:
# src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
# src/core/lombok/eclipse/handlers/HandleBuilder.java
# src/core/lombok/eclipse/handlers/HandleData.java
# src/core/lombok/eclipse/handlers/HandleNonNull.java
# src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
# src/core/lombok/javac/handlers/HandleBuilder.java
# src/core/lombok/javac/handlers/HandleNonNull.java
# src/core/lombok/javac/handlers/HandleSuperBuilder.java
# test/core/src/lombok/RunTestsViaEcj.java
Diffstat (limited to 'src/core/lombok/eclipse/handlers/HandleData.java')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleData.java | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleData.java b/src/core/lombok/eclipse/handlers/HandleData.java index 67594dab..00e1fd38 100644 --- a/src/core/lombok/eclipse/handlers/HandleData.java +++ b/src/core/lombok/eclipse/handlers/HandleData.java @@ -22,6 +22,7 @@ package lombok.eclipse.handlers; import static lombok.core.handlers.HandlerUtil.*; +import static lombok.eclipse.handlers.EclipseHandlerUtil.*; import java.util.Collections; @@ -35,8 +36,6 @@ import lombok.eclipse.handlers.HandleConstructor.SkipIfConstructorExists; import lombok.spi.Provides; import org.eclipse.jdt.internal.compiler.ast.Annotation; -import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; -import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; /** * Handles the {@code lombok.Data} annotation for eclipse. @@ -55,13 +54,7 @@ public class HandleData extends EclipseAnnotationHandler<Data> { Data ann = annotation.getInstance(); EclipseNode typeNode = annotationNode.up(); - 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) { + if (!isClass(typeNode)) { annotationNode.addError("@Data is only supported on a class."); return; } |