Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-1435

Infitinite recursion in updating() callback if it modifies the object

    XMLWordPrintableJSON

Details

    Description

      I'm observing infinite recursion / stack overflow if a domain object has an updating() reserved method that updates the domain object. This is related, if not identical, to ISIS-1004.

      Steps to reproduce:

      1.
      Checkout the SimpleApp as described on https://isis.apache.org/guides/ugfun.html#_generating_the_app -

      mvn archetype:generate  \
          -D archetypeGroupId=org.apache.isis.archetype \
          -D archetypeArtifactId=simpleapp-archetype \
          -D archetypeVersion=1.12.2 \
          -D groupId=com.mycompany \
          -D artifactId=myapp \
          -D version=1.0-SNAPSHOT \
          -B
      

      2.
      Open the class:

      domainapp.dom.simple.SimpleObject

      and add the following code to the bottom:

      public void updating() {
          	System.out.println("updating()");
          	// this.name += "-updating"; // modification directly to field
          	this.setName(this.getName() + "-updating"); // modification via setter
          }
      

      3.
      Build as described on https://isis.apache.org/guides/ugfun.html#_building_the_app -

      cd myapp
      mvn clean install
      

      Result:
      Stack overflow in

      domainapp.integtests.tests.modules.simple.SimpleObjectIntegTest$UpdateName

      Attachments

        Activity

          People

            danhaywood Daniel Keir Haywood
            dukeyin Duke Yin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: