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

mevenson at common-lisp.net mevenson at common-lisp.net
Tue Nov 29 12:25:12 UTC 2011


Author: mevenson
Date: Tue Nov 29 04:25:08 2011
New Revision: 13700

Log:
weblogic:  ABCL loads under the Weblogic 10.3 application server.

If the Pathname parsing try to parse a URI but get an empty authority,
don't push the values to the HOST element.  Addtionally warn if we
parse a null authority via the Debug.trace() facility.

Weblogic uses the "zip" scheme which more or less maps to ABCL's
nesting of "file" within "jar".  This patch doesn't systematically
follow the logical consequences of that disinction, but it does allow
ABCL to load its own fasls under weblogic-10.3.  The right thing will
be to establish some sort of ability to run the ABCL tests inside of
various application server containers, but that will take a fair amount of resources.

Modified:
   trunk/abcl/src/org/armedbear/lisp/Debug.java
   trunk/abcl/src/org/armedbear/lisp/Load.java
   trunk/abcl/src/org/armedbear/lisp/Pathname.java

Modified: trunk/abcl/src/org/armedbear/lisp/Debug.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Debug.java	Wed Nov 23 23:09:48 2011	(r13699)
+++ trunk/abcl/src/org/armedbear/lisp/Debug.java	Tue Nov 29 04:25:08 2011	(r13700)
@@ -34,6 +34,8 @@
 package org.armedbear.lisp;
 
 import static org.armedbear.lisp.Lisp.*;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 
 public final class Debug
 {
@@ -44,10 +46,34 @@
             String msg = "ABCL Debug.assertTrue() assertion failed!";
             System.err.println(msg);
             Error e = new Error(msg);
-            e.printStackTrace();
-            throw e;
+            e.printStackTrace(System.err);
+	    
+	    StringBuffer buffer = new StringBuffer();
+	    final String CR = "\n";
+	    buffer.append(msg).append(CR);
+	    StackTraceElement[] stack = e.getStackTrace();
+	    for (int i = 0; i < stack.length; i++) {
+		buffer.append(stack[i].toString()).append(CR);
+	    }
+            throw new Error(buffer.toString());
         }
     }
+    public static final void assertViolation(String msg) {
+	final String m = "Assert violation: " + msg;
+	Error e = new Error(m);
+
+	System.err.println(m);
+	e.printStackTrace(System.err);
+
+	StringBuffer buffer = new StringBuffer();
+	final String CR = "\n";
+	buffer.append(msg).append(CR);
+	StackTraceElement[] stack = e.getStackTrace();
+	for (int i = 0; i < stack.length; i++) {
+	    buffer.append(stack[i].toString()).append(CR);
+	}
+	throw new Error(buffer.toString());
+    }
 
     // Does not throw an exception.
     public static void bug()

Modified: trunk/abcl/src/org/armedbear/lisp/Load.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Load.java	Wed Nov 23 23:09:48 2011	(r13699)
+++ trunk/abcl/src/org/armedbear/lisp/Load.java	Tue Nov 29 04:25:08 2011	(r13700)
@@ -157,6 +157,9 @@
             if (n.startsWith("jar:")) {
                 n = "jar:" + n + "!/" + name + "."
                     + COMPILE_FILE_INIT_FASL_TYPE;
+	    } else if (n.startsWith("zip:")) {
+                n = "zip:" + n + "!/" + name + "."
+                    + COMPILE_FILE_INIT_FASL_TYPE;
             } else {
                 n = "jar:file:" + Pathname.uriEncode(n) + "!/" + name + "."
                     + COMPILE_FILE_INIT_FASL_TYPE;
@@ -177,9 +180,9 @@
                 } else {
                   String errorMessage
                       = "Loadable FASL not found for "
-                      + "'" + pathname + "'"
+                      + "'" + pathname.printObject() + "'"
                       + " in "
-                      + "'" + mergedPathname + "'";
+                      + "'" + mergedPathname.printObject() + "'";
                   if (ifDoesNotExist) {
                       return error(new FileError(errorMessage, mergedPathname));
                   } else {

Modified: trunk/abcl/src/org/armedbear/lisp/Pathname.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Pathname.java	Wed Nov 23 23:09:48 2011	(r13699)
+++ trunk/abcl/src/org/armedbear/lisp/Pathname.java	Tue Nov 29 04:25:08 2011	(r13700)
@@ -43,6 +43,7 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLConnection;
+import java.text.MessageFormat;
 import java.util.Enumeration;
 import java.util.StringTokenizer;
 import java.util.zip.ZipEntry;
@@ -401,13 +402,22 @@
                                     + " because: " + e));
             }
             String authority = uri.getAuthority();
-            Debug.assertTrue(authority != null);
+	    if (authority == null) {
+		authority = url.getAuthority();
+		if (authority == null) {
+		    Debug.trace(MessageFormat.format("{0} has a null authority.",
+						     url));
+		}
+	    }
 
             host = NIL;
             host = host.push(SCHEME);
             host = host.push(new SimpleString(scheme));
-            host = host.push(AUTHORITY);
-            host = host.push(new SimpleString(authority));
+
+	    if (authority != null) {
+		host = host.push(AUTHORITY);
+		host = host.push(new SimpleString(authority));
+	    }
 
             device = NIL;
             




More information about the armedbear-cvs mailing list