harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r738561 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/net/URI.java test/api/common/org/apache/harmony/luni/tests/java/net/URITest.java
Date Wed, 28 Jan 2009 17:31:57 GMT
Author: tellison
Date: Wed Jan 28 17:31:55 2009
New Revision: 738561

URL: http://svn.apache.org/viewvc?rev=738561&view=rev
Log:
Apply patch for HARMONY-6075 ([eut][classlib][luni] - URI returned by URI.relativize(URI)
should set SchemeSpecificPart)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URI.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URITest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URI.java?rev=738561&r1=738560&r2=738561&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URI.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URI.java Wed Jan 28
17:31:55 2009
@@ -1321,6 +1321,7 @@
         result.query = relative.query;
         // the result URI is the remainder of the relative URI's path
         result.path = relativePath.substring(thisPath.length());
+        result.setSchemeSpecificPart();
         return result;
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URITest.java?rev=738561&r1=738560&r2=738561&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URITest.java
Wed Jan 28 17:31:55 2009
@@ -1612,6 +1612,17 @@
                 "file:///~/first"), b.relativize(a));
     }
 
+    // Regression test for HARMONY-6075
+    public void test_relativize3() throws Exception {
+        URI uri = new URI("file", null, "/test/location", null);
+
+        URI base = new URI("file", null, "/test", null);
+
+        URI relative = base.relativize(uri);
+        assertEquals("location", relative.getSchemeSpecificPart());
+        assertNull(relative.getScheme());
+    }
+
     /**
      * @tests java.net.URI#relativize(java.net.URI)
      */



Mime
View raw message