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!

This commit is contained in:
Reinier Zwitserloot committed 2014-09-02 22:28:57 +02:00
1 parent 093ea84086
commit 071fa6835a
2 files changed
+5 -2

No files matched your search

@@ -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;
}
};
@@ -186,7 +186,7 @@ public final class ConfigurationDataType {
this.parser = parser;
}
boolean isList() {
public boolean isList() {
return isList;
}