diff --git a/common/source/java/ch/systemsx/cisd/common/collection/GroupingDAG.java b/common/source/java/ch/systemsx/cisd/common/collection/GroupingDAG.java index 8b4714f271139836f5e411d3d9b8d9148f9fb5f2..a68d45b5039997a784b4ba08beab275c2f0dc0fa 100644 --- a/common/source/java/ch/systemsx/cisd/common/collection/GroupingDAG.java +++ b/common/source/java/ch/systemsx/cisd/common/collection/GroupingDAG.java @@ -152,7 +152,6 @@ public class GroupingDAG<T> } } - // because the implementation of the priority queue does not allow to change priorities of items // in the queue, instead we insert the same items several times. // if the dependency count of the item is -1 - it means, that we have already used it @@ -169,7 +168,10 @@ public class GroupingDAG<T> if (peekCount() > 0) { - throw new UserFailureException("Circular dependency found!"); + T cycleRoot = queue.peek().item; + Collection<T> cycle = graph.get(queue.peek().item); + throw new UserFailureException("" + cycleRoot + + " depends on itself. Dependency chain : " + cycleRoot + " -> " + cycle); } while (false == queue.isEmpty() && peekCount() <= 0)