Minor, fix code style in CompilerConfiguration
This commit is contained in:
@@ -63,17 +63,12 @@ public class CompilerConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public <K,V> Map<K,V> getMap(@NotNull CompilerConfigurationKey<Map<K,V>> key) {
|
public <K, V> Map<K, V> getMap(@NotNull CompilerConfigurationKey<Map<K, V>> key) {
|
||||||
Map<K,V> data = (Map<K,V>) map.get(key.ideaKey);
|
Map<K, V> data = get(key);
|
||||||
if (data == null) {
|
return data == null ? Collections.<K, V>emptyMap() : data;
|
||||||
return Collections.emptyMap();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return Collections.unmodifiableMap(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> void put(@NotNull CompilerConfigurationKey<T> key, @Nullable T value) {
|
public <T> void put(@NotNull CompilerConfigurationKey<T> key, @NotNull T value) {
|
||||||
checkReadOnly();
|
checkReadOnly();
|
||||||
map.put(key.ideaKey, value);
|
map.put(key.ideaKey, value);
|
||||||
}
|
}
|
||||||
@@ -88,14 +83,14 @@ public class CompilerConfiguration {
|
|||||||
list.add(value);
|
list.add(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <K, V> void put(@NotNull CompilerConfigurationKey<Map<K,V>> key, @NotNull K vkey, @NotNull V value) {
|
public <K, V> void put(@NotNull CompilerConfigurationKey<Map<K, V>> configurationKey, @NotNull K key, @NotNull V value) {
|
||||||
checkReadOnly();
|
checkReadOnly();
|
||||||
Key<Map<K,V>> ideaKey = key.ideaKey;
|
Key<Map<K, V>> ideaKey = configurationKey.ideaKey;
|
||||||
if (map.get(ideaKey) == null) {
|
if (map.get(ideaKey) == null) {
|
||||||
map.put(ideaKey, new HashMap<K,V>());
|
map.put(ideaKey, new HashMap<K, V>());
|
||||||
}
|
}
|
||||||
Map<K,V> data = (Map<K,V>) map.get(ideaKey);
|
Map<K, V> data = (Map<K, V>) map.get(ideaKey);
|
||||||
data.put(vkey, value);
|
data.put(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> void addAll(@NotNull CompilerConfigurationKey<List<T>> key, @NotNull Collection<T> values) {
|
public <T> void addAll(@NotNull CompilerConfigurationKey<List<T>> key, @NotNull Collection<T> values) {
|
||||||
|
|||||||
Reference in New Issue
Block a user