Community
Participate
Working Groups
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.
The original bug is reported under https://github.com/hdbeukel/james-core/issues/31 (the previously posted link is a duplicate of this bug).
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 :)
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.
bulk move out of 4.8
Bulk move out of 4.9
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.