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

Unnecessary unchecked warning (result type should not be erased)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • 6
    • 5.0
    • tools
    • None
    • generic, x86
    • generic, linux, windows_xp

      The unchecked warning in the program below is not mandated by
      the spec.

      import java.util.*;

      class Model<T> {
          public List<String> getContent() { return null; }
          public static void main(String[] args) {
              Model m = null;
              List<String> l = m.getContent(); // <-- unchecked warning!
          }
      }

      See: http://forum.java.sun.com/thread.jspa?threadID=609333&messageID=3336600#3336600

      ###@###.### 2005-03-22 18:13:54 GMT

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: