Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » The method inject(Object[]) is ambiguous(New ambiguous build error after upgrade to Juno)
icon9.gif  The method inject(Object[]) is ambiguous [message #893332] Tue, 03 July 2012 14:58 Go to next message
Roy van Rijn is currently offline Roy van RijnFriend
Messages: 2
Registered: July 2012
Junior Member
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 run anymore. Is this a bug in Eclipse Juno? Is there a workaround?
icon11.gif  Re: The method inject(Object[]) is ambiguous [message #893428 is a reply to message #893332] Wed, 04 July 2012 06:57 Go to previous messageGo to next message
Roy van Rijn is currently offline Roy van RijnFriend
Messages: 2
Registered: July 2012
Junior Member
Confused

I have found a work-around now:
ResourceInjector.get().inject(true, new Object[] {this});


But why should this be needed? How come Eclipse Juno doesn't want to compile this while Maven and Eclipse Helios think it is fine? Does it use some other javac flags?
Re: The method inject(Object[]) is ambiguous [message #893484 is a reply to message #893428] Wed, 04 July 2012 10:34 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 04.07.2012 08:57, Roy van Rijn wrote:
> :?
> I have found a work-around now:
> ResourceInjector.get().inject(true, new Object[] {this});
>
>
> But why should this be needed? How come Eclipse Juno doesn't want to
> compile this while Maven and Eclipse Helios think it is fine? Does it
> use some other javac flags?
>
javac 1.7 will also reject that invalid code. See
https://bugs.eclipse.org/383780 for more details.

Dani
Previous Topic:eclipse settings vanish after Ubuntu upgrade
Next Topic:Is Eclipse Builder best suited for my requirement?
Goto Forum:
  


Current Time: Fri Apr 26 20:27:52 GMT 2024

Powered by FUDForum. Page generated in 0.02724 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top