Name: clC74495 Date: 10/28/98
To repro: Compile and run the follwing program.
Expected: Both of f1() and f2() are called.
Actual : Only f2() was called.
Comment :
self-inconsistent behavior.
Generally "Primary" in "Primary.staticSomething" should be evaluated.
If evaluating f2() is correct f1() should be evaluated also.
-----------------------------------------------------------
class O {
public static void main(String[]args) {
new O();
}
O() {
f1().super(); // even if the value of f() would be trashed
// f() itself should be evaluated.(BUG)
f2().staticField = 0; // f() evaluated correctly!!(OK)
}
static int staticField;
static O f1() {
System.out.println("f1() called!!");
return null;
}
static O f2() {
System.out.println("f2() called!!");
return null;
}
static class Nested {}
}
----------------------------------------------------
---<Log>----------------------------
B:\wk>javac O.jav
B:\wk>java O
f2() called!!
B:\wk>
------------------------------------
(Review ID: 41279)
======================================================================
- duplicates
-
JDK-4050060 javac accepts illegally qualified use of super
-
- Closed
-