diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2021-02-04 22:02:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-04 22:02:58 +0100 |
commit | d958f988a0111fd4621001adef17ef54fab37fec (patch) | |
tree | 5c3ca41a1e65c217dff433244581ca01add4fcf9 /src/core/lombok/eclipse/handlers/HandleSuperBuilder.java | |
parent | ccae25ac8c9b3a134a817eb2164d80a5b50322e8 (diff) | |
parent | 561c43492552a86c9843b16b79cb6984dd3a4a43 (diff) | |
download | lombok-d958f988a0111fd4621001adef17ef54fab37fec.tar.gz lombok-d958f988a0111fd4621001adef17ef54fab37fec.tar.bz2 lombok-d958f988a0111fd4621001adef17ef54fab37fec.zip |
Merge pull request #2733 from Rawi01/checker-superbuilder
Add missing checker annotations in SuperBuilder
Diffstat (limited to 'src/core/lombok/eclipse/handlers/HandleSuperBuilder.java')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleSuperBuilder.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java index 8fdfd315..e08fc334 100644 --- a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java +++ b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java @@ -606,6 +606,9 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler<SuperBuilder> { } constructor.statements = statements.isEmpty() ? null : statements.toArray(new Statement[0]); + if (job.checkerFramework.generateSideEffectFree()) { + constructor.annotations = new Annotation[] {generateNamedAnnotation(job.source, CheckerFrameworkVersion.NAME__SIDE_EFFECT_FREE)}; + } constructor.traverse(new SetGeneratedByVisitor(job.source), typeDeclaration.scope); @@ -635,6 +638,9 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler<SuperBuilder> { AllocationExpression invoke = new AllocationExpression(); invoke.type = namePlusTypeParamsToTypeReference(job.parentType, job.builderImplClassNameArr, false, job.typeParams, p); out.statements = new Statement[] {new ReturnStatement(invoke, pS, pE)}; + if (job.checkerFramework.generateSideEffectFree()) { + out.annotations = new Annotation[] {generateNamedAnnotation(job.source, CheckerFrameworkVersion.NAME__SIDE_EFFECT_FREE)}; + } createRelevantNonNullAnnotation(job.parentType, out); out.traverse(new SetGeneratedByVisitor(job.source), ((TypeDeclaration) job.parentType.get()).scope); @@ -673,6 +679,9 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler<SuperBuilder> { invokeFillMethod.selector = FILL_VALUES_METHOD_NAME; invokeFillMethod.arguments = new Expression[] {new ThisReference(0, 0)}; out.statements = new Statement[] {new ReturnStatement(invokeFillMethod, pS, pE)}; + if (job.checkerFramework.generateSideEffectFree()) { + out.annotations = new Annotation[] {generateNamedAnnotation(job.source, CheckerFrameworkVersion.NAME__SIDE_EFFECT_FREE)}; + } createRelevantNonNullAnnotation(job.parentType, out); out.traverse(new SetGeneratedByVisitor(job.source), ((TypeDeclaration) job.parentType.get()).scope); |