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

Controllers register duplicate type converters, construction order dictates which wins

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.1.0.RELEASE
    • Fix Version/s: 1.1.1.RELEASE
    • Component/s: WEB MVC
    • Labels:
      None

      Description

      If I create two sets of entities:

      ObjectA >-- ObjectB
      ObjectD >-- ObjectC
      

      and push-in and modify the the converters in the ObjectAController and the ObjectDController, the changes I make in A controller will be ignored (because they are overwritten by the same converters that ObjectBController generates) but the changes I make in D controller will work just fine.

      So, every time I create a new controller that references some entity, it could, based on how it collates with the other controllers, undo any customizations I've made to the String conversion of an entity.

      In some sense, this is similar to ROO-1405 which looks like it was closed primarily because it suggested placing the default converter in the entity.

      I would propose any of the following solutions:

      1. Allow me to set registerConverters=false at a global level so that I can fully take over that process.
      2. Keep track of which converters have been generated, and don't generate and register duplicates.
      3. Generate duplicate converters, but ask the registry if that type already has a converter before registering it.
      4. Only generate and register a single converter per controller (ObjectAController registers a converter for ObjectA, ignores any referenced entities).
      5. Generate all converters into a single global file.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rstoya05-aop Rossen Stoyanchev
                Reporter:
                tommack Tom Mack
              • Votes:
                3 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: