Author: simonetripodi
Date: Fri Jun 17 16:10:01 2011
New Revision: 1136919

URL: http://svn.apache.org/viewvc?rev=1136919&view=rev
Log:
checked ctor arguments are not null

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=1136919&r1=1136918&r2=1136919&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
 Fri Jun 17 16:10:01 2011
@@ -52,6 +52,19 @@ public final class InMemoryPath<V extend
 
     public InMemoryPath( V start, V end, Double weigth )
     {
+        if ( start == null )
+        {
+            throw new IllegalArgumentException( "Path source cannot be null" );
+        }
+        if ( end == null )
+        {
+            throw new IllegalArgumentException( "Path end cannot be null" );
+        }
+        if ( weigth == null )
+        {
+            throw new IllegalArgumentException( "Path weigth cannot be null" );
+        }
+
         this.source = start;
         this.target = end;
         this.weigth = weigth;


Reply via email to