From 071fa6835a32d32482945c61a190c608cd2a0ca0 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 2 Sep 2014 22:28:57 +0200 Subject: lombok.disableConfig would cause NPEs here and there because we returned null instead of an empty list for listy keys. Whoops. Spotted and fixed by github user egde, thanks! --- src/core/lombok/core/LombokConfiguration.java | 5 ++++- src/core/lombok/core/configuration/ConfigurationDataType.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/lombok/core/LombokConfiguration.java b/src/core/lombok/core/LombokConfiguration.java index c53da35f..eb7b3d75 100644 --- a/src/core/lombok/core/LombokConfiguration.java +++ b/src/core/lombok/core/LombokConfiguration.java @@ -21,6 +21,8 @@ */ package lombok.core; +import java.util.Collections; + import lombok.core.configuration.BubblingConfigurationResolver; import lombok.core.configuration.ConfigurationKey; import lombok.core.configuration.ConfigurationProblemReporter; @@ -30,7 +32,8 @@ import lombok.core.configuration.FileSystemSourceCache; public class LombokConfiguration { private static final ConfigurationResolver NULL_RESOLVER = new ConfigurationResolver() { - @Override public T resolve(ConfigurationKey key) { + @SuppressWarnings("unchecked") @Override public T resolve(ConfigurationKey key) { + if (key.getType().isList()) return (T) Collections.emptyList(); return null; } }; diff --git a/src/core/lombok/core/configuration/ConfigurationDataType.java b/src/core/lombok/core/configuration/ConfigurationDataType.java index fa65f575..7512d2e6 100644 --- a/src/core/lombok/core/configuration/ConfigurationDataType.java +++ b/src/core/lombok/core/configuration/ConfigurationDataType.java @@ -186,7 +186,7 @@ public final class ConfigurationDataType { this.parser = parser; } - boolean isList() { + public boolean isList() { return isList; } -- cgit