title: Why is an int-to-Object comparison valid in Java 7, but not in Java 8?
body: <p>The following code,</p>
  
  <pre><code>private boolean compare(Object a, int b) {
      return a == b;
  }
  </code></pre>
  
  <p>compiles in Java 7, but it results in the following error in Java 8:</p>
  
  <blockquote>
    <p>incomparable types: int and Object</p>
  </blockquote>
  
  <p>Looking at the following question:</p>
  
  <p><a href="https://stackoverflow.com/questions/18500209/comparing-object-and-int-in-java-7">Comparing Object and int in Java 7</a></p>
  
  <p>It seems like Java&nbsp;6 and Java&nbsp;8 don't let you compare <code>int</code> and <code>Object</code>, while 7 does. Is there any documentation on this?</p>
  
  <p>I'm interested in the background knowledge that informed these decisions. It seems like they were undecided or something.</p>
  
  <p>I'm using <a href="http://en.wikipedia.org/wiki/IntelliJ_IDEA" rel="nofollow noreferrer">IntelliJ IDEA</a> 14.1.4 with JDK 1.7.0.51.</p>