]
Tom Baeyens resolved JBPM-1701.
-------------------------------
Fix Version/s: (was: jBPM 4.0)
Resolution: Rejected
in WireContext: bug when elements inside a list are referenced from
outside the list.
-------------------------------------------------------------------------------------
Key: JBPM-1701
URL:
https://jira.jboss.org/jira/browse/JBPM-1701
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Reporter: Guillaume Porcher
Priority: Minor
In this example:
public void testNamedElements() {
String contextText =
"<objects>" +
" <list name='l'>" +
" <object class='java.lang.Object' name='s'/>"
+
" </list>" +
" <ref name='r' object='s' />" +
"</objects>";
WireContext wireContext = createWireContext(contextText);
assertNotNull(wireContext.get("s"));
assertNotNull(wireContext.get("l"));
assertNotNull(wireContext.get("r"));
assertSame(wireContext.get("s"), wireContext.get("r"));
wireContext = createWireContext(contextText);
assertNotNull(wireContext.get("r"));
assertNotNull(wireContext.get("l"));
assertNotNull(wireContext.get("s"));
assertSame(wireContext.get("s"), wireContext.get("r"));
}
the last assertion fails.
If the reference is accessed first, the object s is created when the reference is
created, and then when the list is created.
If the list is created first, the reference uses the object in the list.
To fix this bug, I see 2 solutions:
- we can prevent the user from defining objects with names in lists.
- we can fix the creation of the list to check if some of the elements have already been
created.
I think the first solution is better. If an element can be shared by more than one
entity, it should be defined outside of all the entities and the entities should use
ObjectReferences to access the shared element.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: