aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/lombok/ConfigurationKeys.java8
-rw-r--r--src/core/lombok/core/handlers/HandlerUtil.java2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/core/lombok/ConfigurationKeys.java b/src/core/lombok/ConfigurationKeys.java
index 427c5f83..e3308f0a 100644
--- a/src/core/lombok/ConfigurationKeys.java
+++ b/src/core/lombok/ConfigurationKeys.java
@@ -111,6 +111,14 @@ public class ConfigurationKeys {
*/
public static final ConfigurationKey<FlagUsageType> GETTER_LAZY_FLAG_USAGE = new ConfigurationKey<FlagUsageType>("lombok.getter.lazy.flagUsage", "Emit a warning or error if @Getter(lazy=true) is used.") {};
+ /**
+ * lombok configuration: {@code lombok.getter.consequentBoolean} = {@code true} | {@code false}.
+ *
+ * If true, the special Javabeans rules for {@code boolean} accessors get ignored and booleans get processed just like any other type.
+ *
+ */
+ public static final ConfigurationKey<Boolean> GETTER_CONSEQUENT_BOOLEAN = new ConfigurationKey<Boolean>("lombok.getter.consequentBoolean", "Emit a warning or error if @Getter is used.") {};
+
// ----- Setter -----
/**
diff --git a/src/core/lombok/core/handlers/HandlerUtil.java b/src/core/lombok/core/handlers/HandlerUtil.java
index 0d48b624..03bb341c 100644
--- a/src/core/lombok/core/handlers/HandlerUtil.java
+++ b/src/core/lombok/core/handlers/HandlerUtil.java
@@ -283,6 +283,7 @@ public class HandlerUtil {
fieldName = fieldName.toString();
if (fieldName.length() == 0) return null;
+ if (Boolean.TRUE.equals(ast.readConfiguration(ConfigurationKeys.GETTER_CONSEQUENT_BOOLEAN))) isBoolean = false;
boolean explicitPrefix = accessors != null && accessors.isExplicit("prefix");
// System.out.printf("accessors: %s actual expr: %s val: %s\n", accessors, accessors != null ? accessors.getActualExpression("prefix") : "(null)", accessors == null ? "(null)" : Arrays.toString(accessors.getInstance().prefix()));
boolean explicitFluent = accessors != null && accessors.isExplicit("fluent");
@@ -351,6 +352,7 @@ public class HandlerUtil {
private static List<String> toAllAccessorNames(AST<?, ?, ?> ast, AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean,
String booleanPrefix, String normalPrefix, boolean adhereToFluent) {
+ if (Boolean.TRUE.equals(ast.readConfiguration(ConfigurationKeys.GETTER_CONSEQUENT_BOOLEAN))) isBoolean = false;
if (!isBoolean) {
String accessorName = toAccessorName(ast, accessors, fieldName, false, booleanPrefix, normalPrefix, adhereToFluent);
return (accessorName == null) ? Collections.<String>emptyList() : Collections.singletonList(accessorName);