redundant cast with generified APIs causes verify error

XMLWordPrintable

    • b49
    • generic, x86
    • solaris_8, windows_2000, windows_xp

      When APIs are generified using concrete instantiations of generic types, but
      clients continue to use (now redundenat) casts in their code, javac elides
      both the automatically-generated cast and the redudnant one, resulting in
      unverifiable code.

      here is a simplified test case:

      import java.util.*;

      class Z2 {
          protected Vector<String> v = null;

          public void f() {
              ((String) (v.elementAt(0))).charAt(0);
          }

          public static void main(String[] args) {}
      }

            Assignee:
            Neal Gafter (Inactive)
            Reporter:
            Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: