Skip to content

Commit df29e05

Browse files
committed
Revert "Java: Adjust ImpossibleJavadocThrows.ql"
This reverts commit c40b628.
1 parent c1654ce commit df29e05

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

java/ql/src/Advisory/Documentation/ImpossibleJavadocThrows.ql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import java
1313

14-
ClassOrInterface getTaggedType(ThrowsTag tag) {
14+
Class getTaggedType(ThrowsTag tag) {
1515
result.hasName(tag.getExceptionName()) and
1616
result = tag.getFile().(CompilationUnit).getATypeInScope()
1717
}
@@ -22,9 +22,7 @@ predicate canThrow(Callable callable, Class exception) {
2222
callable.getAnException().getType().getADescendant() = exception
2323
}
2424

25-
// Uses ClassOrInterface as type for thrownType to also cover case where erroneously an interface
26-
// type is declared as thrown exception
27-
from ThrowsTag throwsTag, ClassOrInterface thrownType, Callable docMethod
25+
from ThrowsTag throwsTag, Class thrownType, Callable docMethod
2826
where
2927
getTaggedType(throwsTag) = thrownType and
3028
docMethod.getDoc().getJavadoc().getAChild*() = throwsTag and
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
| ImpossibleJavadocThrows.java:9:5:9:12 | @throws | Javadoc for bad1 claims to throw InterruptedException but this is impossible. |
22
| ImpossibleJavadocThrows.java:16:5:16:15 | @exception | Javadoc for bad2 claims to throw Exception but this is impossible. |
3-
| ImpossibleJavadocThrows.java:23:5:23:12 | @throws | Javadoc for bad3 claims to throw Runnable but this is impossible. |

java/ql/test/query-tests/Javadoc/ImpossibleJavadocThrows.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ public void bad1() {
1818
public void bad2() {
1919
}
2020

21-
/**
22-
*
23-
* @throws Runnable
24-
*/
25-
public void bad3() {
26-
}
27-
2821
/**
2922
*
3023
* @throws InterruptedException

0 commit comments

Comments
 (0)