commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r828060 - /commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Path.java
Date Wed, 21 Oct 2009 15:40:33 GMT
Author: mturk
Date: Wed Oct 21 15:40:33 2009
New Revision: 828060

URL: http://svn.apache.org/viewvc?rev=828060&view=rev
Log:
Allow null parents

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Path.java

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Path.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Path.java?rev=828060&r1=828059&r2=828060&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Path.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Path.java Wed
Oct 21 15:40:33 2009
@@ -147,9 +147,12 @@
     public Path(String parent, String child)
         throws NullPointerException, IllegalArgumentException
     {
-        if (parent == null || child == null)
+        if (child == null)
             throw new NullPointerException();
-        path = merge(parent, child, true);
+        if (parent == null)
+            path = normal(child);
+        else
+            path = merge(parent, child, true);
     }
 
     /**
@@ -179,9 +182,12 @@
     public Path(Path parent, String child)
         throws NullPointerException, IllegalArgumentException
     {
-        if (parent == null || child == null)
+        if (child == null)
             throw new NullPointerException();
-        path = merge(parent.path, child, false);
+        if (parent == null)
+            path = normal(child);
+        else
+            path = merge(parent.path, child, false);
     }
 
     /**



Mime
View raw message