[armedbear-cvs] r12352 - trunk/abcl/src/org/armedbear/lisp

Alessio Stalla astalla at common-lisp.net
Fri Jan 8 21:32:02 UTC 2010


Author: astalla
Date: Fri Jan  8 16:32:02 2010
New Revision: 12352

Log:
Have JavaObject.javaInstance(c) complain if the wrapped object is null and c is a primitive type.


Modified:
   trunk/abcl/src/org/armedbear/lisp/JavaObject.java

Modified: trunk/abcl/src/org/armedbear/lisp/JavaObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/JavaObject.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/JavaObject.java	Fri Jan  8 16:32:02 2010
@@ -236,6 +236,9 @@
     @Override
     public Object javaInstance(Class c) {
 	if(obj == null) {
+	    if(c.isPrimitive()) {
+		throw new NullPointerException("Cannot assign null to " + c);
+	    }
 	    return obj;
 	} else {
 	    c = Java.maybeBoxClass(c);




More information about the armedbear-cvs mailing list