mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
21 lines
493 B
Plaintext
21 lines
493 B
Plaintext
/**
|
|
* @id java/examples/null-argument
|
|
* @name Add null to collection
|
|
* @description Finds places where we add null to a collection
|
|
* @tags null
|
|
* parameter
|
|
* argument
|
|
* collection
|
|
* add
|
|
*/
|
|
|
|
import java
|
|
|
|
from MethodCall call, Method add
|
|
where
|
|
call.getMethod().overrides*(add) and
|
|
add.hasName("add") and
|
|
add.getDeclaringType().getSourceDeclaration().hasQualifiedName("java.util", "Collection") and
|
|
call.getAnArgument() instanceof NullLiteral
|
|
select call
|