diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2021-04-16 06:40:35 +0200 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2021-04-16 06:40:35 +0200 |
commit | 415e303ac283df8d694b311f4f8df08f6e79cf0e (patch) | |
tree | 99c4e502fdb90db2e8e1e27ebf855b236ac41b59 /website/usageExamples | |
parent | 2e212de523407c8d9f4471fea573c6c70164513b (diff) | |
download | lombok-415e303ac283df8d694b311f4f8df08f6e79cf0e.tar.gz lombok-415e303ac283df8d694b311f4f8df08f6e79cf0e.tar.bz2 lombok-415e303ac283df8d694b311f4f8df08f6e79cf0e.zip |
[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.
Diffstat (limited to 'website/usageExamples')
-rw-r--r-- | website/usageExamples/StandardExceptionExample_post.jpage | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/website/usageExamples/StandardExceptionExample_post.jpage b/website/usageExamples/StandardExceptionExample_post.jpage index 148603a9..950ca898 100644 --- a/website/usageExamples/StandardExceptionExample_post.jpage +++ b/website/usageExamples/StandardExceptionExample_post.jpage @@ -1,16 +1,18 @@ public class ExampleException extends Exception { public ExampleException() { + this(null, null); } public ExampleException(String message) { - super(message); + this(message, null); } public ExampleException(Throwable cause) { - super(cause); + this(cause != null ? cause.getMessage() : null, cause); } public ExampleException(String message, Throwable cause) { - super(message, cause); + super(message); + if (cause != null) super.initCause(cause); } }
\ No newline at end of file |