keith-turner commented on a change in pull request #1196: Update Accumulo to 
build and run with Java 11
URL: https://github.com/apache/accumulo/pull/1196#discussion_r292995668
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/clientImpl/TableMap.java
 ##########
 @@ -97,8 +96,8 @@ public TableMap(ClientContext context, ZooCache zooCache) {
         tableIdToNameBuilder.put(tableId, tableNameStr);
       }
     }
-    tableNameToIdMap = tableNameToIdBuilder.build();
-    tableIdToNameMap = tableIdToNameBuilder.build();
+    tableNameToIdMap = Collections.unmodifiableMap(tableNameToIdBuilder);
 
 Review comment:
   People looking at this code after this change may not realize how important 
it is that these refs never escape.  Could add a comment or use an internal 
util method to make an immutable map, each of those would make the intention 
clear.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to