Reduce "exception is never thrown in body of corresponding try statement" Error to a Warning

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: 13
    • Component/s: tools
    • None
    • generic
    • generic

      per the discussion begun in https://mail.openjdk.java.net/pipermail/jdk-dev/2019-October/003480.html this change removes the following JLS rule from section 11.2.3:

           "It is a compile-time error if a catch clause can catch checked exception class E1
            and it is not the case that the try block corresponding to the
      catch clause can
            throw a checked exception class that is a subclass or superclass of
      E1, unless E1
            is Exception or a superclass of Exception."

      and converting the javac error message for this condition to a warning.

      The necessary patch required for this change is brief and will be posted as a webrev or PR once I remember how to do that again. ;-)

            Assignee:
            Mike Duigou
            Reporter:
            Mike Duigou
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: