Hongchao Deng created ZOOKEEPER-1978:
----------------------------------------

             Summary: Fix AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION
                 Key: ZOOKEEPER-1978
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1978
             Project: ZooKeeper
          Issue Type: Sub-task
            Reporter: Hongchao Deng
            Assignee: Hongchao Deng
            Priority: Minor


findbugs is complaining
{code}
 if (sessionsById.get(id) == null) {
             SessionImpl s = new SessionImpl(id, sessionTimeout);
             sessionsById.put(id, s);
}
{code}
is not atomic for the gap between get() and put().

I suggest using putIfAbsent() instead.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to