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

Unnecessary assertions in generated @Controller code

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.1.0.M1
    • Fix Version/s: 1.1.0.M2
    • Component/s: WEB MVC
    • Labels:
      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

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

              Dates

              Created:
              Updated:
              Resolved: