commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1357193 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
Date Wed, 04 Jul 2012 09:37:38 GMT
Author: simonetripodi
Date: Wed Jul  4 09:37:37 2012
New Revision: 1357193

URL: http://svn.apache.org/viewvc?rev=1357193&view=rev
Log:
use the utility method to check non null elements in add() arguments

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java?rev=1357193&r1=1357192&r2=1357193&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
Wed Jul  4 09:37:37 2012
@@ -19,6 +19,8 @@ package org.apache.commons.graph.collect
  * under the License.
  */
 
+import static org.apache.commons.graph.utils.Assertions.checkNotNull;
+
 import static java.lang.Math.floor;
 import static java.lang.Math.log;
 import static java.lang.Math.sqrt;
@@ -153,10 +155,7 @@ public final class FibonacciHeap<E>
      */
     public boolean add( E e )
     {
-        if ( e == null )
-        {
-            throw new NullPointerException();
-        }
+        checkNotNull( e, "Null elements not allowed in this FibonacciHeap implementation."
);
 
         // 1-6 performed in the node initialization
         FibonacciHeapNode<E> node = new FibonacciHeapNode<E>( e );



Mime
View raw message