("lombok.Delegate.flagUsage") {};
+
/**
* Normally the type of the field is used as delegate type. However, to choose a different type to delegate, you can list one (or more) types here. Note that types with
* type arguments can only be done as a field type. A solution for this is to create a private inner interface/class with the appropriate types extended, and possibly
diff --git a/src/core/lombok/EqualsAndHashCode.java b/src/core/lombok/EqualsAndHashCode.java
index 8b809c4b..a4f0ed45 100644
--- a/src/core/lombok/EqualsAndHashCode.java
+++ b/src/core/lombok/EqualsAndHashCode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2012 The Project Lombok Authors.
+ * Copyright (C) 2009-2013 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
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Generates implementations for the {@code equals} and {@code hashCode} methods inherited by all objects, based on relevant fields.
*
@@ -34,6 +37,13 @@ import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface EqualsAndHashCode {
+ /**
+ * lombok configuration: {@code lombok.EqualsAndHashCode.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @EqualsAndHashCode} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.EqualsAndHashCode.flagUsage") {};
+
/**
* Any fields listed here will not be taken into account in the generated
* {@code equals} and {@code hashCode} implementations.
diff --git a/src/core/lombok/Getter.java b/src/core/lombok/Getter.java
index 57f5e40a..a38a0ca5 100644
--- a/src/core/lombok/Getter.java
+++ b/src/core/lombok/Getter.java
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Put on any field to make lombok build a standard getter.
*
@@ -52,6 +55,13 @@ import java.lang.annotation.Target;
@Target({ElementType.FIELD, ElementType.TYPE})
@Retention(RetentionPolicy.SOURCE)
public @interface Getter {
+ /**
+ * lombok configuration: {@code lombok.Getter.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @Getter} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.Getter.flagUsage") {};
+
/**
* If you want your getter to be non-public, you can specify an alternate access level here.
*/
diff --git a/src/core/lombok/NoArgsConstructor.java b/src/core/lombok/NoArgsConstructor.java
index bbf2d9e6..70e78893 100644
--- a/src/core/lombok/NoArgsConstructor.java
+++ b/src/core/lombok/NoArgsConstructor.java
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Generates a no-args constructor.
* Will generate an error message if such a constructor cannot be written due to the existence of final fields.
@@ -42,6 +45,13 @@ import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface NoArgsConstructor {
+ /**
+ * lombok configuration: {@code lombok.NoArgsConstructor.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @NoArgsConstructor} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.NoArgsConstructor.flagUsage") {};
+
/**
* If set, the generated constructor will be private, and an additional static 'constructor'
* is generated with the same argument list that wraps the real constructor.
diff --git a/src/core/lombok/NonNull.java b/src/core/lombok/NonNull.java
index 96813170..42aa8ba4 100644
--- a/src/core/lombok/NonNull.java
+++ b/src/core/lombok/NonNull.java
@@ -27,6 +27,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* If put on a parameter, lombok will insert a null-check at the start of the method / constructor's body, throwing a
* {@code NullPointerException} with the parameter's name as message. If put on a field, any generated method assigning
@@ -44,4 +47,18 @@ import java.lang.annotation.Target;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})
@Retention(RetentionPolicy.CLASS)
@Documented
-public @interface NonNull {}
+public @interface NonNull {
+ /**
+ * lombok configuration: {@code lombok.NonNull.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @NonNull} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.NonNull.flagUsage") {};
+
+ /**
+ * lombok configuration: {@code lombok.NonNull.noNullChecks} = {@code true} | {@code false}.
+ *
+ * If set, the lombok feature of generating a null-checking if statement for all parameters annotated with {@code @NonNull} is disabled.
+ */
+ ConfigurationKey NO_NULL_CHECKS = new ConfigurationKey("lombok.NonNull.noNullChecks") {};
+}
diff --git a/src/core/lombok/RequiredArgsConstructor.java b/src/core/lombok/RequiredArgsConstructor.java
index 31c4b81d..03f4e40e 100644
--- a/src/core/lombok/RequiredArgsConstructor.java
+++ b/src/core/lombok/RequiredArgsConstructor.java
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Generates a constructor with required arguments.
* Required arguments are final fields and fields with constraints such as {@code @NonNull}.
@@ -40,6 +43,13 @@ import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface RequiredArgsConstructor {
+ /**
+ * lombok configuration: {@code lombok.RequiredArgsConstructor.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @RequiredArgsConstructor} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.RequiredArgsConstructor.flagUsage") {};
+
/**
* If set, the generated constructor will be private, and an additional static 'constructor'
* is generated with the same argument list that wraps the real constructor.
diff --git a/src/core/lombok/Setter.java b/src/core/lombok/Setter.java
index 22622520..ca3263a7 100644
--- a/src/core/lombok/Setter.java
+++ b/src/core/lombok/Setter.java
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Put on any field to make lombok build a standard setter.
*
@@ -53,6 +56,13 @@ import java.lang.annotation.Target;
@Target({ElementType.FIELD, ElementType.TYPE})
@Retention(RetentionPolicy.SOURCE)
public @interface Setter {
+ /**
+ * lombok configuration: {@code lombok.Setter.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @Setter} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.Setter.flagUsage") {};
+
/**
* If you want your setter to be non-public, you can specify an alternate access level here.
*/
diff --git a/src/core/lombok/SneakyThrows.java b/src/core/lombok/SneakyThrows.java
index 4bd79065..a4b30d34 100644
--- a/src/core/lombok/SneakyThrows.java
+++ b/src/core/lombok/SneakyThrows.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2012 The Project Lombok Authors.
+ * Copyright (C) 2009-2013 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
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* @SneakyThrow will avoid javac's insistence that you either catch or throw onward any checked exceptions that
* statements in your method body declare they generate.
@@ -59,6 +62,13 @@ import java.lang.annotation.Target;
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.SOURCE)
public @interface SneakyThrows {
+ /**
+ * lombok configuration: {@code lombok.SneakyThrows.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @SneakyThrows} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.SneakyThrows.flagUsage") {};
+
/** The exception type(s) you want to sneakily throw onward. */
Class extends Throwable>[] value() default java.lang.Throwable.class;
diff --git a/src/core/lombok/Synchronized.java b/src/core/lombok/Synchronized.java
index fadea89a..d308a199 100644
--- a/src/core/lombok/Synchronized.java
+++ b/src/core/lombok/Synchronized.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2012 The Project Lombok Authors.
+ * Copyright (C) 2009-2013 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
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Almost exactly like putting the 'synchronized' keyword on a method, except will synchronize on a private internal
* Object, so that other code not under your control doesn't meddle with your thread management by locking on
@@ -40,6 +43,13 @@ import java.lang.annotation.Target;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.SOURCE)
public @interface Synchronized {
+ /**
+ * lombok configuration: {@code lombok.Synchronized.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @Synchronized} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.Synchronized.flagUsage") {};
+
/**
* Optional: specify the name of a different field to lock on. It is a compile time error if this field
* doesn't already exist (the fields are automatically generated only if you don't specify a specific name.
diff --git a/src/core/lombok/ToString.java b/src/core/lombok/ToString.java
index e39b9858..c5dcd1ca 100644
--- a/src/core/lombok/ToString.java
+++ b/src/core/lombok/ToString.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2012 The Project Lombok Authors.
+ * Copyright (C) 2009-2013 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
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Generates an implementation for the {@code toString} method inherited by all objects, consisting of printing the values of relevant fields.
*
@@ -34,6 +37,13 @@ import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface ToString {
+ /**
+ * lombok configuration: {@code lombok.ToString.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @ToString} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.ToString.flagUsage") {};
+
/**
* Include the name of each field when printing it.
* default: true
diff --git a/src/core/lombok/Value.java b/src/core/lombok/Value.java
index 2cffe15b..4f4caeb3 100644
--- a/src/core/lombok/Value.java
+++ b/src/core/lombok/Value.java
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Generates a lot of code which fits with a class that is a representation of an immutable entity.
*
@@ -43,6 +46,13 @@ import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface Value {
+ /**
+ * lombok configuration: {@code lombok.Value.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @Value} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.Value.flagUsage") {};
+
/**
* If you specify a static constructor name, then the generated constructor will be private, and
* instead a static factory method is created that other classes can use to create instances.
diff --git a/src/core/lombok/core/FlagUsageType.java b/src/core/lombok/core/FlagUsageType.java
new file mode 100644
index 00000000..42770ef1
--- /dev/null
+++ b/src/core/lombok/core/FlagUsageType.java
@@ -0,0 +1,6 @@
+package lombok.core;
+
+/** Used for lombok configuration to flag usages of certain lombok feature. */
+public enum FlagUsageType {
+ WARNING, ERROR;
+}
diff --git a/src/core/lombok/core/handlers/HandlerUtil.java b/src/core/lombok/core/handlers/HandlerUtil.java
index 3d386054..eceaba60 100644
--- a/src/core/lombok/core/handlers/HandlerUtil.java
+++ b/src/core/lombok/core/handlers/HandlerUtil.java
@@ -21,8 +21,10 @@
*/
package lombok.core.handlers;
+import lombok.core.FlagUsageType;
import lombok.core.JavaIdentifiers;
import lombok.core.LombokNode;
+import lombok.core.configuration.ConfigurationKey;
public class HandlerUtil {
private HandlerUtil() {}
@@ -45,4 +47,41 @@ public class HandlerUtil {
return true;
}
+
+ public static void handleFlagUsage(LombokNode, ?, ?> node, ConfigurationKey key, String featureName) {
+ FlagUsageType fut = node.getAst().readConfiguration(key);
+
+ if (fut != null) {
+ String msg = "Use of " + featureName + " is flagged according to lombok configuration.";
+ if (fut == FlagUsageType.WARNING) node.addWarning(msg);
+ else node.addError(msg);
+ }
+ }
+
+ public static void handleFlagUsage(LombokNode, ?, ?> node, ConfigurationKey key1, String featureName1, ConfigurationKey key2, String featureName2) {
+ FlagUsageType fut1 = node.getAst().readConfiguration(key1);
+ FlagUsageType fut2 = node.getAst().readConfiguration(key2);
+
+ FlagUsageType fut = null;
+ String featureName = null;
+ if (fut1 == FlagUsageType.ERROR) {
+ fut = fut1;
+ featureName = featureName1;
+ } else if (fut2 == FlagUsageType.ERROR) {
+ fut = fut2;
+ featureName = featureName2;
+ } else if (fut1 == FlagUsageType.WARNING) {
+ fut = fut1;
+ featureName = featureName1;
+ } else {
+ fut = fut2;
+ featureName = featureName2;
+ }
+
+ if (fut != null) {
+ String msg = "Use of " + featureName + " is flagged according to lombok configuration.";
+ if (fut == FlagUsageType.WARNING) node.addWarning(msg);
+ else node.addError(msg);
+ }
+ }
}
diff --git a/src/core/lombok/experimental/Accessors.java b/src/core/lombok/experimental/Accessors.java
index 2748bfa9..a74cbb91 100644
--- a/src/core/lombok/experimental/Accessors.java
+++ b/src/core/lombok/experimental/Accessors.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 The Project Lombok Authors.
+ * Copyright (C) 2012-2013 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
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* A container for settings for the generation of getters and setters.
*
@@ -37,6 +40,13 @@ import java.lang.annotation.Target;
@Target({ElementType.TYPE, ElementType.FIELD})
@Retention(RetentionPolicy.SOURCE)
public @interface Accessors {
+ /**
+ * lombok configuration: {@code lombok.Accessors.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @Accessors} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.Accessors.flagUsage") {};
+
/**
* If true, accessors will be named after the field and not include a get or set
* prefix. If true and chain is omitted, chain defaults to true.
diff --git a/src/core/lombok/experimental/Builder.java b/src/core/lombok/experimental/Builder.java
index 1300e7d3..56675dd1 100644
--- a/src/core/lombok/experimental/Builder.java
+++ b/src/core/lombok/experimental/Builder.java
@@ -27,6 +27,9 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* The builder annotation creates a so-called 'builder' aspect to the class that is annotated or the class
* that contains a member which is annotated with {@code @Builder}.
@@ -107,6 +110,13 @@ import java.lang.annotation.Target;
@Target({TYPE, METHOD, CONSTRUCTOR})
@Retention(SOURCE)
public @interface Builder {
+ /**
+ * lombok configuration: {@code lombok.Builder.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @Builder} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.Builder.flagUsage") {};
+
/** Name of the static method that creates a new builder instance. Default: {@code builder}. */
String builderMethodName() default "builder";
diff --git a/src/core/lombok/experimental/ExtensionMethod.java b/src/core/lombok/experimental/ExtensionMethod.java
index 44f28d04..483ede33 100644
--- a/src/core/lombok/experimental/ExtensionMethod.java
+++ b/src/core/lombok/experimental/ExtensionMethod.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 The Project Lombok Authors.
+ * Copyright (C) 2012-2013 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
@@ -26,6 +26,9 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Extension methods enable you to "add" methods to existing types without creating a new derived type, recompiling, or
* otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as
@@ -60,6 +63,13 @@ import java.lang.annotation.*;
@Target(TYPE)
@Retention(SOURCE)
public @interface ExtensionMethod {
+ /**
+ * lombok configuration: {@code lombok.ExtensionMethod.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @ExtensionMethod} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.ExtensionMethod.flagUsage") {};
+
/** All types whose static methods will be exposed as extension methods. */
Class>[] value();
diff --git a/src/core/lombok/experimental/FieldDefaults.java b/src/core/lombok/experimental/FieldDefaults.java
index 8a3fb534..9a17efbc 100644
--- a/src/core/lombok/experimental/FieldDefaults.java
+++ b/src/core/lombok/experimental/FieldDefaults.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 The Project Lombok Authors.
+ * Copyright (C) 2012-2013 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
@@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import lombok.AccessLevel;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
/**
* Adds modifiers to each field in the type with this annotation.
@@ -41,6 +43,13 @@ import lombok.AccessLevel;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface FieldDefaults {
+ /**
+ * lombok configuration: {@code lombok.FieldDefaults.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @FieldDefaults} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.FieldDefaults.flagUsage") {};
+
AccessLevel level() default AccessLevel.NONE;
boolean makeFinal() default false;
}
diff --git a/src/core/lombok/experimental/Wither.java b/src/core/lombok/experimental/Wither.java
index f667cb1f..259e0c5e 100644
--- a/src/core/lombok/experimental/Wither.java
+++ b/src/core/lombok/experimental/Wither.java
@@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import lombok.AccessLevel;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
/**
* Put on any field to make lombok build a 'wither' - a withX method which produces a clone of this object (except for 1 field which gets a new value).
@@ -54,6 +56,13 @@ import lombok.AccessLevel;
@Target({ElementType.FIELD, ElementType.TYPE})
@Retention(RetentionPolicy.SOURCE)
public @interface Wither {
+ /**
+ * lombok configuration: {@code lombok.Wither.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @Value} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.Wither.flagUsage") {};
+
/**
* If you want your wither to be non-public, you can specify an alternate access level here.
*/
diff --git a/src/core/lombok/extern/apachecommons/CommonsLog.java b/src/core/lombok/extern/apachecommons/CommonsLog.java
index 024e3744..8fa448af 100644
--- a/src/core/lombok/extern/apachecommons/CommonsLog.java
+++ b/src/core/lombok/extern/apachecommons/CommonsLog.java
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Causes lombok to generate a logger field.
*
@@ -59,4 +62,10 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface CommonsLog {
-}
\ No newline at end of file
+ /**
+ * lombok configuration: {@code lombok.log.apacheCommons.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @CommonsLog} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.log.apacheCommons.flagUsage") {};
+}
diff --git a/src/core/lombok/extern/java/Log.java b/src/core/lombok/extern/java/Log.java
index 7ae4e07b..68125dc8 100644
--- a/src/core/lombok/extern/java/Log.java
+++ b/src/core/lombok/extern/java/Log.java
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Causes lombok to generate a logger field.
*
@@ -58,4 +61,10 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface Log {
-}
\ No newline at end of file
+ /**
+ * lombok configuration: {@code lombok.log.javaUtilLogging.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @Log} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.log.javaUtilLogging.flagUsage") {};
+}
diff --git a/src/core/lombok/extern/log4j/Log4j.java b/src/core/lombok/extern/log4j/Log4j.java
index 29e1b27c..0522c485 100644
--- a/src/core/lombok/extern/log4j/Log4j.java
+++ b/src/core/lombok/extern/log4j/Log4j.java
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Causes lombok to generate a logger field.
*
@@ -59,4 +62,10 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface Log4j {
-}
\ No newline at end of file
+ /**
+ * lombok configuration: {@code lombok.log.log4j.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @Log4j} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.log.log4j.flagUsage") {};
+}
diff --git a/src/core/lombok/extern/log4j/Log4j2.java b/src/core/lombok/extern/log4j/Log4j2.java
index 2a0f09e1..dc8b17c4 100644
--- a/src/core/lombok/extern/log4j/Log4j2.java
+++ b/src/core/lombok/extern/log4j/Log4j2.java
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Causes lombok to generate a logger field.
*
@@ -59,4 +62,10 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface Log4j2 {
-}
\ No newline at end of file
+ /**
+ * lombok configuration: {@code lombok.log.log4j2.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @Log4j2} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.log.log4j2.flagUsage") {};
+}
diff --git a/src/core/lombok/extern/slf4j/Slf4j.java b/src/core/lombok/extern/slf4j/Slf4j.java
index 45942971..b79735f3 100644
--- a/src/core/lombok/extern/slf4j/Slf4j.java
+++ b/src/core/lombok/extern/slf4j/Slf4j.java
@@ -25,6 +25,9 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
/**
* Causes lombok to generate a logger field.
*
@@ -56,4 +59,11 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface Slf4j {
+ /**
+ * lombok configuration: {@code lombok.log.slf4j.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @Slf4j} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.log.slf4j.flagUsage") {};
}
+
diff --git a/src/core/lombok/extern/slf4j/XSlf4j.java b/src/core/lombok/extern/slf4j/XSlf4j.java
index 599c68ab..a9e193c1 100644
--- a/src/core/lombok/extern/slf4j/XSlf4j.java
+++ b/src/core/lombok/extern/slf4j/XSlf4j.java
@@ -25,6 +25,9 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
/**
* Causes lombok to generate a logger field.
*
@@ -57,4 +60,10 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface XSlf4j {
+ /**
+ * lombok configuration: {@code lombok.log.xslf4j.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code @XSlf4j} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.log.xslf4j.flagUsage") {};
}
diff --git a/src/core/lombok/val.java b/src/core/lombok/val.java
index 7e495c8d..317da1f3 100644
--- a/src/core/lombok/val.java
+++ b/src/core/lombok/val.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2012 The Project Lombok Authors.
+ * Copyright (C) 2010-2013 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
@@ -21,6 +21,9 @@
*/
package lombok;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* Use {@code val} as the type of any local variable declaration (even in a for-each statement), and the type will be inferred from the initializing expression.
* For example: {@code val x = 10.0;} will infer {@code double}, and {@code val y = new ArrayList();} will infer {@code ArrayList}. The local variable
@@ -30,4 +33,11 @@ package lombok;
*
* Complete documentation is found at the project lombok features page for @val.
*/
-public @interface val {}
+public @interface val {
+ /**
+ * lombok configuration: {@code lombok.val.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, any usage of {@code val} results in a warning / error.
+ */
+ ConfigurationKey FLAG_USAGE = new ConfigurationKey("lombok.val.flagUsage") {};
+}