title: ibm vs oracle java casting difference
body: <p>i have a piece of code </p>
  
  <pre><code> for(Importer user : getUserRecords(query.getResultList())){...
  </code></pre>
  
  <p>where the called function is </p>
  
  <pre><code>protected List&lt;Importer&gt; getUserRecords(List&lt;Object[]&gt; users){
      List&lt;Importer&gt; result = new ArrayList&lt;Importer&gt;();
      for (Object[] obj : users) {
          UserRecord userRecord = (UserRecord) obj[0];
          ...
          result.add(userRecord);
      } return result;
  </code></pre>
  
  <p>everything is ok in eclipse and in maven when i use ibm java 1.6.
  When i switch to oracle java 1.8 in eclipse it is also ok but maven compiler complains that the getUserRecords returns wrong types</p>
  
  <blockquote>
    <p>incompatible types: java.lang.Object cannot be converted to com.volvo.cmslms.database.entities.importer.Importer</p>
  </blockquote>
  
  <p>however when i change the code to</p>
  
  <pre><code>List&lt;Importer&gt; userImporters = getUserRecords(query.getResultList());
          for(Importer user : userImporters){...
  </code></pre>
  
  <p>everything is ok everywhere. I dont have a clue what the issue is here. </p>