Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 3.5.0
    • Component/s: None
    • Labels:
      None

      Description

      findbugs is complaining

       if (sessionsById.get(id) == null) {
                   SessionImpl s = new SessionImpl(id, sessionTimeout);
                   sessionsById.put(id, s);
      }
      

      is not atomic for the gap between get() and put().

      I suggest using putIfAbsent() instead.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hdeng Hongchao Deng
                Reporter:
                hdeng Hongchao Deng
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: