2023-05-03 11:06:20 +02:00
== Why is this an issue?
2020-06-30 10:16:44 +02:00
include::../description.adoc[]
include::../noncompliant.adoc[]
include::../compliant.adoc[]
2023-05-03 11:06:20 +02:00
=== Exceptions
2020-06-30 10:16:44 +02:00
Generic exceptions in the signatures of overriding methods are ignored, because overriding method has to follow signature of the throw declaration in the superclass. The issue will be raised on superclass declaration of the method (or won't be raised at all if superclass is not part of the analysis).
2020-06-30 14:49:38 +02:00
2020-06-30 10:16:44 +02:00
----
@Override
public void myMethod() throws Exception {...}
----
Generic exceptions are also ignored in the signatures of methods that make calls to methods that throw generic exceptions.
2020-06-30 14:49:38 +02:00
2020-06-30 10:16:44 +02:00
----
public void myOtherMethod throws Exception {
doTheThing(); // this method throws Exception
}
----
2023-05-03 11:06:20 +02:00
== Resources
2021-09-21 15:40:35 +02:00
2022-04-07 08:53:59 -05:00
* https://cwe.mitre.org/data/definitions/397[MITRE, CWE-397] - Declaration of Throws for Generic Exception
2021-09-21 15:40:35 +02:00
* https://wiki.sei.cmu.edu/confluence/x/_DdGBQ[CERT, ERR07-J.] - Do not throw RuntimeException, Exception, or Throwable
2021-06-02 20:44:38 +02:00
2021-06-03 09:05:38 +02:00
ifdef::env-github,rspecator-view[]
2021-09-20 15:38:42 +02:00
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
2021-06-08 15:52:13 +02:00
'''
2021-06-02 20:44:38 +02:00
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
2021-06-03 09:05:38 +02:00
endif::env-github,rspecator-view[]