I found this code in spring-boot-devtools/.../MainMethod.java

    private Method getMainMethod(StackTraceElement element) {
        try {
                    ...
        }
        catch (Exception ex) {
            // Ignore
        }
        return null;
    }

    /**
     * Returns the actual main method.
     * @return the main method
     */
    Method getMethod() {
        return this.method;
    }

  • The JavaDoc for getMethod is redundant, the @return as well as the description as stating the same?
  • Why is there a // ignore in the catch?

Comment From: wilkinsona

Both are stylistic. For example, we require the comment in the otherwise empty catch block to make it clear that swallowing the exception is intentional. We also choose to require @return for javadoc comment on methods with a non-void return type.

For future reference, this isn't really an appropriate use of Spring Boot's issue tracker. If you want to make a contribution and have questions about code style that are related to that contribution, please ask them as part of the pull request. Otherwise, we prefer to use the issue tracker solely for bugs and enhancements.