Today I've been playing around with Eclipse Juno. Coming from Helios it is a great upgrade. Everything is working fine, except one new compile error.
We are using the java.net framework 'Fuse' and we call the following method:
ResourceInjector.get().inject(true, this);
Eclipse tells us:
The method inject(Object[]) is ambiguous for the type ResourceInjector
The following methods collide:
inject(Object... components);
inject(boolean arg0, Object... arg1);
It worked fine (with Java 1.6.0.25) in Eclipse Helios, but now it gives a compile error and doesn't want to run anymore. It seems to us that this is a bug in Eclipse Juno, if we build using Maven is builds fine... Does anybody know a work-around for this?
This is actually a bug in Java 5 and Java 6. This has been fixed in Java 7, and Eclipse now checks for this 'bug'.
More about the bug here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6886431
What method should be called in the following case?
inject(true);
Both can apply, sure, but the primitive boolean surely is a better match? Not according to the Java Language Specification (JLS):
A work-around (we aren't able to change Fuse itself):
ResourceInjector.get().inject(true, new Object[] {this});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With