title: Method references to raw types harmful?
body: <p>The code below contains a reference to <code>Enum::name</code> (notice no type parameter).</p>
  
  <pre><code>public static &lt;T extends Enum&lt;T&gt;&gt; ColumnType&lt;T, String&gt; enumColumn(Class&lt;T&gt; klazz) {
      return simpleColumn((row, label) -&gt; valueOf(klazz, row.getString(label)), Enum::name);
  }
  
  public static &lt;T, R&gt; ColumnType&lt;T, R&gt; simpleColumn(BiFunction&lt;JsonObject, String, T&gt; readFromJson,
          Function&lt;T, R&gt; writeToDb) {
   // ...
  }
  </code></pre>
  
  <p>Javac reports a warning during compilation:</p>
  
  <blockquote>
    <p>[WARNING]  found raw type: java.lang.Enum missing type arguments for
    generic class java.lang.Enum</p>
  </blockquote>
  
  <p>Changing the expression to <code>Enum&lt;T&gt;::name</code> causes the warning to go away.</p>
  
  <p>However Idea flags the <code>Enum&lt;T&gt;::name</code> version with a warning that:</p>
  
  <blockquote>
    <p>Explicit type arguments can be inferred</p>
  </blockquote>
  
  <p>In turn Eclipse (ECJ) doesn't report any problems with either formulation.</p>
  
  <p><strong>Which of the three approaches is correct?</strong></p>
  
  <p>On one hand raw types are rather nasty. If you try to put some other type argument e.g.  <code>Enum&lt;Clause&gt;::name</code> will cause the compilation to fails so it's some extra protection. </p>
  
  <p>On the other hand the above reference is equivalent to <code>e -&gt; e.name()</code> lambda, and this formulation doesn't require type arguments.</p>
  
  <p>Enviorment:</p>
  
  <ul>
  <li>Java 8u91</li>
  <li>IDEA 15.0.3 Community</li>
  <li>ECJ 4.5.2</li>
  </ul>