Author: simonetripodi
Date: Sun Jul 3 09:05:07 2011
New Revision: 1142406
URL: http://svn.apache.org/viewvc?rev=1142406&view=rev
Log:
added missing target in the path
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java?rev=1142406&r1=1142405&r2=1142406&view=diff
==============================================================================
---
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
(original)
+++
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
Sun Jul 3 09:05:07 2011
@@ -107,8 +107,14 @@ public class InMemoryPath<V extends Vert
public void addConnectionInHead( V head, E edge, V tail )
{
+ if ( target.equals( tail ) )
+ {
+ vertices.addFirst( tail );
+ }
+
vertices.addFirst( head );
edges.addFirst( edge );
+
addConnection( head, edge, tail );
}
@@ -116,6 +122,12 @@ public class InMemoryPath<V extends Vert
{
vertices.addLast( head );
edges.addLast( edge );
+
+ if ( target.equals( tail ) )
+ {
+ vertices.addLast( tail );
+ }
+
addConnection( head, edge, tail );
}