title: Enum.valueOf throws a warning for unknown type of class that extends Enum?
body: <p>Give this:</p>
  
  <pre><code>Class&lt;? extends Enum&gt; enumClass = ...; // being passed in from a constructor
  Enum e = Enum.valueOf(enumClass, aString); // produces a warning that looks like
  </code></pre>
  
  <blockquote>
    <p>[unchecked] unchecked method invocation:
    valueOf(java.lang.Class,java.lang.String) in java.lang.Enum is
    applied to (java.lang.Class,java.lang.String)</p>
  </blockquote>
  
  <p>I don't want to use generics because that's a major change. I don't want to supress. I don't understand why this warning happens. I imagine it is because one cannot extend an Enum type. I get that. But I don't get why the wildcard class is throwing this weird error. Is there a way to fix this without using <code>@SupressWarning</code> or using generics? </p>
  
  <p><strong>Edit</strong>: To Clarify, the following code using generics makes the warning go away.</p>
  
  <pre><code>class Foo&lt;T extends Enum&lt;T&gt;&gt;{
      Class&lt;T&gt; enumClass;
      Enum e = Enum.valueOf(enumClass, aString);
  }
  </code></pre>
  
  <p>The usage of <code>&lt;T&gt;</code> is what I mean by using generics. I can't do that because it would be a huge cascading change. </p>