Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-1026

Unnecessary assertions in generated @Controller code

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Complete
    • 1.1.0.M1
    • 1.1.0.M2
    • WEB MVC
    • None

    Description

      Roo currently generates null pointer assertions for @Controller method arguments e.g.:

      public String create(@Valid GreenhouseApplication greenhouseApplication, BindingResult result, ModelMap modelMap) {
      if (greenhouseApplication == null) throw new IllegalArgumentException("A greenhouseApplication is required");

      I would not recommend users write or maintain these checks. User-code does not call this method, framework code does. All the assert is doing is verifying the framework works correctly. Spring MVC has its own unit tests for that.

      Attachments

        Activity

          People

            sschmidt Stefan Schmidt
            kdonald Keith Donald
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: