Throw exception of type

Author: Semmle LGTM

import java

from ThrowStmt throw
where throw.getThrownExceptionType().getAnAncestor().hasQualifiedName('com.example', 'AnException')
select throw, 'Don't throw com.example.AnException'

Description

Finds places where we throw com.example.AnException or one of its subtypes