Files
codeql/java/ql/examples/snippets/throw_exception.ql
2022-02-21 17:05:00 +00:00

14 lines
390 B
Plaintext

/**
* @id java/examples/throw-exception
* @name Throw exception of type
* @description Finds places where we throw com.example.AnException or one of its subtypes
* @tags throw
* exception
*/
import java
from ThrowStmt throw
where throw.getThrownExceptionType().getAnAncestor().hasQualifiedName("com.example", "AnException")
select throw, "Don't throw com.example.AnException"