Files
lombok/test/transform/resource/after-delombok/StandardExceptions.java
T
Reinier Zwitserloot 415e303ac2 [pr 2702] finishing the @StandardException feature.
* rewritten how it works a bit: Now compatible with parent exceptions that don't have the Throwable variants.
* rewritten how it works a bit: You can now provide the full constructor only; the rest will forward to it.
* fixing up style.
* rewrite the docs.
2021-04-16 06:40:35 +02:00

36 lines
1.1 KiB
Java

class EmptyException extends Exception {
@java.lang.SuppressWarnings("all")
public EmptyException() {
this(null, null);
}
@java.lang.SuppressWarnings("all")
public EmptyException(final java.lang.String message) {
this(message, null);
}
@java.lang.SuppressWarnings("all")
public EmptyException(final java.lang.Throwable cause) {
this(cause != null ? cause.getMessage() : null, cause);
}
@java.lang.SuppressWarnings("all")
public EmptyException(final java.lang.String message, final java.lang.Throwable cause) {
super(message);
if (cause != null) super.initCause(cause);
}
}
class NoArgsException extends Exception {
public NoArgsException() {
}
@java.lang.SuppressWarnings("all")
protected NoArgsException(final java.lang.String message) {
this(message, null);
}
@java.lang.SuppressWarnings("all")
protected NoArgsException(final java.lang.Throwable cause) {
this(cause != null ? cause.getMessage() : null, cause);
}
@java.lang.SuppressWarnings("all")
protected NoArgsException(final java.lang.String message, final java.lang.Throwable cause) {
super(message);
if (cause != null) super.initCause(cause);
}
}