We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f40fe71 commit 0f73bcbCopy full SHA for 0f73bcb
codeql-custom-queries-java/queries/api-misuse/throw-null-literal.ql
@@ -5,6 +5,10 @@
5
* For clarity it would be better to explicitly create a `NullPointerException`
6
* and possibly provide a meaningful message to its constructor.
7
*
8
+ * The "helpful `NullPointerException`" feature ([JEP-358](https://openjdk.org/jeps/358))
9
+ * makes it even clearer that `throw null` is not the intended usage:
10
+ * > NullPointerException: Cannot throw exception because "null" is null
11
+ *
12
* See also Error Prone pattern [ThrowNull](https://errorprone.info/bugpattern/ThrowNull).
13
14
* @kind problem
0 commit comments