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

8.8.9: Allow call to super constructor that 'throws RuntimeException'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 7, 8
    • specification

      The body of a default constructor is a 'super()' call; the following rule ensures that this call is valid:

      "It is a compile-time error if a default constructor is implicitly declared but the superclass does not have an accessible constructor that takes no arguments and has no throws clause."

      However, the rule is stricter than necessary, and is stricter than longstanding javac behavior (I tested 6, 7, and 8).

      A better test: does the invocation type (15.12.2.6) of the implicit super constructor invocation (8.8.7.1) throw any types that are not subtypes of RuntimeException? (Note that the connection between 8.8.7.1 and 15.12.2 is not spelled out -- see JDK-8034925.)

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

              Created:
              Updated: