aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2014-09-02 22:28:57 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2014-09-02 22:28:57 +0200
commit071fa6835a32d32482945c61a190c608cd2a0ca0 (patch)
tree5380692e0bad59745f1d67b57c776e9c9c436bc8 /src
parent093ea84086e45f677226ff17f31d8f2b49860e42 (diff)
downloadlombok-071fa6835a32d32482945c61a190c608cd2a0ca0.tar.gz
lombok-071fa6835a32d32482945c61a190c608cd2a0ca0.tar.bz2
lombok-071fa6835a32d32482945c61a190c608cd2a0ca0.zip
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!
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/core/LombokConfiguration.java5
-rw-r--r--src/core/lombok/core/configuration/ConfigurationDataType.java2
2 files changed, 5 insertions, 2 deletions
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> T resolve(ConfigurationKey<T> key) {
+ @SuppressWarnings("unchecked") @Override public <T> T resolve(ConfigurationKey<T> 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;
}