There are a number of tools that are able to analyze Java source code for erroneous code; such code is likely to work unintuitively, at best, and have serious bugs at worst.
Once all the issues a given tool raises are either resolved or the tool is configured to ignore them, we can add the tool to our CI suite to ensure we don't add any future such code.
There are a number of tools that are able to analyze Java source code for erroneous code; such code is likely to work unintuitively, at best, and have serious bugs at worst.
See this list of tools for starters.
Once all the issues a given tool raises are either resolved or the tool is configured to ignore them, we can add the tool to our CI suite to ensure we don't add any future such code.