]
Edson Tirelli updated DROOLS-1543:
----------------------------------
Affects Version/s: 7.0.0.CR3
DMN ItemDefinition dependencies ordering
----------------------------------------
Key: DROOLS-1543
URL:
https://issues.jboss.org/browse/DROOLS-1543
Project: Drools
Issue Type: Bug
Components: dmn engine
Affects Versions: 7.0.0.CR3
Reporter: Matteo Mortari
Assignee: Matteo Mortari
Fix For: 7.1.0.Final
Using Java-api Comparator is not easily suitable to address the problem of ordering the
ItemDefinition by their dependencies.
If the Comparator is used to check purely for dependencies, returning 0 for indipendent
elements, assume the following:
{code:java}
X
Y -> Z
{code}
where X is independent from Y, Z; and Y depends on Z.
{code:java}
compare(X, Y) == 0 // by definition above
compare(X, Z) == 0 // still, by definition above, X is independent also from Z
compare(Y, Z) == 1 // because Y depends on Z, Y is bigger than Z.
{code}
The above breaks the API contract in the Java-API Comparator where stating:
{quote}Finally, the implementor must ensure that compare(x, y)==0 implies that
sgn(compare(x, z))==sgn(compare(y, z)) for all z.{quote}