[
https://issues.apache.org/jira/browse/ISIS-1435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346895#comment-15346895
]
Dan Haywood commented on ISIS-1435:
-----------------------------------
Thanks for providing this detailed example of how to reproduce.
I've fixed this by ensuring that updating() callback is only ever called once.
It's possible that there are other cases, with other lifecycle events, that
might trigger similar infinite loops. eg, what might happen if an inserted()
triggered a deleting() which then called an updating() that then did another
inserted() etc. But I'd rather fix this particular use case in a relatively
simple fashion, than try to consider every other possible use case which may or
may not arise.
> Infitinite recursion in updating() callback if it modifies the object
> ---------------------------------------------------------------------
>
> Key: ISIS-1435
> URL: https://issues.apache.org/jira/browse/ISIS-1435
> Project: Isis
> Issue Type: Bug
> Components: Archetype: SimpleApp, Core
> Affects Versions: 1.12.2
> Reporter: Duke Yin
> Assignee: Dan Haywood
> Fix For: 1.13.0
>
>
> 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 -
> {code}
> 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
> {code}
> 2.
> Open the class:
> {code}domainapp.dom.simple.SimpleObject{code}
> and add the following code to the bottom:
> {code}
> public void updating() {
> System.out.println("updating()");
> // this.name += "-updating"; // modification directly to field
> this.setName(this.getName() + "-updating"); // modification via setter
> }
> {code}
> 3.
> Build as described on
> https://isis.apache.org/guides/ugfun.html#_building_the_app -
> {code}
> cd myapp
> mvn clean install
> {code}
> Result:
> Stack overflow in
> {code}domainapp.integtests.tests.modules.simple.SimpleObjectIntegTest$UpdateName{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)