[
https://issues.apache.org/jira/browse/ISIS-1435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346846#comment-15346846
]
ASF subversion and git services commented on ISIS-1435:
-------------------------------------------------------
Commit e7d7ab5f3a578f7c5434e2694c2fad8f2f97a2e0 in isis's branch
refs/heads/master from [~danhaywood]
[ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=e7d7ab5 ]
ISIS-1435: fixes infinite recursion for updating()
... as demonstrated by public void updating() { setName(getName() + " -
updating"; }
We now only call the updating() callback, and also the domain event lifecycle
callback, if it hasn't previously been called. We figure that out by looking
asking the ChangedObjectsService (new API) as to whether the object was
previously changed or not (if so, then don't fire the callbacks).
> 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)