Skip to main content

generated bytecode difference between Eclipse's and Sun's compilers

No replies
alexlamsl
Offline
Joined: 2004-09-02
Points: 0

I have been using NetBeans and thus Sun's Java Compiler; and thanks to the new FindBugs plug-in, I was able to fix quite a bunch of potential bugs. :)

But there are a bunch of warnings from FindBugs which I failed to understand:

[pre]
public interface E {
}

public interface M {
T m(T op);
}

public interface V extends E, M {
}

public class C implements V {
public V m(V op) {
...;
}
}
[/pre]

FindBugs will complain that in C.m() op is unsafely casted from E to V! :(

But just now (due to Java's bug 6372782) I tried Eclipse's compiler to compile exactly the same project, and run FindBugs again - all these warnings are gone!

So there must be a difference in byte-code generated by the 2 compiler?

(For Sun's compiler I've tried both Tiger Update 6 and Mustang build 70)