fixed 'getSliceContents'
do not throw an exception when some slices were overwritten
This commit is contained in:
committed by
Andrey Breslav
parent
217931622e
commit
d4c2a542eb
@@ -18,6 +18,7 @@ package org.jetbrains.jet.lang.resolve;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.annotations.TestOnly;
|
import org.jetbrains.annotations.TestOnly;
|
||||||
@@ -62,9 +63,10 @@ public class DelegatingBindingTrace implements BindingTrace {
|
|||||||
@TestOnly
|
@TestOnly
|
||||||
@Override
|
@Override
|
||||||
public <K, V> ImmutableMap<K, V> getSliceContents(@NotNull ReadOnlySlice<K, V> slice) {
|
public <K, V> ImmutableMap<K, V> getSliceContents(@NotNull ReadOnlySlice<K, V> slice) {
|
||||||
ImmutableMap<K, V> parentContents = parentContext.getSliceContents(slice);
|
Map<K, V> result = Maps.newHashMap();
|
||||||
ImmutableMap<K, V> currentContents = map.getSliceContents(slice);
|
result.putAll(parentContext.getSliceContents(slice));
|
||||||
return ImmutableMap.<K, V>builder().putAll(parentContents).putAll(currentContents).build();
|
result.putAll(map.getSliceContents(slice));
|
||||||
|
return ImmutableMap.copyOf(result);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user