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

Mark Evenson mevenson at common-lisp.net
Sun Jul 4 06:43:53 UTC 2010


Author: mevenson
Date: Sun Jul  4 02:43:52 2010
New Revision: 12780

Log:
Small non-functional code and comment cleanups.



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

Modified: trunk/abcl/src/org/armedbear/lisp/Pathname.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Pathname.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Pathname.java	Sun Jul  4 02:43:52 2010
@@ -606,8 +606,8 @@
         // the namestring." 19.2.2.2.3.1
         if (host != NIL) {
             Debug.assertTrue(host instanceof AbstractString 
-                             || host instanceof Cons);
-            if (host instanceof Cons) {
+                             || isURL());
+            if (isURL()) {
                 LispObject scheme = Symbol.GETF.execute(host, SCHEME, NIL);
                 LispObject authority = Symbol.GETF.execute(host, AUTHORITY, NIL);
                 Debug.assertTrue(scheme != NIL);
@@ -631,7 +631,7 @@
         }
         if (device == NIL) {
         } else if (device == Keyword.UNSPECIFIC) {
-        } else if (device instanceof Cons) {
+        } else if (isJar()) {
             LispObject[] jars = ((Cons) device).copyToArray();
             StringBuilder prefix = new StringBuilder();
             for (int i = 0; i < jars.length; i++) {
@@ -643,9 +643,6 @@
                 sb.append("!/");
             }
             sb = prefix.append(sb);
-        } else if (device instanceof AbstractString
-          && device.getStringValue().startsWith("jar:")) {
-            sb.append(device.getStringValue());
         } else if (device instanceof AbstractString) {
             sb.append(device.getStringValue());
             if (this instanceof LogicalPathname
@@ -723,7 +720,7 @@
             }
         }
         namestring = sb.toString();
-        // XXX Decide when this is necessary
+        // XXX Decide if this is necessary
         // if (isURL()) { 
         //     namestring = Utilities.uriEncode(namestring);
         // }
@@ -1236,7 +1233,7 @@
             namestring = file.getCanonicalPath();
         } catch (IOException e) {
             Debug.trace("Failed to make a Pathname from "
-              + "." + file + "'");
+              + "'" + file + "'");
             return null;
         }
         return new Pathname(namestring);
@@ -1290,7 +1287,7 @@
             if (host == NIL) {
                 host = defaults.host;
             }
-            if (directory == NIL && defaults != null) {
+            if (directory == NIL) {
                 directory = defaults.directory;
             }
             if (!deviceSupplied) {
@@ -2084,7 +2081,8 @@
             if (pathname.isURL()) {
                 result = new URL(pathname.getNamestring());
             } else {
-                // XXX ensure that we have cannonical path.
+                // XXX Properly encode Windows drive letters and UNC paths
+                // XXX ensure that we have cannonical path?
                 result = new URL("file://" + pathname.getNamestring());
             }
         } catch (MalformedURLException e) {




More information about the armedbear-cvs mailing list