Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

According to the Java API [API 2006], class Thread:

[Thread.stop()] may be used to generate exceptions that its target thread is unprepared to handle (including checked exceptions that the thread could not possibly throw, were it not for this method). For example, the following method is behaviorally identical to Java's throw operation, but circumvents the compiler's attempts to guarantee that the calling method has declared all of the checked exceptions that it may throw.

...

It is also possible to disassemble a class, remove any declared checked exceptions, and reassemble the class so that checked exceptions are thrown at runtime when the class is used [Roubtsov 2003]. Compiling against a class that declares the checked exception and supplying at runtime a class that lacks the declaration can also result in undeclared checked exceptions. Undeclared checked exceptions can also be produced through crafted use of the sun.corba.Bridge class. All these practices are violations of this rule.

...

MITRE CWE

CWE-703. Improper check or handling of exceptional conditions

 

CWE-248. Uncaught exception

Bibliography

[Bloch 2008]

Item 2. Consider a builder when faced with many constructor parameters

[Goetz 2004b]

 

[JLS 2005]

Chapter 11, Exceptions

[Roubtsov 2003]

 

[Schwarz 2004]

 

[Venners 2003]

Scalability of Checked Exceptions

...

      Rule 07: Exceptional Behavior (ERR)Image Added