[jboss-jira] [JBoss JIRA] (DROOLS-1543) DMN ItemDefinition dependencies ordering
Matteo Mortari (JIRA)
issues at jboss.org
Tue May 2 07:21:00 EDT 2017
Matteo Mortari created DROOLS-1543:
--------------------------------------
Summary: DMN ItemDefinition dependencies ordering
Key: DROOLS-1543
URL: https://issues.jboss.org/browse/DROOLS-1543
Project: Drools
Issue Type: Bug
Reporter: Matteo Mortari
Assignee: Matteo Mortari
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}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list