title: javax.persistence.Query.getResultList() returning null list
body: <p>I am using  <code>getResultList  ( List javax.persistence.Query.getResultList() )</code> in my dao to fetch a list of objects. Any idea why it may return  <code>{null,null,null,null,null,null,null,null,null,null}</code>  for a query which was has no match in the db. This is causing my code List. <code>hasNext()</code>  to break which was working fine earlier. I wasn't working in this project for a while (If it matters). It's using </p>
  
  <blockquote>
    <p>hibernate-core-4.1.9.Final-sources.jar</p>
  </blockquote>
  
  <p>I saw <a href="https://stackoverflow.com/questions/1115480/can-javax-persistence-query-getresultlist-return-null">this</a> and understands it is returning list now. </p>
  
  <ul>
  <li>Since which version this change has come to effect?</li>
  <li>How the hibernate decide the size of this list?</li>
  <li>How to stay away from this kind of errors in general?</li>
  </ul>