harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r432366 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/net/URI.java test/java/tests/api/java/net/URITest.java
Date Thu, 17 Aug 2006 19:52:33 GMT
Author: tellison
Date: Thu Aug 17 12:52:33 2006
New Revision: 432366

URL: http://svn.apache.org/viewvc?rev=432366&view=rev
Log:
Apply patch HARMONY-1119 ([classlib][net] unexpected URISyntaxException for new URI.getAuthority())

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URI.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URI.java?rev=432366&r1=432365&r2=432366&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URI.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URI.java
Thu Aug 17 12:52:33 2006
@@ -101,6 +101,10 @@
 			String path, String query, String fragment)
 			throws URISyntaxException {
 
+		if (scheme == null && userinfo == null && host == null &&
+				path == null && query == null && fragment == null)
+			return;
+
 		if (scheme != null && path != null && path.length() > 0
 				&& path.charAt(0) != '/') {
 			throw new URISyntaxException(path, Msg.getString("K0302"));

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URITest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URITest.java?rev=432366&r1=432365&r2=432366&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URITest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URITest.java
Thu Aug 17 12:52:33 2006
@@ -734,7 +734,7 @@
 	/**
 	 * @tests java.net.URI#getAuthority()
 	 */
-	public void test_getAuthority() {
+	public void test_getAuthority() throws Exception {
 		URI[] uris = getUris();
 
 		String[] getAuthorityResults = {
@@ -759,6 +759,8 @@
 				fail("Unexpected " + e.toString());
 			}
 		}
+		//regression test for HARMONY-1119
+		assertNull(new URI(null, null, null, 127, null, null, null).getAuthority());
 	}
 
 	/**



Mime
View raw message