title: Java generic issue: "incompatible types; inferred type argument(s) java.lang.Object do not conform to bounds of type variable(s) T
body: <p>The following simple program compiles with Eclipse compiler, but not Javac:</p>
  
  <pre><code>public class Test {
  
      public static interface Function&lt;T1, T2, Boolean&gt; {
          Boolean apply(T1 t1, T2 t2);
      }
  
      private static &lt;T extends Comparable&lt;T&gt;&gt; Function&lt;T, T, Boolean&gt; _cmp(final boolean lt) {
          return new Function&lt;T, T, Boolean&gt;() {
              @Override
              public Boolean apply(T t1, T t2) {
                  if (lt) {
                      return (t1.compareTo(t2) &lt; 0);
                  } else {
                      return (t1.compareTo(t2) &gt; 0);
                  }
              }
          };
      }
  
      public static Function LESS_THAN = _cmp(true); // error line
      public static Function GREATER_THAN = _cmp(false); // error line
  
  }
  </code></pre>
  
  <p>The error message of Javac: </p>
  
  <pre><code>java: P:\java-tool\src\main\java\T3.java:20: incompatible types; inferred type argument(s) java.lang.Object do not conform to bounds of type variable(s) T
  found   : &lt;T&gt;T3.Function&lt;T,T,java.lang.Boolean&gt;
  required: T3.Function
  </code></pre>