[armedbear-cvs] r12364 - in branches/0.18.x/abcl: . nbproject src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Mon Jan 11 20:49:45 UTC 2010


Author: ehuelsmann
Date: Mon Jan 11 15:49:44 2010
New Revision: 12364

Log:
Backport r12350 upto 12355 and 12359:
 fixes to recently added functionality (attempt 2).

Modified:
   branches/0.18.x/abcl/CHANGES
   branches/0.18.x/abcl/nbproject/project.properties
   branches/0.18.x/abcl/netbeans-build.xml
   branches/0.18.x/abcl/src/org/armedbear/lisp/AutoloadedFunctionProxy.java
   branches/0.18.x/abcl/src/org/armedbear/lisp/Java.java
   branches/0.18.x/abcl/src/org/armedbear/lisp/JavaObject.java

Modified: branches/0.18.x/abcl/CHANGES
==============================================================================
--- branches/0.18.x/abcl/CHANGES	(original)
+++ branches/0.18.x/abcl/CHANGES	Mon Jan 11 15:49:44 2010
@@ -23,6 +23,7 @@
  * Line numbers in generated java classes incorrect
  * JCALL, JNEW doesn't select best match when multiple applicable methods
  * STREAM-EXTERNAL-FORMAT always returns :DEFAULT, instead of actual format
+ * REPL no longer hangs in Netbeans 6.[578] output window
  * Lambda-list variables replaced by surrounding SYMBOL-MACROLET
 
 
@@ -30,7 +31,7 @@
 
  * LispObject does not inherit from Lisp anymore
  * Many functions declared 'final' for performance improvement
-
+ * SYSTEM:*SOURCE* FASLs for system files no longer refer to intermediate build location
 
 
 Version 0.17.0

Modified: branches/0.18.x/abcl/nbproject/project.properties
==============================================================================
--- branches/0.18.x/abcl/nbproject/project.properties	(original)
+++ branches/0.18.x/abcl/nbproject/project.properties	Mon Jan 11 15:49:44 2010
@@ -1,10 +1,11 @@
 application.title=abcl
 application.vendor=
 build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
+build.classes.excludes=**/*.java,**/*.form,**/*.lisp
 # This directory is removed when the project is cleaned:
 build.dir=build
 build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
 # Only compile against the classpath explicitly listed here:
 build.sysclasspath=ignore
 build.test.classes.dir=${build.dir}/test/classes
@@ -43,6 +44,7 @@
 javadoc.use=true
 javadoc.version=false
 javadoc.windowtitle=
+jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
 jnlp.codebase.type=local
 jnlp.codebase.url=file:/Users/evenson/work/abcl/dist/
 jnlp.enabled=false

Modified: branches/0.18.x/abcl/netbeans-build.xml
==============================================================================
--- branches/0.18.x/abcl/netbeans-build.xml	(original)
+++ branches/0.18.x/abcl/netbeans-build.xml	Mon Jan 11 15:49:44 2010
@@ -7,20 +7,7 @@
   <import file="nbproject/build-impl.xml"/>
 
   <target name="-post-compile">
-    <echo>build.classes.dir: ${build.classes.dir}</echo>
-      <copy todir="${build.classes.dir}">
-	<fileset dir="${basedir}/src">
-	  <patternset refid="abcl.source.lisp"/>
-	</fileset>
-      </copy>
-
-      <java classpath="${build.classes.dir}"
-	    fork="true"
-	    classname="org.armedbear.lisp.Main">
-	<arg value="--noinit"/>
-	<arg value="--eval"/>
-	<arg value="(compile-system :zip nil :quit t)"/>
-      </java>
+    <antcall target="abcl.compile.lisp"/>
   </target>
 </project>
 

Modified: branches/0.18.x/abcl/src/org/armedbear/lisp/AutoloadedFunctionProxy.java
==============================================================================
--- branches/0.18.x/abcl/src/org/armedbear/lisp/AutoloadedFunctionProxy.java	(original)
+++ branches/0.18.x/abcl/src/org/armedbear/lisp/AutoloadedFunctionProxy.java	Mon Jan 11 15:49:44 2010
@@ -34,11 +34,8 @@
 package org.armedbear.lisp;
 
 import static org.armedbear.lisp.Lisp.*;
-
 import java.util.Hashtable;
 
-
-
 public class AutoloadedFunctionProxy extends Function {
 
     public enum FunctionType
@@ -240,6 +237,7 @@
         return new JavaObject(new Hashtable());
     }
 
+    // ### proxy-preloaded-function
     final private static Primitive PROXY_PRELOADED_FUNCTION
         = new Primitive("proxy-preloaded-function", PACKAGE_SYS, false,
                         "symbol name")
@@ -284,7 +282,7 @@
       }
    };
 
-
+  //  ### function-preload
   final private static Primitive FUNCTION_PRELOAD
     = new Primitive("function-preload", PACKAGE_SYS, false, "name")
   {

Modified: branches/0.18.x/abcl/src/org/armedbear/lisp/Java.java
==============================================================================
--- branches/0.18.x/abcl/src/org/armedbear/lisp/Java.java	(original)
+++ branches/0.18.x/abcl/src/org/armedbear/lisp/Java.java	Mon Jan 11 15:49:44 2010
@@ -841,6 +841,14 @@
         return false;
     }
 
+    public static Class<?> maybeBoxClass(Class<?> clazz) {
+	if(clazz.isPrimitive()) {
+	    return getBoxedClass(clazz);
+	} else {
+	    return clazz;
+	}
+    }
+    
     private static Class<?> getBoxedClass(Class<?> clazz) {
         if (clazz.equals(int.class)) {
             return Integer.class;

Modified: branches/0.18.x/abcl/src/org/armedbear/lisp/JavaObject.java
==============================================================================
--- branches/0.18.x/abcl/src/org/armedbear/lisp/JavaObject.java	(original)
+++ branches/0.18.x/abcl/src/org/armedbear/lisp/JavaObject.java	Mon Jan 11 15:49:44 2010
@@ -47,12 +47,14 @@
 
     public JavaObject(Object obj) {
         this.obj = obj;
-	this.intendedClass = obj != null ? obj.getClass() : null;
+	this.intendedClass =
+	    obj != null ? Java.maybeBoxClass(obj.getClass()) : null;
     }
 
     /**
      * Constructs a Java Object with the given intended class, used to access
-     * the object reflectively.
+     * the object reflectively. If the class represents a primitive type,
+     * the corresponding wrapper type is used instead.
      * @throws ClassCastException if the object is not an instance of the
      *                            intended class.
      */
@@ -60,8 +62,11 @@
 	if(obj != null && intendedClass == null) {
 	    intendedClass = obj.getClass();
 	}
-	if(intendedClass != null && !intendedClass.isInstance(obj)) {
-	    throw new ClassCastException(obj + " can not be cast to " + intendedClass);
+	if(intendedClass != null) {
+	    intendedClass = Java.maybeBoxClass(intendedClass);
+	    if(!intendedClass.isInstance(obj)) {
+		throw new ClassCastException(obj + " can not be cast to " + intendedClass);
+	    }
 	}
 	this.obj = obj;
 	this.intendedClass = intendedClass;
@@ -229,13 +234,19 @@
     }
 
     @Override
-    public Object javaInstance(Class c) {
+    public Object javaInstance(Class<?> c) {
 	if(obj == null) {
-	    return obj;
-	} else if(c.isAssignableFrom(intendedClass)) {
+	    if(c.isPrimitive()) {
+		throw new NullPointerException("Cannot assign null to " + c);
+	    }
 	    return obj;
 	} else {
-	    return error(new TypeError(intendedClass.getName() + " is not assignable to " + c.getName()));
+	    c = Java.maybeBoxClass(c);
+	    if(c.isAssignableFrom(intendedClass)) {
+		return obj;
+	    } else {
+		return error(new TypeError(intendedClass.getName() + " is not assignable to " + c.getName()));
+	    }
 	}
     }
 




More information about the armedbear-cvs mailing list