Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4671453
Votes 0
Synopsis Incorrect long comparison for specific long values
Category hotspot:compiler2
Reported Against 1.4 , 1.3.1_03 , hopper-beta
Release Fixed 1.3.1_05, 1.4.0_03(Bug ID:2053871) , 1.4.1(hopper) (Bug ID:2053872)
State 10-Fix Delivered, bug
Priority: 2-High
Related Bugs 4671533
Submit Date 19-APR-2002
Description
Windows systems are not able to deal with a given long
which is namely: 9223372034707292160L.
Several thousand numbers below or above are fine.

The problem does not occur on Solaris. It seems to occur
on most 1.3 releases and on 1.4 on Windows.
The bug has been file against 1.3.1._03 and needs a fix there.

Please check the simple testcase:

public class LongCompTest {

  public static void main(String[] args) {
    System.out.println("\n--[2 Longs compare problem]--------------------");
    long l1 =  9223372034707292160L;
    long l2 = -9223372034707292160L;
    System.out.println("MAX_LONG: " + Long.MAX_VALUE );
    System.out.println("MIN_LONG: " + Long.MIN_VALUE );
    System.out.println("l1: " + l1);
    System.out.println("l2: " + l2);
    System.out.println("When comparing l1 with l2 - the result is [" + (l1 == l2
)+"]...");
  }
}
Work Around
N/A
Evaluation
In this bug, long values 9223372034707292160 (0x7fffffff80000000) and -9223372034707292160  (0x8000000080000000) erroneously compare as equal on x86 platforms.  This is a VM problem and not a problem with the libraries (failures are observed under C2 and the intrepreter).  Transferring bug accordingly. 

  xxxxx@xxxxx   2002-04-19

lcmp2int is busted, fixed
  xxxxx@xxxxx   2002-04-22
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang