/** * Wrap the {@link UnsupportedEncodingException} into an {@link UnexpectedEncodingException} * and throw it out. * * @param cause * the {@link UnsupportedEncodingException}. */ public static UnexpectedEncodingException encodingException(UnsupportedEncodingException cause) { throw new UnexpectedEncodingException(cause); }
/** * Convert to corresponding JDK exception. Warning, since there are synchronized method execution * please beware of the performance issue when calling this method */ public UnsupportedEncodingException toJDKException() { UnsupportedEncodingException e = new UnsupportedEncodingException() { @Override public synchronized Throwable fillInStackTrace() { return this; } }; e.setStackTrace(getStackTrace()); return e; }
/** * Convert to corresponding JDK exception. Warning, since there are synchronized method execution * please beware of the performance issue when calling this method */ public UnsupportedEncodingException toJDKException() { UnsupportedEncodingException e = new UnsupportedEncodingException() { @Override public synchronized Throwable fillInStackTrace() { return this; } }; e.setStackTrace(getStackTrace()); return e; }
/** * Wrap the {@link UnsupportedEncodingException} into an {@link UnexpectedEncodingException} * and throw it out. * * @param cause * the {@link UnsupportedEncodingException}. */ public static UnexpectedEncodingException encodingException(UnsupportedEncodingException cause) { throw new UnexpectedEncodingException(cause); }