Bug 22645 - String java.lang.Long.toHexString(long) drops digits
Summary: String java.lang.Long.toHexString(long) drops digits
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-22 20:46 UTC by from-classpath
Modified: 2005-07-23 22:54 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description from-classpath 2002-07-22 20:46:36 UTC
The following only prints 8 digits:

class x
{
    static public void main( String[] args )
    {
        System.out.println( Long.toHexString(0xffffffffffffffffL) );
    }
}
Comment 1 from-classpath 2002-07-22 22:32:52 UTC
Could you give us the version of Classpath you use and the compiler and VM? I tried with the current CVS version of Classpath with jikes 1.16 and Kissme from CVS and with gcj-3.1 (which uses the same Long class) and both print the correct number (16) of 'f's.
Comment 2 from-classpath 2002-07-23 00:01:21 UTC
OK. Tried with Classpath 0.04 and the bug is in that version.  But it has already been fixed in CVS by Tom Tromey so if you need the bug fix you might want to get the file Long.java from CVS:
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/java/lang/Long.java
(has a download link)

Jikes can be found through http://www.jikes.org/, gcj is distributed with the Gnu Compiler Collection (gcc), more info can be found at http://gcc.gnu.org/java/