commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1240522 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/RevertedGraph.java
Date Sat, 04 Feb 2012 15:34:55 GMT
Author: simonetripodi
Date: Sat Feb  4 15:34:54 2012
New Revision: 1240522

URL: http://svn.apache.org/viewvc?rev=1240522&view=rev
Log:
use shortcuts to check non-null arguments

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/RevertedGraph.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/RevertedGraph.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/RevertedGraph.java?rev=1240522&r1=1240521&r2=1240522&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/RevertedGraph.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/RevertedGraph.java
Sat Feb  4 15:34:54 2012
@@ -19,6 +19,8 @@ package org.apache.commons.graph.model;
  * under the License.
  */
 
+import static org.apache.commons.graph.utils.Assertions.checkNotNull;
+
 import org.apache.commons.graph.DirectedGraph;
 import org.apache.commons.graph.Edge;
 import org.apache.commons.graph.Vertex;
@@ -51,11 +53,7 @@ public final class RevertedGraph<V exten
      */
     public RevertedGraph( DirectedGraph<V, E> directedGraph )
     {
-        if ( directedGraph == null )
-        {
-            throw new IllegalArgumentException( "Adapted DirectedGraph must be not null"
);
-        }
-
+        directedGraph = checkNotNull( directedGraph, "Adapted DirectedGraph must be not null"
);
         this.directedGraph = directedGraph;
     }
 



Mime
View raw message