Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8023104

ConcurrentHashMap typo

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8
    • 8
    • core-libs

    Description

      Typo that crept in during a refactoring.

      http://cs.oswego.edu/pipermail/concurrency-interest/2013-August/011695.html

      This change is already in the jsr166 CVS.

      diff --git a/src/share/classes/java/util/concurrent/ConcurrentHashMap.java b/src/share/classes/java/util/concurrent/ConcurrentHashMap.java
      --- a/src/share/classes/java/util/concurrent/ConcurrentHashMap.java
      +++ b/src/share/classes/java/util/concurrent/ConcurrentHashMap.java
      @@ -2785,7 +2785,7 @@ public class ConcurrentHashMap<K,V> exte
                               return;
                           }
                       }
      - else if ((s | WAITER) == 0) {
      + else if ((s & WAITER) == 0) {
                           if (U.compareAndSwapInt(this, LOCKSTATE, s, s | WAITER)) {
                               waiting = true;
                               waiter = Thread.currentThread();

      Attachments

        Activity

          People

            chegar Chris Hegarty
            chegar Chris Hegarty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: