- Map<String, String> innerMap = Maps.newHashMap();
- namespaceToServices.put(serviceName, innerMap);
+ Map<String, String> innerMap = namespaceToServices.get(serviceName);
+ if (innerMap == null) {
+ innerMap = Maps.newHashMap();
+ namespaceToServices.put(serviceName, innerMap);
+ }