aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
diff options
context:
space:
mode:
authorJohnPaulTaylorII <johnpaultaylorii@gmail.com>2022-03-14 16:03:37 -0400
committerJohnPaulTaylorII <johnpaultaylorii@gmail.com>2022-03-14 16:03:37 -0400
commit0a1afc875423eebc443347eb002ac87ec0016e4d (patch)
tree9000c1d7249b31381d2549e7452d90a1d25414d6 /src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
parent70bda546114ceccc7714bd6060d96edbcd25e3a0 (diff)
downloadlombok-0a1afc875423eebc443347eb002ac87ec0016e4d.tar.gz
lombok-0a1afc875423eebc443347eb002ac87ec0016e4d.tar.bz2
lombok-0a1afc875423eebc443347eb002ac87ec0016e4d.zip
[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.java18
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 c313cf51..cda31e2c 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;
}
}