TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - Java Coding Standard
Search

Rule:  Basic12Checked automatically with code checker

Synopsis:Avoid returning from a finally block
Language:Java
Severity Level:1
Category:Basic


Description:
Avoid returning from a finally block - this can discard exceptions.
public class Bar {
 public String foo() {
  try {
   throw new Exception( "My Exception" );
  } catch (Exception e) {
   throw e;
  } finally {
   return "A. O. K."; // Very bad.
  }
 }
}