My project, for current use, uses a private access modifier for the methods of MVC controllers:
@Controller public class HelloWorldController { @RequestMapping("/helloWorld") private ModelAndView helloWorld() {
I have included PMD, and in his report a lot:
/src/main/java/com/web/controller/SignalController.java:91: Avoid unused private methods such as 'handleNewRequest()'.
Therefore, instead of disabling the useful PMD rule, I think that you can use public to change the visibility of control methods.
Are there any reasons to keep the controller methods private ?
source share