How to find empty catch blocks in Java code
java
Solution
The Eclipse Java compiler can be configured to produce warnings (or error message) for empty statements:
Java > Compiler > Errors/Warnings > Empty statement.
You could use the batch compiler (Running the batch compiler) if you do not use eclipse.
But then you could use other Java tools as well. Using a Java library is not a sofware installation. As long as the JRE is not locked by the security manager configuration this should always work.
Problem
Is there any way to find all the empty catch blocks inside Java code? I know there are some tools like PMD to do that, but I am using RSA. Is there any way we can write a regex to search for empty catch blocks? I am working on a corporate machine, where I can't install new software.