gianm commented on a change in pull request #7764: #7316 Use Map.putIfAbsent() 
instead of containsKey() + put()
URL: https://github.com/apache/incubator-druid/pull/7764#discussion_r287612467
 
 

 ##########
 File path: .idea/inspectionProfiles/Druid.xml
 ##########
 @@ -306,6 +303,11 @@
         <constraint name="x" maxCount="2147483647" within="" contains="" />
         <constraint name="ImmutableMap" regexp="Immutable.*" within="" 
contains="" />
       </searchConfiguration>
+      <searchConfiguration name="Use Map.putIfAbsent() instead of 
containsKey() + put()" created="1558868694225" text="if (!$m$.containsKey($k$)) 
{&#10;    $m$.put($k$, $v$);&#10;}" recursive="false" caseInsensitive="true" 
type="JAVA">
 
 Review comment:
   After reviewing the rest of the patch, it seems like computeIfAbsent is 
appropriate more often than putIfAbsent, so the recommendation here should 
reflect that.

----------------------------------------------------------------
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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to