add DefaultAllowedDataCycleBlocks to prevent NPE

Dieser Commit ist enthalten in:
Aurora 2020-09-26 14:55:46 +02:00
Ursprung 4511884bca
Commit 6bea77933f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 89839F67B53656AD
2 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -56,6 +56,7 @@ public abstract class LocalConfiguration {
public boolean profile = false;
public boolean traceUnflushedSessions = false;
public Set<String> disallowedBlocks = new HashSet<>();
public Set<String> defaultAllowedDataCycleBlocks = new HashSet<>();
protected BlockMask disallowedBlocksMask;
public int defaultChangeLimit = -1;
public int maxChangeLimit = -1;
@ -168,6 +169,10 @@ public abstract class LocalConfiguration {
return blockTypes.stream().filter(Objects::nonNull).map(BlockType::getId).toArray(String[]::new);
}
protected String[] getDefaultAllowedDataCycleBlocks() {
return new String[0];
}
/**
* Load the configuration.
*/

Datei anzeigen

@ -91,7 +91,7 @@ public class PropertiesConfiguration extends LocalConfiguration {
disallowedBlocks = getStringSet("disallowed-blocks", getDefaultDisallowedBlocks());
disallowedBlocksMask = null;
allowedDataCycleBlocks =
new HashSet<>(getStringSet("limits.allowed-data-cycle-blocks", null));
new HashSet<>(getStringSet("limits.allowed-data-cycle-blocks", getDefaultAllowedDataCycleBlocks()));
defaultChangeLimit = getInt("default-max-changed-blocks", defaultChangeLimit);
maxChangeLimit = getInt("max-changed-blocks", maxChangeLimit);
defaultVerticalHeight = getInt("default-vertical-height", defaultVerticalHeight);