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

8.1.2: Disallow generic exception types by specifying generic inner classes

    XMLWordPrintable

    Details

    • Subcomponent:
    • Understanding:
      Fix Understood

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Imported:
                Indexed: