Changeset 12364


Ignore:
Timestamp:
01/11/10 20:49:44 (11 years ago)
Author:
ehuelsmann
Message:

Backport r12350 upto 12355 and 12359:

fixes to recently added functionality (attempt 2).

Location:
branches/0.18.x/abcl
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/0.18.x/abcl/CHANGES

    r12341 r12364  
    2424 * JCALL, JNEW doesn't select best match when multiple applicable methods
    2525 * STREAM-EXTERNAL-FORMAT always returns :DEFAULT, instead of actual format
     26 * REPL no longer hangs in Netbeans 6.[578] output window
    2627 * Lambda-list variables replaced by surrounding SYMBOL-MACROLET
    2728
     
    3132 * LispObject does not inherit from Lisp anymore
    3233 * Many functions declared 'final' for performance improvement
    33 
     34 * SYSTEM:*SOURCE* FASLs for system files no longer refer to intermediate build location
    3435
    3536
  • branches/0.18.x/abcl/nbproject/project.properties

    r11538 r12364  
    22application.vendor=
    33build.classes.dir=${build.dir}/classes
    4 build.classes.excludes=**/*.java,**/*.form
     4build.classes.excludes=**/*.java,**/*.form,**/*.lisp
    55# This directory is removed when the project is cleaned:
    66build.dir=build
    77build.generated.dir=${build.dir}/generated
     8build.generated.sources.dir=${build.dir}/generated-sources
    89# Only compile against the classpath explicitly listed here:
    910build.sysclasspath=ignore
     
    4445javadoc.version=false
    4546javadoc.windowtitle=
     47jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
    4648jnlp.codebase.type=local
    4749jnlp.codebase.url=file:/Users/evenson/work/abcl/dist/
  • branches/0.18.x/abcl/netbeans-build.xml

    r11529 r12364  
    88
    99  <target name="-post-compile">
    10     <echo>build.classes.dir: ${build.classes.dir}</echo>
    11       <copy todir="${build.classes.dir}">
    12   <fileset dir="${basedir}/src">
    13     <patternset refid="abcl.source.lisp"/>
    14   </fileset>
    15       </copy>
    16 
    17       <java classpath="${build.classes.dir}"
    18       fork="true"
    19       classname="org.armedbear.lisp.Main">
    20   <arg value="--noinit"/>
    21   <arg value="--eval"/>
    22   <arg value="(compile-system :zip nil :quit t)"/>
    23       </java>
     10    <antcall target="abcl.compile.lisp"/>
    2411  </target>
    2512</project>
  • branches/0.18.x/abcl/src/org/armedbear/lisp/AutoloadedFunctionProxy.java

    r12339 r12364  
    3535
    3636import static org.armedbear.lisp.Lisp.*;
    37 
    3837import java.util.Hashtable;
    39 
    40 
    4138
    4239public class AutoloadedFunctionProxy extends Function {
     
    241238    }
    242239
     240    // ### proxy-preloaded-function
    243241    final private static Primitive PROXY_PRELOADED_FUNCTION
    244242        = new Primitive("proxy-preloaded-function", PACKAGE_SYS, false,
     
    285283   };
    286284
    287 
     285  //  ### function-preload
    288286  final private static Primitive FUNCTION_PRELOAD
    289287    = new Primitive("function-preload", PACKAGE_SYS, false, "name")
  • branches/0.18.x/abcl/src/org/armedbear/lisp/Java.java

    r12345 r12364  
    842842    }
    843843
     844    public static Class<?> maybeBoxClass(Class<?> clazz) {
     845  if(clazz.isPrimitive()) {
     846      return getBoxedClass(clazz);
     847  } else {
     848      return clazz;
     849  }
     850    }
     851   
    844852    private static Class<?> getBoxedClass(Class<?> clazz) {
    845853        if (clazz.equals(int.class)) {
  • branches/0.18.x/abcl/src/org/armedbear/lisp/JavaObject.java

    r12345 r12364  
    4848    public JavaObject(Object obj) {
    4949        this.obj = obj;
    50   this.intendedClass = obj != null ? obj.getClass() : null;
     50  this.intendedClass =
     51      obj != null ? Java.maybeBoxClass(obj.getClass()) : null;
    5152    }
    5253
    5354    /**
    5455     * Constructs a Java Object with the given intended class, used to access
    55      * the object reflectively.
     56     * the object reflectively. If the class represents a primitive type,
     57     * the corresponding wrapper type is used instead.
    5658     * @throws ClassCastException if the object is not an instance of the
    5759     *                            intended class.
     
    6163      intendedClass = obj.getClass();
    6264  }
    63   if(intendedClass != null && !intendedClass.isInstance(obj)) {
    64       throw new ClassCastException(obj + " can not be cast to " + intendedClass);
     65  if(intendedClass != null) {
     66      intendedClass = Java.maybeBoxClass(intendedClass);
     67      if(!intendedClass.isInstance(obj)) {
     68    throw new ClassCastException(obj + " can not be cast to " + intendedClass);
     69      }
    6570  }
    6671  this.obj = obj;
     
    230235
    231236    @Override
    232     public Object javaInstance(Class c) {
     237    public Object javaInstance(Class<?> c) {
    233238  if(obj == null) {
    234       return obj;
    235   } else if(c.isAssignableFrom(intendedClass)) {
     239      if(c.isPrimitive()) {
     240    throw new NullPointerException("Cannot assign null to " + c);
     241      }
    236242      return obj;
    237243  } else {
    238       return error(new TypeError(intendedClass.getName() + " is not assignable to " + c.getName()));
     244      c = Java.maybeBoxClass(c);
     245      if(c.isAssignableFrom(intendedClass)) {
     246    return obj;
     247      } else {
     248    return error(new TypeError(intendedClass.getName() + " is not assignable to " + c.getName()));
     249      }
    239250  }
    240251    }
Note: See TracChangeset for help on using the changeset viewer.