Name: boT120536 Date: 11/09/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
public class Trial { // NOTE: this works in JDK-1.2.2 but not in JDK-1.3
private class Inner {
// NOTE: if this is protected everything works as normal
private int data = 4711;
}
public void strange() {
Inner inner = new Inner();
inner.data ^= 42; // NOTE: "inner.data = inner.data ^ 42" works
System.out.println(inner.data);
// ERROR: output: 77 (should be 4685)
}
public static void main(String[] args) {
Trial trial = new Trial();
trial.strange();
}
}
(Review ID: 111420)
======================================================================