Add Null to Collection

Author: Semmle LGTM

import java

from MethodAccess 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

Description

Finds places where we add null to a collection