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

Wrong exmple in document

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 9
    • 8u66
    • core-libs

      A DESCRIPTION OF THE PROBLEM :
      Wrong parameters in document: freqs.computeIfAbsent(k -> new LongAdder())
      It should write like this : freqs.computeIfAbsent(key, k -> new LongAdder())

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      For example, to add a count to a ConcurrentHashMap<String,LongAdder> freqs, you can use freqs.computeIfAbsent(key, k -> new LongAdder()).increment();
      ACTUAL -
      For example, to add a count to a ConcurrentHashMap<String,LongAdder> freqs, you can use freqs.computeIfAbsent(k -> new LongAdder()).increment();

      URL OF FAULTY DOCUMENTATION :
      https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html

            aroy Abhijit Roy (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: