gianm commented on a change in pull request #6898: Prohibit assigning concurrent maps into Map-typed variables and fields and fix a race condition in CoordinatorRuleManager URL: https://github.com/apache/incubator-druid/pull/6898#discussion_r251257821
########## File path: .idea/inspectionProfiles/Druid.xml ########## @@ -236,6 +236,38 @@ <constraint name="__context__" target="true" within="" contains="" /> <constraint name="E" within="" contains="" /> </searchConfiguration> + <searchConfiguration name="Concurrent maps should be assigned into variables of ConcurrentMap type or more specific" text="Map<$K$, $V$> $x$ = $y$;" recursive="true" caseInsensitive="true" type="JAVA"> + <constraint name="__context__" target="true" within="" contains="" /> + <constraint name="K" within="" contains="" /> + <constraint name="V" within="" contains="" /> + <constraint name="x" within="" contains="" /> + <constraint name="y" nameOfExprType="java\.util\.concurrent\.ConcurrentMap" expressionTypes="java.util.concurrent.ConcurrentMap" exprTypeWithinHierarchy="true" within="" contains="" /> + </searchConfiguration> + <searchConfiguration name="A ConcurrentHashMap on which compute() is called should be assinged into variables of ConcurrentHashMap type, not ConcurrentMap" text="$x$.compute($y$, $z$)" recursive="true" caseInsensitive="true" type="JAVA"> Review comment: Consider including the rationale in this message: it is not obvious that it's because ConcurrentMap does not guarantee atomicity. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org