Bug 536754

Summary: Provide better feedback for incorrect Java version
Product: [Modeling] Viatra Reporter: Zoltan Ujhelyi <zoltan.ujhelyi>
Component: QueryAssignee: Zoltan Ujhelyi <zoltan.ujhelyi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0.0   
Target Milestone: 2.0.1   
Hardware: Macintosh   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/125705
https://git.eclipse.org/c/viatra/org.eclipse.viatra.git/commit/?id=4a23807e270a21c180b290496fe8209a0741a3b9
https://git.eclipse.org/r/125944
https://git.eclipse.org/c/viatra/org.eclipse.viatra.git/commit/?id=55eb20312e2af24f3c7dc2203652b86ce793138f
Whiteboard:

Description Zoltan Ujhelyi CLA 2018-07-06 07:41:44 EDT
We have received reports that having Java 7 as a requirement for the project results in confusing error messages in the generated code, like `Type mismatch: cannot convert from Set<Object> to Collection<P.Match>` in the following place

>    public Collection<P.Match> getAllMatches(final Type pT, final Type pRef) {
>      return rawStreamAllMatches(new Object[]{pT, pRef}).collect(Collectors.toSet());
>    }

We should provide some better feedback and possibly update the migrator to ensure the Java 8 dependency as well.
Comment 1 Eclipse Genie CLA 2018-07-06 09:49:48 EDT
New Gerrit change created: https://git.eclipse.org/r/125705
Comment 3 Eclipse Genie CLA 2018-07-11 15:55:10 EDT
New Gerrit change created: https://git.eclipse.org/r/125944
Comment 4 Zoltan Ujhelyi CLA 2018-07-12 04:04:31 EDT
Classpath validator was enhanced to check for Java 8 by looking at the availability of the Stream class, and throws an error if it is missing, preventing the build of Java classes and thus the misleading Java compile errors in this case.

Fix is merged to master and backported to 2.0-maintenance.