File tree 1 file changed +2
-7
lines changed
java/ql/src/Advisory/Documentation
1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,14 @@ ClassOrInterface getTaggedType(ThrowsTag tag) {
16
16
result = tag .getFile ( ) .( CompilationUnit ) .getATypeInScope ( )
17
17
}
18
18
19
- predicate canThrow ( Callable callable , Class exception ) {
20
- exception instanceof UncheckedThrowableType
21
- or
22
- callable .getAnException ( ) .getType ( ) .getADescendant ( ) = exception
23
- }
24
-
25
19
// Uses ClassOrInterface as type for thrownType to also cover case where erroneously an interface
26
20
// type is declared as thrown exception
27
21
from ThrowsTag throwsTag , ClassOrInterface thrownType , Callable docMethod
28
22
where
29
23
getTaggedType ( throwsTag ) = thrownType and
30
24
docMethod .getDoc ( ) .getJavadoc ( ) .getAChild * ( ) = throwsTag and
31
- not canThrow ( docMethod , thrownType )
25
+ not thrownType instanceof UncheckedThrowableType and
26
+ not docMethod .getAnException ( ) .getType ( ) .getADescendant ( ) = thrownType
32
27
select throwsTag ,
33
28
"Javadoc for " + docMethod + " claims to throw " + thrownType .getName ( ) +
34
29
" but this is impossible."
You can’t perform that action at this time.
0 commit comments