/** * Throws out an {@link InvalidStateException}. */ public static InvalidStateException invalidState() { throw new InvalidStateException(); }
/** * Convert to corresponding JDK exception. Warning, since there are synchronized method execution * please beware of the performance issue when calling this method * @return the JDK {@link IllegalStateException} corresponding to this exception instance */ public IllegalStateException asJDKException() { IllegalStateException e = new IllegalStateException(getMessage()) { @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 * @return the JDK {@link IllegalStateException} corresponding to this exception instance */ public IllegalStateException asJDKException() { IllegalStateException e = new IllegalStateException(getMessage()) { @Override public synchronized Throwable fillInStackTrace() { return this; } }; e.setStackTrace(getStackTrace()); return e; }
/** * Throws out an {@link InvalidStateException}. */ public static InvalidStateException invalidState() { throw new InvalidStateException(); }
/** * Throws out an {@link InvalidStateException} with message specified. */ public static InvalidStateException invalidState(String msg, Object... args) { throw new InvalidStateException(S.fmt(msg, args)); }
/** * Throws out an {@link InvalidStateException} with message specified. */ public static InvalidStateException invalidState(String msg, Object... args) { throw new InvalidStateException(S.fmt(msg, args)); }