Isn't IllegalArgumentException actually more appropriate here?

There's a difference between a NPE which is typically something that
shouldn't have been null being null and an IAE which is used for when
arguments don't meet the contract of the API which was the case here.

Rob


On 7/31/13 2:23 PM, "[email protected]" <[email protected]> wrote:

>Author: sallen
>Date: Wed Jul 31 21:23:52 2013
>New Revision: 1509038
>
>URL: http://svn.apache.org/r1509038
>Log:
>Replace incorrect IllegalArgumentException with a NullPointerException
>
>Modified:
>    
>jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/request/Up
>dateWriter.java
>
>Modified: 
>jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/request/Up
>dateWriter.java
>URL: 
>http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/
>jena/sparql/modify/request/UpdateWriter.java?rev=1509038&r1=1509037&r2=150
>9038&view=diff
>==========================================================================
>====
>--- 
>jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/request/Up
>dateWriter.java (original)
>+++ 
>jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/request/Up
>dateWriter.java Wed Jul 31 21:23:52 2013
>@@ -58,7 +58,7 @@ public class UpdateWriter implements Clo
>     public UpdateWriter(IndentedWriter out, SerializationContext sCxt)
>     {
>         if (out == null)
>-            throw new IllegalArgumentException("out may not be null") ;
>+            throw new NullPointerException("out") ;
>         
>         // To get legal syntax out, the serialization context
>         // has to be a bNode mapping that does ??N vars to bNodes
>
>

Reply via email to