harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r648709 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/org/apache/harmony/luni/internal/net/www/protocol/file/ test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/file/
Date Wed, 16 Apr 2008 14:35:48 GMT
Author: tonywu
Date: Wed Apr 16 07:35:38 2008
New Revision: 648709

URL: http://svn.apache.org/viewvc?rev=648709&view=rev
Log:
Apply patch for HARMONY-5737 ([classlib][luni]FileURLConnection.connect fails in presence
of anchor's)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/file/FileURLConnection.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/file/FileURLConnectionTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/file/FileURLConnection.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/file/FileURLConnection.java?rev=648709&r1=648708&r2=648709&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/file/FileURLConnection.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/file/FileURLConnection.java
Wed Apr 16 07:35:38 2008
@@ -59,9 +59,6 @@
     public FileURLConnection(URL url) {
         super(url);
         fileName = url.getFile();
-        if (url.getRef() != null) {
-            fileName += "#" + url.getRef(); //$NON-NLS-1$
-        }
         if (fileName == null) {
             fileName = ""; //$NON-NLS-1$
         }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/file/FileURLConnectionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/file/FileURLConnectionTest.java?rev=648709&r1=648708&r2=648709&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/file/FileURLConnectionTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/file/FileURLConnectionTest.java
Wed Apr 16 07:35:38 2008
@@ -45,4 +45,15 @@
         assertEquals("application/xml", getContentType("test.xml"));
         assertEquals("text/plain", getContentType("."));
     }
+    
+    public void testGetInputStream() throws IOException {
+        // Regression for Harmony-5737
+        String resourceName = "org/apache/harmony/luni/tests/" + "test.rtf";
+        URL url = ClassLoader.getSystemClassLoader().getResource(resourceName);
+        URL anchorUrl = new URL(url,"#anchor");
+        assertNotNull("Cannot find test resource " + resourceName, anchorUrl);
+        
+        FileURLConnection conn = new FileURLConnection(anchorUrl);
+        assertNotNull(conn.getInputStream());
+    }
 }



Mime
View raw message