mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Java: Adjust ImpossibleJavadocThrows.ql
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
import java
|
||||
|
||||
Class getTaggedType(ThrowsTag tag) {
|
||||
ClassOrInterface getTaggedType(ThrowsTag tag) {
|
||||
result.hasName(tag.getExceptionName()) and
|
||||
result = tag.getFile().(CompilationUnit).getATypeInScope()
|
||||
}
|
||||
@@ -22,7 +22,9 @@ predicate canThrow(Callable callable, Class exception) {
|
||||
callable.getAnException().getType().getADescendant() = exception
|
||||
}
|
||||
|
||||
from ThrowsTag throwsTag, Class thrownType, Callable docMethod
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user