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:
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: