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

8.1.2: Disallow generic exception types by specifying generic inner classes

XMLWordPrintable

    • Fix Understood

      Given:
        class Hole<T> {
          class X extends RuntimeException { X(T t) {...} ... }
          ... throw new Hole<Integer>().new X(3);
        }
      The 5.0 compiler accepts this and the 6.0 compiler rejects it, but there is nothing in the JLS to justify the change in compiler behavior. javac now gets this right, but the spec doesn't.

            dlsmith Dan Smith
            abuckley Alex Buckley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: