JDK-6443670 : (doc) Javadoc for AtomicInteger (et.al.) missing information - get() v.s. intValue()
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.concurrent
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-06-27
  • Updated: 2024-04-12
  • Resolved: 2015-09-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
The javadoc for AtomicInteger and the other atomic number classes should state if get() and intValue() are equivalent, or if they are not it should document any differences.

The other xxxValue() methods inherited from Number should also clarified.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
read the documentation

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
the reader should understand if the the xxxValue() methods are equivalent
ACTUAL -
the reader is left to assume that this is true

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
read the source

Comments
Part of bulk integration https://bugs.openjdk.java.net/browse/JDK-8134854
21-09-2015

Barely worth doing, but jsr166 CVS now (finally!) has: --- src/main/java/util/concurrent/atomic/AtomicInteger.java 22 May 2015 23:25:23 -0000 1.42 +++ src/main/java/util/concurrent/atomic/AtomicInteger.java 24 Jun 2015 22:38:21 -0000 @@ -273,6 +273,7 @@ /** * Returns the value of this {@code AtomicInteger} as an {@code int}. + * Equivalent to {@link #get()}. */ public int intValue() { return get(); --- src/main/java/util/concurrent/atomic/AtomicLong.java 4 Jan 2015 09:15:11 -0000 1.47 +++ src/main/java/util/concurrent/atomic/AtomicLong.java 24 Jun 2015 22:38:21 -0000 @@ -298,6 +298,7 @@ /** * Returns the value of this {@code AtomicLong} as a {@code long}. + * Equivalent to {@link #get()}. */ public long longValue() { return get();
24-06-2015

EVALUATION It's hard to imagine another implementation for intValue() than to call get(). There's a tradeoff here between extra precision and excessive pedantry. Adding an explicit spec that intValue() is precisely equivalent to get() seems reasonable.
27-06-2006