commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1136919 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
Date Fri, 17 Jun 2011 16:10:01 GMT
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;



Mime
View raw message