diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2022-03-17 22:13:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-17 22:13:40 +0100 |
commit | 4673bc36f02f53671a7b7df79baa770fffcbc99e (patch) | |
tree | 0ac54bfe40442f90c8e41c983fe8a03d3be60595 /src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | |
parent | 582980a9f0383d9e884f3b520e7b34632c70a8a9 (diff) | |
parent | 0a1afc875423eebc443347eb002ac87ec0016e4d (diff) | |
download | lombok-4673bc36f02f53671a7b7df79baa770fffcbc99e.tar.gz lombok-4673bc36f02f53671a7b7df79baa770fffcbc99e.tar.bz2 lombok-4673bc36f02f53671a7b7df79baa770fffcbc99e.zip |
Merge pull request #3137 from JohnPaulTaylorII/master
[fixes #3133] Additional bits setting when creating type annotations
Diffstat (limited to 'src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java')
-rw-r--r-- | src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index 93b0028d..072b6df2 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -2601,25 +2601,25 @@ public class EclipseHandlerUtil { applyAnnotationToMethodDecl(typeNode, mth, lib.getNonNullAnnotation(), lib.isTypeUse()); } - public static void createRelevantNullableAnnotation(EclipseNode typeNode, Argument arg) { + public static void createRelevantNullableAnnotation(EclipseNode typeNode, Argument arg, MethodDeclaration mth) { NullAnnotationLibrary lib = typeNode.getAst().readConfiguration(ConfigurationKeys.ADD_NULL_ANNOTATIONS); if (lib == null) return; - applyAnnotationToVarDecl(typeNode, arg, lib.getNullableAnnotation(), lib.isTypeUse()); + applyAnnotationToVarDecl(typeNode, arg, mth, lib.getNullableAnnotation(), lib.isTypeUse()); } - public static void createRelevantNullableAnnotation(EclipseNode typeNode, Argument arg, List<NullAnnotationLibrary> applied) { + public static void createRelevantNullableAnnotation(EclipseNode typeNode, Argument arg, MethodDeclaration mth, List<NullAnnotationLibrary> applied) { NullAnnotationLibrary lib = typeNode.getAst().readConfiguration(ConfigurationKeys.ADD_NULL_ANNOTATIONS); if (lib == null || applied.contains(lib)) return; - applyAnnotationToVarDecl(typeNode, arg, lib.getNullableAnnotation(), lib.isTypeUse()); + applyAnnotationToVarDecl(typeNode, arg, mth, lib.getNullableAnnotation(), lib.isTypeUse()); } - public static void createRelevantNonNullAnnotation(EclipseNode typeNode, Argument arg) { + public static void createRelevantNonNullAnnotation(EclipseNode typeNode, Argument arg, MethodDeclaration mth) { NullAnnotationLibrary lib = typeNode.getAst().readConfiguration(ConfigurationKeys.ADD_NULL_ANNOTATIONS); if (lib == null) return; - applyAnnotationToVarDecl(typeNode, arg, lib.getNonNullAnnotation(), lib.isTypeUse()); + applyAnnotationToVarDecl(typeNode, arg, mth, lib.getNonNullAnnotation(), lib.isTypeUse()); } private static void applyAnnotationToMethodDecl(EclipseNode typeNode, MethodDeclaration mth, String annType, boolean typeUse) { @@ -2653,9 +2653,10 @@ public class EclipseHandlerUtil { } a[0] = ann; mth.returnType.annotations[len - 1] = a; + mth.bits |= Eclipse.HasTypeAnnotations; } } - private static void applyAnnotationToVarDecl(EclipseNode typeNode, Argument arg, String annType, boolean typeUse) { + private static void applyAnnotationToVarDecl(EclipseNode typeNode, Argument arg, MethodDeclaration mth, String annType, boolean typeUse) { if (annType == null) return; int partCount = 1; @@ -2686,6 +2687,9 @@ public class EclipseHandlerUtil { } a[0] = ann; arg.type.annotations[len - 1] = a; + arg.type.bits |= Eclipse.HasTypeAnnotations; + arg.bits |= Eclipse.HasTypeAnnotations; + mth.bits |= Eclipse.HasTypeAnnotations; } } |