diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2022-03-13 12:44:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-13 12:44:22 +0100 |
commit | 77e54d274597e54c0cbd32cebadddd7d00cb5b10 (patch) | |
tree | ad43f43244383adc1f19ce1c7b528fd6e15535d8 /src/core | |
parent | 8c3ff7e9b08c4bf9c2b23cffb6042c31258e3ebb (diff) | |
parent | b50a9c2ddf2c49fd99fd1b76bf5df05bff751d4c (diff) | |
download | lombok-77e54d274597e54c0cbd32cebadddd7d00cb5b10.tar.gz lombok-77e54d274597e54c0cbd32cebadddd7d00cb5b10.tar.bz2 lombok-77e54d274597e54c0cbd32cebadddd7d00cb5b10.zip |
Merge pull request #3135 from Rawi01/eclipse-type-annotations
Add annotation bits to annotation copy targets
Diffstat (limited to 'src/core')
-rwxr-xr-x | src/core/lombok/eclipse/handlers/HandleConstructor.java | 9 | ||||
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleSetter.java | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleConstructor.java b/src/core/lombok/eclipse/handlers/HandleConstructor.java index e69c3267..52213846 100755 --- a/src/core/lombok/eclipse/handlers/HandleConstructor.java +++ b/src/core/lombok/eclipse/handlers/HandleConstructor.java @@ -41,6 +41,7 @@ import lombok.RequiredArgsConstructor; import lombok.core.AST.Kind; import lombok.core.configuration.CheckerFrameworkVersion; import lombok.core.AnnotationValues; +import lombok.eclipse.Eclipse; import lombok.eclipse.EclipseAnnotationHandler; import lombok.eclipse.EclipseNode; import lombok.eclipse.handlers.EclipseHandlerUtil.MemberExistsResult; @@ -414,6 +415,10 @@ public class HandleConstructor { if (nullCheck != null) nullChecks.add(nullCheck); } parameter.annotations = copyAnnotations(source, copyableAnnotations); + if (parameter.annotations != null) { + parameter.bits |= Eclipse.HasTypeAnnotations; + constructor.bits |= Eclipse.HasTypeAnnotations; + } params.add(parameter); } @@ -555,6 +560,10 @@ public class HandleConstructor { Argument parameter = new Argument(field.name, fieldPos, copyType(field.type, source), Modifier.FINAL); parameter.annotations = copyAnnotations(source, findCopyableAnnotations(fieldNode)); + if (parameter.annotations != null) { + parameter.bits |= Eclipse.HasTypeAnnotations; + constructor.bits |= Eclipse.HasTypeAnnotations; + } params.add(parameter); } diff --git a/src/core/lombok/eclipse/handlers/HandleSetter.java b/src/core/lombok/eclipse/handlers/HandleSetter.java index fda1651d..f09f1485 100644 --- a/src/core/lombok/eclipse/handlers/HandleSetter.java +++ b/src/core/lombok/eclipse/handlers/HandleSetter.java @@ -35,6 +35,7 @@ import lombok.ConfigurationKeys; import lombok.Setter; import lombok.core.AST.Kind; import lombok.core.AnnotationValues; +import lombok.eclipse.Eclipse; import lombok.eclipse.EclipseAnnotationHandler; import lombok.eclipse.EclipseNode; import lombok.experimental.Accessors; @@ -256,6 +257,10 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> { } method.statements = statements.toArray(new Statement[0]); param.annotations = copyAnnotations(source, copyableAnnotations, onParam.toArray(new Annotation[0])); + if (param.annotations != null) { + param.bits |= Eclipse.HasTypeAnnotations; + method.bits |= Eclipse.HasTypeAnnotations; + } if (returnType != null && returnStatement != null) createRelevantNonNullAnnotation(sourceNode, method); |