Author: simonetripodi
Date: Fri Jun 24 16:42:49 2011
New Revision: 1139380
URL: http://svn.apache.org/viewvc?rev=1139380&view=rev
Log:
improved error message
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/BellmannFord.java
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/BellmannFord.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/BellmannFord.java?rev=1139380&r1=1139379&r2=1139380&view=diff
==============================================================================
---
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/BellmannFord.java
(original)
+++
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/BellmannFord.java
Fri Jun 24 16:42:49 2011
@@ -84,7 +84,8 @@ public final class BellmannFord
if ( shortDist.compareTo( shortestDistances.getWeight( v ) ) < 0 )
{
- throw new NegativeWeightedCycleException( "A negative weighted
cycle has been dected in vertex %s",
+ // TODO it would be nice printing the cycle
+ throw new NegativeWeightedCycleException( "Graph contains a
negative-weight cycle in vertex %s",
v, graph );
}
}