I usually work with IntelliJ but recently one of my team mate opened project in eclipse and he found eclipse showing error Type mismatch: cannot convert from Object to boolean in 2 separate java files. I crossed checked in IntelliJ but no error.
Below are the screenshot from Eclipse and IntelliJ respectively:
Eclipse:
IntelliJ
I also checked that both the IDEs have same compiler compliance level, i.e. 11
Eclipse:
IntelliJ
Even though Eclipse is showing error, if I run the project in eclipse then build and run is successful. Here is the reproducible example.
Note: As in above actual code example row object is created from an interface, I do not have access to see it's actual implementation. Hence the reproducible example is created just to generate the scenario, to so that I can understand why and how two different IDEs behave differently ? And why even in Eclipse code is running without any errorI have created below reproducible example:
IRow.java:
public interface IRow { <T> T getValue(); } RowImpl.java
public class RowImpl implements IRow { @SuppressWarnings("unchecked") @Override public <T> T getValue() { return (T) Boolean.TRUE; } } and the main.java
public class main { public static void main(String args[]) { IRow row = new RowImpl(); if(row.getValue()) //--> Eclipse shows error but IntelliJ not System.out.println("value is true"); } } 


