commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1135844 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java
Date Tue, 14 Jun 2011 23:18:10 GMT
Author: simonetripodi
Date: Tue Jun 14 23:18:10 2011
New Revision: 1135844

URL: http://svn.apache.org/viewvc?rev=1135844&view=rev
Log:
even if source/target should be part of the Vertices set, better using the equals() operator
instead of the reference comparison (immane 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=1135844&r1=1135843&r2=1135844&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
Tue Jun 14 23:18:10 2011
@@ -79,7 +79,7 @@ public final class Dijkstra
             assert !settledNodes.contains( vertex );
 
             // destination reached, stop and build the path
-            if ( target == vertex )
+            if ( target.equals( vertex ) )
             {
                 InMemoryPath<V, WE> path = new InMemoryPath<V, WE>( source, target,
shortestDistances.get( target ) );
 



Mime
View raw message