[armedbear-cvs] r14372 - branches/1.1.x/src/org/armedbear/lisp

mevenson at common-lisp.net mevenson at common-lisp.net
Wed Feb 13 19:28:12 UTC 2013


Author: mevenson
Date: Wed Feb 13 11:28:12 2013
New Revision: 14372

Log:
Backport r14363 | mevenson | 2013-01-29 09:36:14 +0100 (Tue, 29 Jan 2013) | 5 lines

Add a constructor to allow MemoryClassLoader to specify a parent.

Needed to allow the code in http://paste.lisp.org/display/134966 to work.

Patch by Milos Negovanovic.

Modified:
   branches/1.1.x/src/org/armedbear/lisp/JavaClassLoader.java
   branches/1.1.x/src/org/armedbear/lisp/MemoryClassLoader.java
   branches/1.1.x/src/org/armedbear/lisp/runtime-class.lisp

Modified: branches/1.1.x/src/org/armedbear/lisp/JavaClassLoader.java
==============================================================================
--- branches/1.1.x/src/org/armedbear/lisp/JavaClassLoader.java	Wed Feb 13 11:26:40 2013	(r14371)
+++ branches/1.1.x/src/org/armedbear/lisp/JavaClassLoader.java	Wed Feb 13 11:28:12 2013	(r14372)
@@ -123,6 +123,10 @@
     public JavaClassLoader(ClassLoader parent) {
         super(new URL[] {}, parent);
     }
+    
+    public JavaClassLoader(JavaClassLoader parent) {
+        super(new URL[] {}, (ClassLoader)parent);
+    }
 
     public JavaClassLoader(URL[] classpath, ClassLoader parent) {
         super(classpath, parent);

Modified: branches/1.1.x/src/org/armedbear/lisp/MemoryClassLoader.java
==============================================================================
--- branches/1.1.x/src/org/armedbear/lisp/MemoryClassLoader.java	Wed Feb 13 11:26:40 2013	(r14371)
+++ branches/1.1.x/src/org/armedbear/lisp/MemoryClassLoader.java	Wed Feb 13 11:28:12 2013	(r14372)
@@ -52,6 +52,11 @@
         this.internalNamePrefix = internalNamePrefix;
     }
 
+    public MemoryClassLoader(JavaClassLoader parent) {
+        super(parent);
+        this.internalNamePrefix = "";
+    }
+
     @Override
     protected Class<?> loadClass(String name, boolean resolve)
             throws ClassNotFoundException {

Modified: branches/1.1.x/src/org/armedbear/lisp/runtime-class.lisp
==============================================================================
--- branches/1.1.x/src/org/armedbear/lisp/runtime-class.lisp	Wed Feb 13 11:26:40 2013	(r14371)
+++ branches/1.1.x/src/org/armedbear/lisp/runtime-class.lisp	Wed Feb 13 11:28:12 2013	(r14372)
@@ -35,9 +35,9 @@
 
    Field definitions are lists of the form (field-name type &key modifiers annotations)."
   (declare (ignorable superclass interfaces constructors methods fields access-flags annotations))
-  (let ((stream (sys::%make-byte-array-output-stream))
-         ;;TODO provide constructor in MemoryClassLoader
-        (memory-class-loader (java:jnew "org.armedbear.lisp.MemoryClassLoader" "")))
+  (let* ((stream (sys::%make-byte-array-output-stream))
+        (current-class-loader (java:get-current-classloader))
+        (memory-class-loader (java:jnew "org.armedbear.lisp.MemoryClassLoader" current-class-loader)))
     (multiple-value-bind (class-file method-implementation-fields)
         (apply #'java::%jnew-runtime-class class-name stream args)
       (sys::put-memory-function memory-class-loader
@@ -297,4 +297,4 @@
            (list "bar" :int '("java.lang.Object")
                  (lambda (this that) (print (list this that)) 23))))
 
-(provide "RUNTIME-CLASS")
\ No newline at end of file
+(provide "RUNTIME-CLASS")




More information about the armedbear-cvs mailing list