mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Revert "Java: Fix cartesian product"
This commit is contained in:
@@ -16,14 +16,19 @@ ClassOrInterface getTaggedType(ThrowsTag tag) {
|
||||
result = tag.getFile().(CompilationUnit).getATypeInScope()
|
||||
}
|
||||
|
||||
predicate canThrow(Callable callable, Class exception) {
|
||||
exception instanceof UncheckedThrowableType
|
||||
or
|
||||
callable.getAnException().getType().getADescendant() = exception
|
||||
}
|
||||
|
||||
// Uses ClassOrInterface as type for thrownType to also cover case where erroneously an interface
|
||||
// type is declared as thrown exception
|
||||
from ThrowsTag throwsTag, ClassOrInterface thrownType, Callable docMethod
|
||||
where
|
||||
getTaggedType(throwsTag) = thrownType and
|
||||
docMethod.getDoc().getJavadoc().getAChild*() = throwsTag and
|
||||
not thrownType instanceof UncheckedThrowableType and
|
||||
not docMethod.getAnException().getType().getADescendant() = thrownType
|
||||
not canThrow(docMethod, thrownType)
|
||||
select throwsTag,
|
||||
"Javadoc for " + docMethod + " claims to throw " + thrownType.getName() +
|
||||
" but this is impossible."
|
||||
|
||||
Reference in New Issue
Block a user