ADDITIONAL SYSTEM INFORMATION :
OS : Windows 10
Java Runtime :
C:\Users\dbgud>java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
A DESCRIPTION OF THE PROBLEM :
comparing max value of Long type variable makes an error,
Let's see the code:
long a = 9223372036854775807L;
long b = 9223372036854775807L;
System.out.println(a == b);
this returns true;
but,
Long a = 9223372036854775807L;
Long b = 9223372036854775807L;
System.out.println(a == b);
this returns false
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the code below:
Long a = 9223372036854775807L;
Long b = 9223372036854775807L;
System.out.println(a == b);
ACTUAL -
false
CUSTOMER SUBMITTED WORKAROUND :
changing type of variable from Long to long
FREQUENCY : always
OS : Windows 10
Java Runtime :
C:\Users\dbgud>java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
A DESCRIPTION OF THE PROBLEM :
comparing max value of Long type variable makes an error,
Let's see the code:
long a = 9223372036854775807L;
long b = 9223372036854775807L;
System.out.println(a == b);
this returns true;
but,
Long a = 9223372036854775807L;
Long b = 9223372036854775807L;
System.out.println(a == b);
this returns false
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the code below:
Long a = 9223372036854775807L;
Long b = 9223372036854775807L;
System.out.println(a == b);
ACTUAL -
false
CUSTOMER SUBMITTED WORKAROUND :
changing type of variable from Long to long
FREQUENCY : always