From 76fd5c0b5f77d4565c9eb0439464bb3b0d3fd6aa Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Fri, 31 Mar 2017 14:34:43 +0000 Subject: [PATCH] N.450 Impact analysis : missing edges (and redundancy) when two classes impact a given class and both relations use the same neighbour id (and if redundancy is enabled over both relations) SVN:trunk[4642] --- core/relationgraph.class.inc.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/core/relationgraph.class.inc.php b/core/relationgraph.class.inc.php index 37639538a..68f2cdd73 100644 --- a/core/relationgraph.class.inc.php +++ b/core/relationgraph.class.inc.php @@ -1,5 +1,5 @@ GetKey(); + return 'redundancy-'.$sRelCode.'-'.get_class($oSourceObject).'-'.$sNeighbourId.'-'.get_class($oSinkObject).'::'.$oSinkObject->GetKey(); } /** @@ -326,7 +326,7 @@ class RelationGraph extends SimpleGraph $this->AddRelatedObjects($sRelCode, false, $oSinkNode, $iMaxDepth, $bEnableRedundancy); //echo "
After processing of {$oSinkNode->GetId()}
\n".$this->DumpAsHtmlImage()."
\n"; } - + // Mark also the "context" nodes as reached and record the "root causes" for each node $oIterator = new RelationTypeIterator($this, 'Node'); foreach($oIterator as $oNode) @@ -407,11 +407,11 @@ class RelationGraph extends SimpleGraph do { set_time_limit($iLoopTimeLimit); - + $sObjectRef = RelationObjectNode::MakeId($oRelatedObj); $oRelatedNode = $this->GetNode($sObjectRef); if (is_null($oRelatedNode)) - { + { $oRelatedNode = new RelationObjectNode($this, $oRelatedObj); } $oSourceNode = $bDown ? $oObjectNode : $oRelatedNode; @@ -449,8 +449,7 @@ class RelationGraph extends SimpleGraph $oObject = $oToNode->GetProperty('object'); if ($this->IsRedundancyEnabled($sRelCode, $aQueryInfo, $oToNode)) { - - $sId = RelationRedundancyNode::MakeId($sRelCode, $aQueryInfo['sNeighbour'], $oToNode->GetProperty('object')); + $sId = RelationRedundancyNode::MakeId($sRelCode, $aQueryInfo['sNeighbour'], $oFromNode->GetProperty('object'), $oToNode->GetProperty('object')); $oRedundancyNode = $this->GetNode($sId); if (is_null($oRedundancyNode))