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

Typo in LongAdder documentation

XMLWordPrintable

      A DESCRIPTION OF THE REQUEST :
      The example in the documentation of java.util.concurrent.atomic.LongAdder:

      freqs.computeIfAbsent(k -> new LongAdder()).increment();

      should be:

      freqs.computeIfAbsent(key, k -> new LongAdder()).increment();

      JUSTIFICATION :
      computeIfAbsent is a newer method that programmers may find confusing. Let's not confuse them more.


            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: