aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2014-05-22 03:30:01 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2014-05-22 03:30:27 +0200
commit0e673c6b3004a67c760bcbbabdc8abbf35c70722 (patch)
treec838bf12b37bbd86bc3511afab742f88ef961eb8 /src/core/lombok/eclipse
parent29c555805246bda4482a040ef85c4332ad40cfea (diff)
downloadlombok-0e673c6b3004a67c760bcbbabdc8abbf35c70722.tar.gz
lombok-0e673c6b3004a67c760bcbbabdc8abbf35c70722.tar.bz2
lombok-0e673c6b3004a67c760bcbbabdc8abbf35c70722.zip
added conf keys (and implementation to make them work) for lombok.getter.lazy.flagUsage and lombok.equalsAndHashCode.doNotUseGetters.
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java4
-rw-r--r--src/core/lombok/eclipse/handlers/HandleGetter.java6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
index f34e70b9..e1b02051 100644
--- a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
+++ b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
@@ -140,7 +140,9 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH
annotation.setWarning("exclude", "exclude and of are mutually exclusive; the 'exclude' parameter will be ignored.");
}
- FieldAccess fieldAccess = ann.doNotUseGetters() ? FieldAccess.PREFER_FIELD : FieldAccess.GETTER;
+ Boolean doNotUseGettersConfiguration = annotationNode.getAst().readConfiguration(ConfigurationKeys.EQUALS_AND_HASH_CODE_DO_NOT_USE_GETTERS);
+ boolean doNotUseGetters = annotation.isExplicit("doNotUseGetters") || doNotUseGettersConfiguration == null ? ann.doNotUseGetters() : doNotUseGettersConfiguration;
+ FieldAccess fieldAccess = doNotUseGetters ? FieldAccess.PREFER_FIELD : FieldAccess.GETTER;
generateMethods(typeNode, annotationNode, excludes, includes, callSuper, true, fieldAccess, onParam);
}
diff --git a/src/core/lombok/eclipse/handlers/HandleGetter.java b/src/core/lombok/eclipse/handlers/HandleGetter.java
index d3d974c9..031fff82 100644
--- a/src/core/lombok/eclipse/handlers/HandleGetter.java
+++ b/src/core/lombok/eclipse/handlers/HandleGetter.java
@@ -139,10 +139,10 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> {
Getter annotationInstance = annotation.getInstance();
AccessLevel level = annotationInstance.value();
boolean lazy = annotationInstance.lazy();
+ if (lazy) handleFlagUsage(annotationNode, ConfigurationKeys.GETTER_LAZY_FLAG_USAGE, "@Getter(lazy=true)");
+
if (level == AccessLevel.NONE) {
- if (lazy) {
- annotationNode.addWarning("'lazy' does not work with AccessLevel.NONE.");
- }
+ if (lazy) annotationNode.addWarning("'lazy' does not work with AccessLevel.NONE.");
return;
}