title: Equality comparison of `boolean` and `Object` allowed?
body: <p>The following code</p>
  
  <pre><code>public class TestComparison {
      public static void main(String[] args) throws Exception {
          boolean b = true;
          Object o = new Boolean(true);
          System.out.println("comparison result: "+ 
              (o == b)); // Eclipse complains about this expression
      }
  }
  </code></pre>
  
  <p>compiles without errors with <code>javac</code> V1.7.0_15, and prints "false" when run. However, Eclipse Juno complains about "Incompatible operand types Object and boolean".</p>
  
  <p>Apparently javac autoboxes the primitive boolean <code>b</code>, and then compares <code>o</code> and autoboxed <code>b</code> by object equality, yielding <code>false</code>, while Eclipse refuses to do the autoboxing.</p>
  
  <p>Which is the right behaviour according to the Java Language Specification? Where should I file a bug?</p>
  
  <p><em>Note:</em> If I change the type of <code>o</code> to <code>Boolean</code>, things work as expected: Eclipse accepts the code, and the code prints "true".</p>
  
  <p><a href="https://ideone.com/7H0028" rel="nofollow">Runnable version on ideone.com</a></p>