Revert "Java: Adjust ImpossibleJavadocThrows.ql"

This reverts commit c40b6285a2.
This commit is contained in:
Tony Torralba
2022-10-04 10:59:39 +02:00
parent c1654ce7cc
commit df29e05b9f
3 changed files with 2 additions and 12 deletions

View File

@@ -11,7 +11,7 @@
import java
ClassOrInterface getTaggedType(ThrowsTag tag) {
Class getTaggedType(ThrowsTag tag) {
result.hasName(tag.getExceptionName()) and
result = tag.getFile().(CompilationUnit).getATypeInScope()
}
@@ -22,9 +22,7 @@ predicate canThrow(Callable callable, Class exception) {
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
from ThrowsTag throwsTag, Class thrownType, Callable docMethod
where
getTaggedType(throwsTag) = thrownType and
docMethod.getDoc().getJavadoc().getAChild*() = throwsTag and