aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorJan Rieke <rieke@subshell.com>2018-06-01 10:50:26 +0200
committerJan Rieke <rieke@subshell.com>2018-06-01 10:50:26 +0200
commit51c0c40ac422ddd2828bb0ec79e252e85f1511c9 (patch)
treefbb8780fb966e0e75fc36050b13cad18bae71ce7 /src/core
parent32bed51fede1eebef2006d54b3e364de22ae9ac0 (diff)
downloadlombok-51c0c40ac422ddd2828bb0ec79e252e85f1511c9.tar.gz
lombok-51c0c40ac422ddd2828bb0ec79e252e85f1511c9.tar.bz2
lombok-51c0c40ac422ddd2828bb0ec79e252e85f1511c9.zip
handle experimental flag usage
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lombok/ConfigurationKeys.java9
-rw-r--r--src/core/lombok/eclipse/handlers/HandleSuperBuilder.java2
-rw-r--r--src/core/lombok/javac/handlers/HandleSuperBuilder.java2
3 files changed, 13 insertions, 0 deletions
diff --git a/src/core/lombok/ConfigurationKeys.java b/src/core/lombok/ConfigurationKeys.java
index 29c43d3f..ade86e27 100644
--- a/src/core/lombok/ConfigurationKeys.java
+++ b/src/core/lombok/ConfigurationKeys.java
@@ -508,6 +508,15 @@ public class ConfigurationKeys {
*/
public static final ConfigurationKey<FlagUsageType> WITHER_FLAG_USAGE = new ConfigurationKey<FlagUsageType>("lombok.wither.flagUsage", "Emit a warning or error if @Wither is used.") {};
+ // ----- SuperBuilder -----
+
+ /**
+ * lombok configuration: {@code lombok.superBuilder.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, <em>any</em> usage of {@code @SuperBuilder} results in a warning / error.
+ */
+ public static final ConfigurationKey<FlagUsageType> SUPERBUILDER_FLAG_USAGE = new ConfigurationKey<FlagUsageType>("lombok.superBuilder.flagUsage", "Emit a warning or error if @SuperBuilder is used.") {};
+
// ----- Configuration System -----
/**
diff --git a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
index 04c3b2fe..1b17e3df 100644
--- a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
+++ b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
@@ -115,6 +115,8 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler<SuperBuilder> {
@Override
public void handle(AnnotationValues<SuperBuilder> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleExperimentalFlagUsage(annotationNode, ConfigurationKeys.SUPERBUILDER_FLAG_USAGE, "@SuperBuilder");
+
long p = (long) ast.sourceStart << 32 | ast.sourceEnd;
SuperBuilder builderInstance = annotation.getInstance();
diff --git a/src/core/lombok/javac/handlers/HandleSuperBuilder.java b/src/core/lombok/javac/handlers/HandleSuperBuilder.java
index 1055a11a..c48e4761 100644
--- a/src/core/lombok/javac/handlers/HandleSuperBuilder.java
+++ b/src/core/lombok/javac/handlers/HandleSuperBuilder.java
@@ -94,6 +94,8 @@ public class HandleSuperBuilder extends JavacAnnotationHandler<SuperBuilder> {
@Override
public void handle(AnnotationValues<SuperBuilder> annotation, JCAnnotation ast, JavacNode annotationNode) {
+ handleExperimentalFlagUsage(annotationNode, ConfigurationKeys.SUPERBUILDER_FLAG_USAGE, "@SuperBuilder");
+
SuperBuilder superbuilderAnnotation = annotation.getInstance();
deleteAnnotationIfNeccessary(annotationNode, SuperBuilder.class);