File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
src/main/java/oracle/kubernetes/operator/work Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 88import java .util .Map ;
99import java .util .Set ;
1010import java .util .concurrent .ConcurrentHashMap ;
11+ import java .util .concurrent .ConcurrentMap ;
1112
1213/**
1314 * Context of a single processing flow. Acts as a map and as a registry of components.
1415 *
1516 */
1617public class Packet extends AbstractMap <String , Object > implements ComponentRegistry , ComponentEx {
17- private final Map <String , Component > components = new ConcurrentHashMap <String , Component >();
18- private final Map <String , Object > delegate = new ConcurrentHashMap <String , Object >();
18+ private final ConcurrentMap <String , Component > components = new ConcurrentHashMap <String , Component >();
19+ private final ConcurrentMap <String , Object > delegate = new ConcurrentHashMap <String , Object >();
1920
2021 public Packet () {}
2122
@@ -33,9 +34,6 @@ public Packet clone() {
3334 }
3435
3536 public <S > S getSPI (Class <S > spiType ) {
36- if (components == null ) {
37- return null ;
38- }
3937 for (Component c : components .values ()) {
4038 S s = c .getSPI (spiType );
4139 if (s != null ) {
@@ -66,6 +64,6 @@ public Set<Entry<String, Object>> entrySet() {
6664
6765 @ Override
6866 public Object put (String key , Object value ) {
69- return delegate .put (key , value );
67+ return value != null ? delegate .put (key , value ) : delegate . remove ( key );
7068 }
7169}
You can’t perform that action at this time.
0 commit comments