Bug 519247 - The method foo(...capture#95-of ? super...) is ambiguous for the type Bar<capture#94-of ? super...>
Summary: The method foo(...capture#95-of ? super...) is ambiguous for the type Bar<cap...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2017-07-05 11:19 EDT by ecl ecl CLA
Modified: 2022-11-14 11:41 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ecl ecl CLA 2017-07-05 11:19:51 EDT
After importing the source code of a Java library and its git submodules (https://github.com/hdbeukel/james), eclipse shows this compiler message in class org.jamesframework.core.problems.GenericProblem:

The method validate(Move<? super SolutionType>, SolutionType, Validation, capture#95-of ? super DataType) is ambiguous for the type PenalizingConstraint<capture#94-of ? super SolutionType,capture#95-of ? super DataType>

According to the developer (https://github.com/hdbeukel/james-core/issues/41) this is an eclipse issue.

I do not know if this is related to bug 434044 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=434044), where Java 8 introduced a similar problem.

Eclipse version: 4.7.0
JDT version: 3.13.0.
Comment 1 ecl ecl CLA 2017-08-31 06:17:02 EDT
The original bug is reported under https://github.com/hdbeukel/james-core/issues/31 (the previously posted link is a duplicate of this bug).
Comment 2 Stephan Herrmann CLA 2017-08-31 07:51:37 EDT
Some questions (while currently Java 9 has priority over other issues - so I haven't yet looked into that code base):

Have you tried compiling with javac from Java 9 ea? They have fixed several bugs wrt handling of wildcards in their compiler, and if javac 9 shows the same error then we'd know this was just a bug in javac 8 and below.

Can you provide a reduced example demonstrating the problem? That would greatly increase the chances that we can look into it in a timely fashion.

Developers are quick in believing javac more than ecj, but can you also provide reasons for believing that javac is right based on JLS? Just quoting that other tools (which simply delegate to javac) don't report an error doesn't support that theory :)
Comment 3 ecl ecl CLA 2017-09-05 10:41:55 EDT
Thank you very much for your reply, Stephan! I can very much understand that other tasks such as java 9 have a higher priority.


- It is possible to compile the class in question (org.jamesframework.core.problems.GenericProblem) with both javac versions 1.8.0_131 and jdk-9+181 ea (both 64 bit) from command line without a problem. It is just eclipse that shows the compile error in the source code editor (see here for an example from the original bug report https://cloud.githubusercontent.com/assets/5897215/13882249/789830c8-ed03-11e5-82ea-5a499512ff40.png).


- I think it is hard to reduce library code without breaking something. But the root of the problem should be in the following to methods:

1. (which calls method 2)
Class: org.jamesframework.core.problems.GenericProblem
Method: public Evaluation evaluate(Move<? super SolutionType> move, SolutionType curSolution, Evaluation curEvaluation)

2.
Class: org.jamesframework.core.problems.constraints.PenalizingConstraint
Method: default public <ActualSolutionType extends SolutionType> PenalizingValidation validate(Move<? super ActualSolutionType> move, ActualSolutionType curSolution, Validation curValidation, DataType data)


- I agree that javac working does not necessarily mean that ecj is bugged. Unfortunately, I am not an expert on wildcards and can not provide further evidence backed by the JSL that the problem is indeed rooted in ecj.
Comment 4 Manoj N Palat CLA 2018-05-17 03:23:52 EDT
bulk move out of 4.8
Comment 5 Manoj N Palat CLA 2018-08-16 00:09:19 EDT
Bulk move out of 4.9
Comment 6 Eclipse Genie CLA 2022-11-14 11:41:34 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.