Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 498023

Summary: Eclipse 4.6 (Neon) and Java 1.8: Maven build passes; yet, Eclipse displays errors "Type mismatch: cannot convert..."
Product: [Eclipse Project] JDT Reporter: Dejan Stojadinović <dejan2609>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: dejan2609, stephan.herrmann
Version: 4.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Attachments:
Description Flags
Eclipse screenshot
none
Eclipse works as expected :) none

Description Dejan Stojadinović CLA 2016-07-17 12:10:24 EDT
Created attachment 263150 [details]
Eclipse screenshot

Eclipse 4.6 (Neon) and Java 1.8: Maven build passes; yet, Eclipse displays errors "Type mismatch: cannot convert..."
Comment 1 Dejan Stojadinović CLA 2016-07-17 12:20:36 EDT
Possible related bugs:
* 464496 - [1.8][compiler] Type Type mismatch: cannot convert from Integer to long
* 491934 - [regression] [compiler] Unchecked warning turned into type mismatch compile error in Neon
* 496942 Eclipse Neon stop compiling Java code and make me to do an unnecessary explicit casting
Comment 2 Dejan Stojadinović CLA 2016-07-17 12:25:21 EDT
Possible related bugs (with proper URLs):
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=464496 - [1.8][compiler] Type Type mismatch: cannot convert from Integer to long
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=491934 - [regression] [compiler] Unchecked warning turned into type mismatch compile error in Neon
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=496942 - Eclipse Neon stop compiling Java code and make me to do an unnecessary explicit casting
Comment 3 Stephan Herrmann CLA 2016-07-17 12:36:28 EDT
Please paste or attach a self-contained source code example that triggers the problem.
Comment 4 Dejan Stojadinović CLA 2016-07-18 13:44:53 EDT
Can't share entire project; also, it is far from trivial to extract only related parts of code.
Solving as invalid.
Comment 5 Dejan Stojadinović CLA 2016-07-18 13:50:34 EDT
Just for the record: 

https://stackoverflow.com/questions/37135622/eclipse-bug-type-mismatch-cannot-convert-from-classmatchedarticle-to-class 

<quote>
I have a class like this:

@JsonSerialize(using=MatchedArticle.class)
public class MatchedArticle extends JsonSerializer<MatchedArticle>{

It builds fine with maven, but Eclipse reports the following error:

    Type mismatch: cannot convert from Class<MatchedArticle> to Class<? extends JsonSerializer<?>>

which is weird because MatchedArticle really do extend JsonSerializer

Any hints on how to turn off this exact validation in Eclipse?
</quote>
Comment 6 Stephan Herrmann CLA 2016-07-19 06:18:53 EDT
I tried to reproduce the problem reported at StackOverflow, but couldn't. We have nothing in our hands to work on the issue, so closed invalid is the final word, unless we get more information.
Comment 7 Dejan Stojadinović CLA 2016-07-27 16:12:29 EDT
Update: is seems that everything is just fine with Eclipse 4.6: I started from the scratch, installed bunch of plugins to my new Eclipse installation and voila: same project works like a charm (no errors) :) I guess that Eclipse Groovy plugin introduced some issues, I will try to investigate little bit more and perhaps report bug to their github repo.
Comment 8 Dejan Stojadinović CLA 2016-07-27 16:17:19 EDT
Created attachment 263342 [details]
Eclipse works as expected :)
Comment 9 Stephan Herrmann CLA 2016-07-27 17:43:00 EDT
(In reply to Dejan Stojadinović from comment #8)
> Created attachment 263342 [details]
> Eclipse works as expected :)

Thanks for confirming.