Add a UnsupportedEncodingException constructor that accepts a cause

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: core-libs

      java.io.UnsupportedEncodingException does not have a constructor that accepts a cause.

      There are some examples of sites that create a UnsupportedEncodingException and call initCause to set a cause, for example: https://github.com/openjdk/jdk/blob/3541bc8635ad8f5f4151758de3a134c9c105cebd/src/jdk.internal.le/share/classes/jdk/internal/org/jline/utils/InputStreamReader.java#L101C54-L101C82

      It would be nice to be able to write:

      throw new UnsupportedEncodingException(enc, e);

      instead of:

      throw (UnsupportedEncodingException) new UnsupportedEncodingException(enc).initCause(e);

            Assignee:
            Liam Miller-Cushon
            Reporter:
            Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: