You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/06/15 08:41:54 UTC

svn commit: r1135931 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java

Author: simonetripodi
Date: Wed Jun 15 06:41:54 2011
New Revision: 1135931

URL: http://svn.apache.org/viewvc?rev=1135931&view=rev
Log:
even if source/target should be part of the Vertices set, better using the equals() operator instead of the reference comparison (imagine a scenario where nodes are retrieved from a remote JVM...)

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java?rev=1135931&r1=1135930&r2=1135931&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java Wed Jun 15 06:41:54 2011
@@ -84,7 +84,7 @@ public final class Dijkstra
                 InMemoryPath<V, WE> path = new InMemoryPath<V, WE>( source, target, shortestDistances.get( target ) );
 
                 V v = target;
-                while ( v != source )
+                while ( !v.equals( source ) )
                 {
                     WE edge = predecessors.get( v );