JDK-8154133 : Typo in Javadoc for java.lang.Integer.formatUnsignedInt()
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: linux
  • CPU: x86_64
  • Submitted: 2016-04-12
  • Updated: 2017-04-27
  • Resolved: 2017-04-27
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
Exists in jdk8, jdk8u, and jdk9

openjdk version "1.8.0_77"
OpenJDK Runtime Environment (build 1.8.0_77-b03)
OpenJDK 64-Bit Server VM (build 25.77-b03, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
All OSes.
Example: Linux godwit.cs.washington.edu 4.4.6-200.fc22.x86_64 #1 SMP Wed Mar 16 22:13:40 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

EXTRA RELEVANT SYSTEM CONFIGURATION :
All configurations.  Problem is in source code.

A DESCRIPTION OF THE PROBLEM :
In the Javadoc for java.lang.Integer.formatUnsignedInt(), "a long" should be "an int".

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Source code error, no steps needed to reproduce.
View the Javadoc for the method.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
You should see "an int".
ACTUAL -
You will see "a long", which is incorrect.


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Apply the following patch:

--- /homes/gws/mernst/java/jdk-openjdk8/src/share/classes/java/lang/Integer.java	2014-01-01 21:03:36.989474867 -0800
+++ -	2016-04-12 16:38:00.321864615 -0700
@@ -319,7 +319,7 @@
     }
 
     /**
-     * Format a long (treated as unsigned) into a character buffer.
+     * Format an int (treated as unsigned) into a character buffer.
      * @param val the unsigned int to format
      * @param shift the log2 of the base to format in (4 for hex, 3 for octal, 1 for binary)
      * @param buf the character buffer to write to


Comments
Normally javadoc issues are not fixed in the update release versions(Since it will not be published after the main release). Closing this bug as- "Won't Fix" since the issue is already resolved in JDK9.
27-04-2017

Result: ********* JDK 8 : Issue exist JDK 9 : Issue not found
13-04-2016