I have a Map<String,Object>
to be converted to a ConcurrentMap<String,Object>
Map<String,Object> testMap = new HashMap<String,Object>();
testMap.put("test", null); //This null causing issues in conversion
testMap.put("test2","123");
testMap.put("test3",234);
ConcurrentMap<String,Object> concMap = new ConcurrentHashMap<>(testMap);
I get a null pointer exception. If I copy to a new HashMap<String,Object>
Map<String,Object> testMap = new HashMap<String,Object>();
testMap.put("test", null);
testMap.put("test2","123");
testMap.put("test3",234);
Map<String,Object> concMap = new HashMap<>(testMap);
I don't get any errors. Is there a safe way to a Map<String,Object>
to a ConcurrentMap<String,Object>
without the NullPointerException