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

Generated source code for classes extending abstract classes instantiates superclass instead of subclass for test data on demand depending on class name and top-level package name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.1.3.RELEASE
    • Fix Version/s: 1.1.4.RELEASE
    • Component/s: TESTING
    • Labels:
    • Environment:
      Windows 7

      Description

      The generated test file <classname>DataOnDemand_Roo_DataOnDemand.aj incorrectly uses the abstract superclass instead of the subclass. For instance, the method getNewTransient<classname> tries to instantiate the abstract class. The behavior varies depending on the name of the class, and also depending on the top level package name. For instance, class name OperationalEnvironment triggers this behavior, while class name AperationalEnvironment does not. (this name was used while debugging a complex data model). A similar behavior was observed with name pairs Cloud and CloudProvider. Changing the top level package name can actually reverse the behavior for these pairs of names. Sample roo script files attached for both classes.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stewarta Alan Stewart
              Reporter:
              darma Darma M
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: