From 033356b6c6a20b929babd0e6a2ee39f280743684 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Wed, 15 Jan 2014 20:56:37 +0100 Subject: [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 --- .../core/configuration/BubblingConfigurationResolver.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') 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 sources; + private static final ConfigurationKey STOP_BUBBLING = new ConfigurationKey("stop-bubbling") {}; - public BubblingConfigurationResolver(List sources) { + private final Iterable sources; + + public BubblingConfigurationResolver(Iterable sources) { this.sources = sources; } - @SuppressWarnings("unchecked") - @Override + @SuppressWarnings("unchecked") + @Override public T resolve(ConfigurationKey key) { boolean isList = key.getType().isList(); List listModifications = null; @@ -57,6 +59,8 @@ public class BubblingConfigurationResolver implements ConfigurationResolver { } return result.getValue(); } + Result stop = source.resolve(STOP_BUBBLING); + if (stop != null && Boolean.TRUE.equals(stop.getValue())) break; } if (!isList) { return null; -- cgit