Rule Definition
As the name suggests, code in a finally block is always executed last, after all other code in a corresponding try-catch block has been executed. It often involves freeing or releasing shared resources such as sockets, CORBA objects, database connections, files, and performing other clean-up operations. Empty finally blocks are of no use and may indicate that a particular processing that must always occur prior to completing a method or block of code in a method has not been written and thus can lead to memory or resources leaks. Moreover, an empty finally block prevents the JIT from optimizing the code block.
Related Technologies
Technical Criterion
Programming Practices - Error and Exception Handling
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.