aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2014-01-15 20:56:37 +0100
committerRoel Spilker <r.spilker@gmail.com>2014-01-15 20:56:37 +0100
commit033356b6c6a20b929babd0e6a2ee39f280743684 (patch)
treef5ac3dfc50c0916acd0275654ddb9c6f8fccc7fc /src
parent96e1c9e02e4b58733c2b076dee1c3e1772bb6a41 (diff)
downloadlombok-033356b6c6a20b929babd0e6a2ee39f280743684.tar.gz
lombok-033356b6c6a20b929babd0e6a2ee39f280743684.tar.bz2
lombok-033356b6c6a20b929babd0e6a2ee39f280743684.zip
[configuration] Add option 'stop-bubbling=true' to a lombok.config file to prevent the system from going up the directory tree to find more config files
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/core/configuration/BubblingConfigurationResolver.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/lombok/core/configuration/BubblingConfigurationResolver.java b/src/core/lombok/core/configuration/BubblingConfigurationResolver.java
index 5673d9a8..440d7b68 100644
--- a/src/core/lombok/core/configuration/BubblingConfigurationResolver.java
+++ b/src/core/lombok/core/configuration/BubblingConfigurationResolver.java
@@ -30,14 +30,16 @@ import lombok.core.configuration.ConfigurationSource.Result;
public class BubblingConfigurationResolver implements ConfigurationResolver {
- private final List<ConfigurationSource> sources;
+ private static final ConfigurationKey<Boolean> STOP_BUBBLING = new ConfigurationKey<Boolean>("stop-bubbling") {};
- public BubblingConfigurationResolver(List<ConfigurationSource> sources) {
+ private final Iterable<ConfigurationSource> sources;
+
+ public BubblingConfigurationResolver(Iterable<ConfigurationSource> sources) {
this.sources = sources;
}
- @SuppressWarnings("unchecked")
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public <T> T resolve(ConfigurationKey<T> key) {
boolean isList = key.getType().isList();
List<ListModification> listModifications = null;
@@ -57,6 +59,8 @@ public class BubblingConfigurationResolver implements ConfigurationResolver {
}
return result.getValue();
}
+ Result<Boolean> stop = source.resolve(STOP_BUBBLING);
+ if (stop != null && Boolean.TRUE.equals(stop.getValue())) break;
}
if (!isList) {
return null;