You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/03/03 05:53:52 UTC

[GitHub] ctubbsii commented on a change in pull request #1009: Use appropriate types to prevent casting

ctubbsii commented on a change in pull request #1009: Use appropriate types to prevent casting
URL: https://github.com/apache/accumulo/pull/1009#discussion_r261852500
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/clientImpl/ConditionalWriterImpl.java
 ##########
 @@ -372,11 +372,8 @@ private void reschedule(SendTask task) {
 
       for (int i = 1; i < mutations.size(); i++) {
         for (Entry<KeyExtent,List<QCMutation>> entry : mutations.get(i).getMutations().entrySet()) {
-          List<QCMutation> list = tsm.getMutations().get(entry.getKey());
-          if (list == null) {
-            list = new ArrayList<>();
-            tsm.getMutations().put(entry.getKey(), list);
-          }
+          List<QCMutation> list = tsm.getMutations().computeIfAbsent(entry.getKey(),
 
 Review comment:
   At this point, you don't even need to assign it to a variable... can just call `addAll` directly on the result.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services