title: Is this valid Java?
body: <p>Is this valid Java?</p>
  
  <pre><code>import java.util.Arrays;
  import java.util.List;
  
  class TestWillThatCompile {
  
      public static String f(List&lt;String&gt; list) {
          System.out.println("strings");
          return null;
      }
  
      public static Integer f(List&lt;Integer&gt; list) {
          System.out.println("numbers");
          return null;
      }
  
      public static void main(String[] args) {
          f(Arrays.asList("asdf"));
          f(Arrays.asList(123));
      }
  
  }
  </code></pre>
  
  <ul>
  <li>Eclipse 3.5 says <strong>yes</strong>  </li>
  <li>Eclipse 3.6 says <strong>no</strong>  </li>
  <li>Intellij 9 says <strong>yes</strong>  </li>
  <li>Sun javac 1.6.0_20 says <strong>yes</strong>  </li>
  <li>GCJ 4.4.3 says <strong>yes</strong>    </li>
  <li>GWT compiler says <strong>yes</strong>    </li>
  <li>Crowd at my <a href="https://stackoverflow.com/questions/3105177/why-is-one-class-valid-while-the-other-is-not">previous Stackoverflow question</a> says <strong>no</strong></li>
  </ul>
  
  <p>My java theory understanding says <strong>no</strong>!</p>
  
  <p>It would be interesting to know what <a href="http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html" rel="nofollow noreferrer">the JLS</a> is saying about it.  </p>