Detect documented @throws
for (checked) exceptions that are never thrown
#610
Labels
@throws
for (checked) exceptions that are never thrown
#610
What it does
For example, one could have a javadoc like this one:
where the mentioned
InvalidArgumentException
is a checked exception. Because it has a checked exception, it must be either caught in the method or the method must be annotated with an@throws
.The implementation for this should be easy:
CtMethod
autograder/autograder-core/src/main/java/de/firemage/autograder/core/check/complexity/UnusedImport.java
Lines 111 to 124 in 0a29b0e
@throws
where one checks if it is a checked exception and if it is part of thethrows
for the method, if not, report a problem.Lint Name
DOCUMENTED_EXCEPTION_NOT_THROWN
Category
comment
Example
See above.
The text was updated successfully, but these errors were encountered: