diff options
author | Roel Spilker <r.spilker@gmail.com> | 2019-03-25 23:36:16 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2019-03-26 00:00:42 +0100 |
commit | 4e7414038ad9df25fb6d2ee76dd22421e1ff7005 (patch) | |
tree | 8ad77bb929cd0f7e5e47f410c6df4d3b4b2912b7 /website/templates/features | |
parent | e4b61e1263eb0eb832eb6cfbd97ad92e869ca27e (diff) | |
download | lombok-4e7414038ad9df25fb6d2ee76dd22421e1ff7005.tar.gz lombok-4e7414038ad9df25fb6d2ee76dd22421e1ff7005.tar.bz2 lombok-4e7414038ad9df25fb6d2ee76dd22421e1ff7005.zip |
[i2078] Add possibility to generate assert on `@NonNull`
Diffstat (limited to 'website/templates/features')
-rw-r--r-- | website/templates/features/NonNull.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/website/templates/features/NonNull.html b/website/templates/features/NonNull.html index 66ab2fc2..b09f0cda 100644 --- a/website/templates/features/NonNull.html +++ b/website/templates/features/NonNull.html @@ -21,9 +21,9 @@ <@f.confKeys> <dt> - <code>lombok.nonNull.exceptionType</code> = [<code>NullPointerException</code> | <code>IllegalArgumentException</code>] (default: <code>NullPointerException</code>). + <code>lombok.nonNull.exceptionType</code> = [<code>NullPointerException</code> | <code>IllegalArgumentException</code> | <code>Assertion</code>] (default: <code>NullPointerException</code>). </dt><dd> - When lombok generates a null-check <code>if</code> statement, by default, a <code>java.lang.NullPointerException</code> will be thrown with '<em>field name</em> is marked @NonNull but is null' as the exception message. However, you can use <code>IllegalArgumentException</code> in this configuration key to have lombok throw that exception with this message instead. + When lombok generates a null-check <code>if</code> statement, by default, a <code>java.lang.NullPointerException</code> will be thrown with '<em>field name</em> is marked @non-null but is null' as the exception message. However, you can use <code>IllegalArgumentException</code> in this configuration key to have lombok throw that exception with this message instead. By using <code>Assertion</code>, an <code>assert</code> statement with the same message will be generated. </dd><dt> <code>lombok.nonNull.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) </dt><dd> @@ -33,7 +33,7 @@ <@f.smallPrint> <p> - Lombok's detection scheme for already existing null-checks consists of scanning for if statements that look just like lombok's own. Any 'throws' statement as the 'then' part of the if statement, whether in braces or not, counts. The conditional of the if statement <em>must</em> look exactly like <code>PARAMNAME == null</code>. The first statement in your method that is not such a null-check stops the process of inspecting for null-checks. + Lombok's detection scheme for already existing null-checks consists of scanning for if statements or assert statements that look just like lombok's own. Any 'throws' statement as the 'then' part of the if statement, whether in braces or not, counts. The conditional of the if statement <em>must</em> look exactly like <code>PARAMNAME == null</code>; the assert statement <em>must</em> look exactly like <code>PARAMNAME != null</code>. The first statement in your method that is not such a null-check stops the process of inspecting for null-checks. </p><p> While <code>@Data</code> and other method-generating lombok annotations will trigger on various well-known annotations that signify the field must never be <code>@NonNull</code>, this feature only triggers on lombok's own <code>@NonNull</code> annotation from the <code>lombok</code> package. </p><p> |