aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/handlers/HandleGetter.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-08-22 23:26:55 +0200
committerGitHub <noreply@github.com>2019-08-22 23:26:55 +0200
commitdb19a9fd8320a0abf7a530e9e35639089ce77050 (patch)
treebfd83d64061f1606470e91ae24dc4c8693b10015 /src/core/lombok/eclipse/handlers/HandleGetter.java
parent819d1956761f6077fdf897e77c4f6ac47e92104e (diff)
parentba8fd3782819682b3f4081cb410b6d43055989b9 (diff)
downloadlombok-db19a9fd8320a0abf7a530e9e35639089ce77050.tar.gz
lombok-db19a9fd8320a0abf7a530e9e35639089ce77050.tar.bz2
lombok-db19a9fd8320a0abf7a530e9e35639089ce77050.zip
Merge branch 'master' into clone-type
Diffstat (limited to 'src/core/lombok/eclipse/handlers/HandleGetter.java')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleGetter.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleGetter.java b/src/core/lombok/eclipse/handlers/HandleGetter.java
index 7d3fe62f..7ba84cdc 100644
--- a/src/core/lombok/eclipse/handlers/HandleGetter.java
+++ b/src/core/lombok/eclipse/handlers/HandleGetter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2016 The Project Lombok Authors.
+ * Copyright (C) 2009-2019 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -38,6 +38,7 @@ import lombok.experimental.Delegate;
import lombok.Getter;
import lombok.core.AST.Kind;
import lombok.core.AnnotationValues;
+import lombok.core.configuration.CheckerFrameworkVersion;
import lombok.eclipse.EclipseAnnotationHandler;
import lombok.eclipse.EclipseNode;
import lombok.eclipse.agent.PatchDelegate;
@@ -262,16 +263,16 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> {
EclipseHandlerUtil.registerCreatedLazyGetter((FieldDeclaration) fieldNode.get(), method.selector, returnType);
- /* Generate annotations that must be put on the generated method, and attach them. */ {
- Annotation[] deprecated = null;
- if (isFieldDeprecated(fieldNode)) {
- deprecated = new Annotation[] { generateDeprecatedAnnotation(source) };
- }
+ /* Generate annotations that must be put on the generated method, and attach them. */ {
+ Annotation[] deprecated = null, checkerFramework = null;
+ if (isFieldDeprecated(fieldNode)) deprecated = new Annotation[] { generateDeprecatedAnnotation(source) };
+ if (getCheckerFrameworkVersion(fieldNode).generateSideEffectFree()) checkerFramework = new Annotation[] { generateNamedAnnotation(source, CheckerFrameworkVersion.NAME__SIDE_EFFECT_FREE) };
method.annotations = copyAnnotations(source,
onMethod.toArray(new Annotation[0]),
findCopyableAnnotations(fieldNode),
findDelegatesAndMarkAsHandled(fieldNode),
+ checkerFramework,
deprecated);
}