Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6209030

Too strict signature of java.lang.Enum.valueOf

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 6
    • core-libs
    • None
    • generic
    • generic

      This program doesn't compile:

      class Test {
          Enum<?> test(Class<? extends Enum<?>> enumClass, String value) {
      return Enum.valueOf(enumClass, value);
          }
      }

      unless we change the signature if valueOf to:

      <T extends Enum<?>> T valueOf(Class<T> enumType, String name);

      ###@###.### 2004-12-15 17:08:13 GMT

            ahe Peter Ahe
            ahe Peter Ahe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: