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

Unchecked warning required for checked assignment

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 5.0
    • specification
    • None
    • generic
    • generic

      The program below generates one warning, although the two fields has
      equivalent types.

      class Handle<E extends Number> {
      }

      abstract class GenericAssignment {

          Handle<? extends Number> whyWarning = lookup(Handle.class);
          Handle<?> noWarning = lookup(Handle.class);

          abstract <T> T lookup(Class<T> clazz);

      }

            abuckley Alex Buckley
            ahe Peter Ahe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: