You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
static Integer getInteger() {
return Integer.MIN_VALUE;
}
public int foo() {
Y<Integer> f = new Y<>();
f.put(X.getInteger()); // This makes all the difference
return f.get() instanceof float ? 3 : 2;
}
Compiled and run, this returns 3 with ECJ but returns 2 with Javac. Inspecting the compiled output, I see this from ECJ: 19: instanceof #3 // class java/lang/Object
which I believe is wrong. With Javac, it's Integer.
BTW, Y is defined as below:
class Y<T> {
T a;
T get() {
return a;
}
void put(T val) {
a= val;
}
}
The text was updated successfully, but these errors were encountered:
Finally got to this. javac differed earlier -Compiling with Java 24 at EA23 version where this is different and a EA27 version onwards where this result is 3 now as per ECJ behaviour. The above patch is only a unit test case.
Given the code,
Compiled and run, this returns 3 with ECJ but returns 2 with Javac. Inspecting the compiled output, I see this from ECJ:
19: instanceof #3 // class java/lang/Object
which I believe is wrong. With Javac, it's Integer.
BTW, Y is defined as below:
The text was updated successfully, but these errors were encountered: