Files
codeql/java/ql/examples/snippets/throw_exception.ql
2019-08-02 15:27:28 +02:00

14 lines
391 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().getASupertype*().hasQualifiedName("com.example", "AnException")
select throw, "Don't throw com.example.AnException"