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

add warning when type-variable's declared bound is final

XMLWordPrintable

    • unknown
    • generic

      It would be useful to have an Xlint warning when a type-variable's declared bound(s) is final as in:

      class Foo<X extends Integer> {
       X x;
      }

      I think this is a useful one, as it helps the programmer get rid of useless generic types (in this case you only have to replace X with Integer inside Foo). The above code could be simplified to:

      class Foo {
       Integer x;
      }

            kizune Alexander Zuev
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: