-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
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);
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);