accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ctubbsii commented on a change in pull request #1009: Use appropriate types to prevent casting
Date Sun, 03 Mar 2019 05:53:52 GMT
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

Mime
View raw message