-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
1.2beta4
-
generic
-
generic
-
Not verified
allan.jacobs@Eng 1997-12-05
Negative int literals that the specification says should cause
a compile-time error are not rejected by JDK 1.2 javac.
algol% cat irange1.java
public class irange1 {
public static void main(String[] argv) {
int i1 = -2147483649; // error: -2147483549 out-of-range
System.out.println(i1);
}
}
With a JDK 1.1.4 compiler:
pine% javac -d . irange1.java
irange1.java:4: Numeric overflow.
int i1 = -2147483649; // error: -2147483549 out-of-range
^
1 error
With a JDK 1.2 compiler:
algol% ${JSOFT}/javac -d . irange1.java
algol% ${JSOFT}/java -verify irange1
2147483647
With JTG's exact-vm compiler (JDK 1.2):
algol% /usr/java1.2e/bin/javac -d . irange1.java
algol% /usr/java1.2e/bin/java -verify irange1
2147483647