Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
Expand Down Expand Up @@ -38,7 +39,7 @@ final class ContextDataMap implements Map<String, Object> {

private Map<String, Object> getDelegateForRead() {
if (delegate == null) {
return Collections.EMPTY_MAP;
return Collections.emptyMap();
} else {
return delegate;
}
Expand Down Expand Up @@ -81,7 +82,7 @@ public Set<Map.Entry<String, Object>> entrySet() {
if (delegate == null) {
return Collections.singleton(firstEntry);
} else {
HashSet entries = new HashSet(delegate.size() + 1);
Set<Map.Entry<String, Object>> entries = new HashSet<>(delegate.size() + 1);
entries.addAll(delegate.entrySet());
entries.add(firstEntry);
return entries;
Expand All @@ -106,15 +107,15 @@ public Set<String> keySet() {
if (delegate == null) {
return Collections.singleton(ArcInvocationContext.KEY_INTERCEPTOR_BINDINGS);
} else {
HashSet set = new HashSet(delegate.size() + 1);
Set<String> set = new HashSet<>(delegate.size() + 1);
set.addAll(delegate.keySet());
set.add(ArcInvocationContext.KEY_INTERCEPTOR_BINDINGS);
return set;
}
}

@Override
public void putAll(Map m) {
public void putAll(Map<? extends String, ? extends Object> m) {
if (m.containsKey(ArcInvocationContext.KEY_INTERCEPTOR_BINDINGS)) {
throw new IllegalArgumentException(
"Not allowed to put key '" + ArcInvocationContext.KEY_INTERCEPTOR_BINDINGS + "' in the context data map");
Expand All @@ -140,11 +141,11 @@ public int size() {
}

@Override
public Collection values() {
public Collection<Object> values() {
if (delegate == null) {
return Collections.singleton(interceptorBindings);
} else {
ArrayList list = new ArrayList(delegate.size() + 1);
List<Object> list = new ArrayList<>(delegate.size() + 1);
list.addAll(delegate.values());
list.add(interceptorBindings);
return list;
Expand Down