Hope to warn the code in try..catch that uses Exception directly

    public static void main(String[] args) {
        try {
            new TestService().testService();
        } catch (Exception e) {
            // The Exception is used directly in try .. catch here,
            // and in fact there will never be a Exception (compiled exception). 
            // there should be a warning here.
        }
    }

    public void testService() {
        // This method does not throw an Exception (compilation type exception)
        throw new IllegalArgumentException("IllegalArgument")
    }

In short, runtime exceptions should be used when there is no compiled exception

Hey there.

It’s not clear what you’re asking. Do you expect that an existing rule will raise an issue on this code? Are you suggesting a new rule?