Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » [Java8] Wrong compilation error reported?
[Java8] Wrong compilation error reported? [message #1748497] Wed, 23 November 2016 15:56 Go to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hello,

I have a compilation error in the workspace but when compiling using Maven, everything seems fine.

Here is the error reported:
The type of resolve(Set<Bean<? extends Object>>) from the type BeanManager is Bean<? extends Object>, this is incompatible with the descriptor's return type: Bean<Object>


The related code is:
        return Optional.of(manager.getBeans(name))
            .map(manager::resolve)
            .map(bean -> getReference(manager, type, bean));

that can be found on github here: https://github.com/apache/camel/blob/master/components/camel-cdi/src/main/java/org/apache/camel/cdi/BeanManagerHelper.java#L42

I'm using Eclipse Oxygen M3
Version: Oxygen Release Milestone 3 (4.7.0 M3)
Build id: 20161103-0824

Am I right to think that it is a bug in Eclipse?

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: [Java8] Wrong compilation error reported? [message #1748506 is a reply to message #1748497] Wed, 23 November 2016 17:10 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
First thing to try: does javac early access build towards Java 9 accept the code? They have fixed some bugs relating to wildcards lately.
Re: [Java8] Wrong compilation error reported? [message #1748507 is a reply to message #1748506] Wed, 23 November 2016 17:35 Go to previous message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi Stephan,

thanks for the suggestion.

Do you mean that potentially the Java 8 compiler was able to compile this code but that Java 9 might not because some fix were done? Seems weird.

I didn't use javac directly since my student years. There are quite a lot of dependency for which I don't know how to determine them and let javac be aware of.
I tried to use Java 9 with maven directly but it fails with "Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher"

I tried to use Java 9 compilation compliance level in Eclipse preference on the project but there is still the same error.

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Previous Topic:What formatter option can I change to stop my arrays being formatted onto one line
Next Topic:help
Goto Forum:
  


Current Time: Wed Oct 09 23:36:01 GMT 2024

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

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

Back to the top