harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r964785 - in /harmony/enhanced/java/branches/java6: ./ classlib/ classlib/depends/build/platform/ classlib/depends/libs/ classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ classlib/modules/luni/src/main/j...
Date Fri, 16 Jul 2010 12:36:25 GMT
Author: hindessm
Date: Fri Jul 16 12:36:24 2010
New Revision: 964785

URL: http://svn.apache.org/viewvc?rev=964785&view=rev
Log:
Merge changes from trunk@964765.

Modified:
    harmony/enhanced/java/branches/java6/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/depends/build/platform/zos.s390.mk
    harmony/enhanced/java/branches/java6/classlib/depends/build/platform/zos.s390x.mk
    harmony/enhanced/java/branches/java6/classlib/depends/libs/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/lang/String.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/URLStreamHandler.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/util/Scanner.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnectionImpl.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/luniglob.c
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/String2Test.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ScannerTest.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/util/UtilTest.java
    harmony/enhanced/java/branches/java6/classlib/modules/sql/src/main/java/javax/sql/rowset/spi/SyncFactory.java
    harmony/enhanced/java/branches/java6/classlib/modules/sql/src/main/java/javax/sql/rowset/spi/SyncProvider.java
    harmony/enhanced/java/branches/java6/classlib/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/FilteredRowSetTest.java
    harmony/enhanced/java/branches/java6/drlvm/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/   (props changed)

Propchange: harmony/enhanced/java/branches/java6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 16 12:36:24 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/java/branches/mrh:935751-941490
-/harmony/enhanced/java/trunk:929253-964042
+/harmony/enhanced/java/trunk:929253-964765
 /harmony/enhanced/trunk:476395-929252
 /incubator/harmony/enhanced/trunk:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 16 12:36:24 2010
@@ -1,7 +1,7 @@
 /harmony/enhanced/classlib/trunk:713674-735919,765923-926091,926318-926838
 /harmony/enhanced/classlib/trunk/working_classlib:884014-884286
 /harmony/enhanced/java/branches/mrh/classlib:935751-941490
-/harmony/enhanced/java/trunk/classlib:929253-964042
+/harmony/enhanced/java/trunk/classlib:929253-964765
 /harmony/enhanced/trunk/classlib:476395-929252
 /harmony/enhanced/trunk/working_classlib:476396-920147
 /incubator/harmony/enhanced/trunk/classlib:292550-476394

Modified: harmony/enhanced/java/branches/java6/classlib/depends/build/platform/zos.s390.mk
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/depends/build/platform/zos.s390.mk?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/depends/build/platform/zos.s390.mk (original)
+++ harmony/enhanced/java/branches/java6/classlib/depends/build/platform/zos.s390.mk Fri Jul
16 12:36:24 2010
@@ -19,7 +19,7 @@ AS = cc
 # Use cxx/c++ for c++ compiles on z/OS
 CXX = cxx
 
-DEFINES += -DZOS -DZOS_S390 -DHYS390 -DHY_ATOE
+DEFINES += -DZOS -DZOS_S390 -DHYS390 -DHY_ATOE -DIPv6_FUNCTION_SUPPORT
 PLATFORM = -Wc,xplink,convlit\(ISO8859-1\),FLOAT\(IEEE,FOLD,AFP\) -Wa,goff \
            -Wc,NOANSIALIAS -Wc,DLL,EXPORTALL
 

Modified: harmony/enhanced/java/branches/java6/classlib/depends/build/platform/zos.s390x.mk
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/depends/build/platform/zos.s390x.mk?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/depends/build/platform/zos.s390x.mk (original)
+++ harmony/enhanced/java/branches/java6/classlib/depends/build/platform/zos.s390x.mk Fri
Jul 16 12:36:24 2010
@@ -19,7 +19,7 @@ AS = cc
 # Use cxx/c++ for c++ compiles on z/OS
 CXX = cxx
 
-DEFINES += -DZOS -DZOS_S390X -DHYS390X -DHY_ATOE
+DEFINES += -DZOS -DZOS_S390X -DHYS390X -DHY_ATOE -DIPv6_FUNCTION_SUPPORT
 PLATFORM = -Wc,lp64,xplink,convlit\(ISO8859-1\),FLOAT\(IEEE,FOLD,AFP\) \
            -Wa,goff -Wc,NOANSIALIAS -Wc,DLL,EXPORTALL
 

Propchange: harmony/enhanced/java/branches/java6/classlib/depends/libs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 16 12:36:24 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/classlib/trunk/depends/libs:544451-926091
-/harmony/enhanced/java/trunk/classlib/depends/libs:929253-964042
+/harmony/enhanced/java/trunk/classlib/depends/libs:929253-964765
 /harmony/enhanced/trunk/classlib/depends/libs:476395-929252
 /incubator/harmony/enhanced/trunk/classlib/depends/libs:292550-476394

Modified: harmony/enhanced/java/branches/java6/classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
Fri Jul 16 12:36:24 2010
@@ -662,11 +662,12 @@ public class JarFileTest extends TestCas
         assertEquals("Wrong length of empty jar entry", -1, res);
     }
 
+    // Regression test for HARMONY-6384
     public void testJarWrittenWithFlush() throws IOException {
         File f = new File(resources, "hyts_flushed.jar");
         Support_Resources.copyFile(resources, null, "hyts_flushed.jar");
 
-        // Harmony crashes with ZipException: Central Directory Entry not found
+        // Used to crash with ZipException: Central Directory Entry not found
         new JarFile(f);
     }
 }

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/lang/String.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/lang/String.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/lang/String.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/lang/String.java
Fri Jul 16 12:36:24 2010
@@ -1083,9 +1083,20 @@ public final class String implements Ser
             if (start < 0) {
                 start = 0;
             }
-            for (int i = offset + start; i < offset + count; i++) {
-                if (value[i] == c) {
-                    return i - offset;
+            if (c >= 0 && c <= Character.MAX_VALUE) {
+                for (int i = offset + start; i < offset + count; i++) {
+                    if (value[i] == c) {
+                        return i - offset;
+                    }
+                }
+            } else if (c > Character.MAX_VALUE && c <= Character.MAX_CODE_POINT)
{
+                for (int i = start; i < count; i++) {
+                    int codePoint = codePointAt(i);
+                    if (codePoint == c) {
+                        return i;
+                    } else if (codePoint >= Character.MIN_SUPPLEMENTARY_CODE_POINT) {
+                        i++;
+                    }
                 }
             }
         }
@@ -1196,9 +1207,20 @@ public final class String implements Ser
             if (start >= count) {
                 start = count - 1;
             }
-            for (int i = offset + start; i >= offset; --i) {
-                if (value[i] == c) {
-                    return i - offset;
+            if (c >= 0 && c <= Character.MAX_VALUE) {
+                for (int i = offset + start; i >= offset; --i) {
+                    if (value[i] == c) {
+                        return i - offset;
+                    }
+                }
+            } else if (c > Character.MAX_VALUE && c <= Character.MAX_CODE_POINT)
{
+                for (int i = start; i >= 0; --i) {
+                    int codePoint = codePointAt(i);
+                    if (codePoint == c) {
+                        return i;
+                    } else if (codePoint >= Character.MIN_SUPPLEMENTARY_CODE_POINT) {
+                        --i;
+                    }
                 }
             }
         }

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/URLStreamHandler.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/URLStreamHandler.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/URLStreamHandler.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/URLStreamHandler.java
Fri Jul 16 12:36:24 2010
@@ -111,7 +111,7 @@ public abstract class URLStreamHandler {
         String userInfo = u.getUserInfo();
 
         int refIdx = parseString.indexOf('#', 0);
-        if (parseString.startsWith("//")) { //$NON-NLS-1$
+        if (parseString.startsWith("//") && !parseString.startsWith("////")) { //$NON-NLS-1$
             int hostIdx = 2, portIdx = -1;
             port = -1;
             fileIdx = parseString.indexOf('/', hostIdx);

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/util/Scanner.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/util/Scanner.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/util/Scanner.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/util/Scanner.java
Fri Jul 16 12:36:24 2010
@@ -844,7 +844,8 @@ public final class Scanner implements It
         boolean hasNextLine = false;
         while (true) {
             if (matcher.find()) {
-                if (inputExhausted || matcher.end() != bufferLength) {
+                if (inputExhausted || matcher.end() != bufferLength
+                        || bufferLength < buffer.capacity()) {
                     matchSuccessful = true;
                     hasNextLine = true;
                     break;

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnectionImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnectionImpl.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnectionImpl.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnectionImpl.java
Fri Jul 16 12:36:24 2010
@@ -52,6 +52,7 @@ import java.util.TimeZone;
 import org.apache.harmony.luni.util.Base64;
 import org.apache.harmony.luni.internal.nls.Messages;
 import org.apache.harmony.luni.util.PriviAction;
+import org.apache.harmony.luni.util.Util;
 
 /**
  * This subclass extends <code>HttpURLConnection</code> which in turns extends
@@ -615,6 +616,7 @@ public class HttpURLConnectionImpl exten
             return;
         }
         try {
+            url = new URL(Util.encodeURL(url.toString()));
             uri = url.toURI();
         } catch (URISyntaxException e1) {
             // ignore

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.java
Fri Jul 16 12:36:24 2010
@@ -324,7 +324,53 @@ public final class Util {
         }
         return result.toString();
     }
-	
+
+
+    /**
+     * Encode the given url string as RFC-1738 required.
+     * 
+     * @param urlString
+     * @return encoded URL string
+     */
+    public static String encodeURL(String urlStr) {
+        String digits = "0123456789ABCDEF"; //$NON-NLS-1$
+
+        StringBuilder buf = new StringBuilder(urlStr.length() + 16);
+        for (int i = 0; i < urlStr.length(); i++) {
+            char ch = urlStr.charAt(i);
+            if ('%' == ch) {
+                if (i + 1 < urlStr.length()
+                        && i + 2 < urlStr.length()
+                        && digits.indexOf(Character.toUpperCase(urlStr
+                                .charAt(i + 1))) != -1
+                        && digits.indexOf(Character.toUpperCase(urlStr
+                                .charAt(i + 2))) != -1) {
+                    buf.append(ch);
+                    buf.append(urlStr.charAt(i + 1));
+                    buf.append(urlStr.charAt(i + 2));
+                    i += 2;
+                } else {
+                    buf.append("%25"); //$NON-NLS-1$
+                }
+            } else if ("\"<>%\\^[]`+$,{}`~| ".indexOf(ch) == -1) { //$NON-NLS-1$
+                buf.append(ch);
+            } else {
+                byte[] bytes = null;
+                try {
+                    bytes = new String(new char[] { ch }).getBytes("UTF-8"); //$NON-NLS-1$
+                } catch (UnsupportedEncodingException e) {
+                    throw new AssertionError(e);
+                }
+                for (int j = 0; j < bytes.length; j++) {
+                    buf.append('%');
+                    buf.append(digits.charAt((bytes[j] & 0xf0) >> 4));
+                    buf.append(digits.charAt(bytes[j] & 0xf));
+                }
+            }
+        }
+        return buf.toString();
+    }
+
 	public static String toASCIILowerCase(String s) {
         int len = s.length();
 		StringBuilder buffer = new StringBuilder(len);

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
Fri Jul 16 12:36:24 2010
@@ -23,6 +23,12 @@
 #include "socket.h"
 #include "harmonyglob.h"
 
+#if defined(WIN32) || defined(WIN64)
+#if !defined(ECONNABORTED)
+#define ECONNABORTED WSAECONNABORTED
+#endif
+#endif
+
 void setSocketImplPort(JNIEnv * env, jobject socketImpl, U_16 hPort);
 void setSocketImplAddress(JNIEnv * env, jobject socketImpl,
                           jobject anInetAddress);
@@ -717,49 +723,6 @@ Java_org_apache_harmony_luni_platform_OS
   }
 }
 
-
-/*
- * Class:     org_apache_harmony_luni_platform_OSNetworkSystem
- * Method:    accept
- * Signature: (Ljava/io/FileDescriptor;Ljava/net/SocketImpl;Ljava/io/FileDescriptor;I)V
- */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_luni_platform_OSNetworkSystem_acceptSocketImpl
-  (JNIEnv * env, jobject thiz, jobject fileDescriptorServer,
-   jobject socketImpl, jobject fileDescriptorSocketImpl, jint timeout)
-{
-  PORT_ACCESS_FROM_ENV(env);
-  I_32 result;
-  hysocket_t socketS, socketNew;
-  hysockaddr_struct sockaddrP;
-  jbyte nlocalAddrBytes[HYSOCK_INADDR6_LEN];
-
-  result = pollSelectRead(env, fileDescriptorServer, timeout, TRUE);
-
-  if (0 > result) {
-    return;
-  }
-
-  socketS =
-    getJavaIoFileDescriptorContentsAsAPointer(env, fileDescriptorServer);
-  if (!hysock_socketIsValid(socketS)) {
-    throwJavaNetSocketException(env, HYPORT_ERROR_SOCKET_BADSOCKET);
-    return;
-  }
-
-  hysock_sockaddr_init6(&sockaddrP, (U_8 *) nlocalAddrBytes,
-                        HYSOCK_INADDR_LEN, HYADDR_FAMILY_AFINET4, 0, 0, 0,
-                        socketS);
-
-  result = hysock_accept(socketS, &sockaddrP, &socketNew);
-  if (0 != result) {
-    throwJavaNetBindException(env, result);
-  } else {
-    updateSocket(env, &sockaddrP, socketNew, socketImpl,
-                 fileDescriptorSocketImpl);
-  }
-}
-
 /*
  * Class:     org_apache_harmony_luni_platform_OSNetworkSystem
  * Method:    supportsUrgentData
@@ -1697,6 +1660,7 @@ Java_org_apache_harmony_luni_platform_OS
   hysockaddr_struct sockaddrP;
   jbyte nlocalAddrBytes[HYSOCK_INADDR6_LEN];
 
+  select_accept:
   result = pollSelectRead(env, fdServer, timeout, TRUE);
   if (0 > result) {
     return;
@@ -1714,8 +1678,13 @@ Java_org_apache_harmony_luni_platform_OS
 
   result = hysock_accept(socketS, &sockaddrP, &socketNew);
   if (0 != result) {
-    throwJavaNetBindException(env, result);
-    return;
+    // repeat accept if the server was reset
+    if (errno == ECONNABORTED) {
+      goto select_accept;
+    } else {
+      throwJavaNetSocketException(env, result);
+      return;
+    }
   }
 
   updateSocket(env, &sockaddrP, socketNew, socketImpl, fdSocketImpl);

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/luniglob.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/luniglob.c?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/luniglob.c
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/luniglob.c
Fri Jul 16 12:36:24 2010
@@ -132,7 +132,7 @@ JNI_OnLoad (JavaVM * vm, void *reserved)
        (*vmInterface)->GetSystemProperty (vmInterface, "user.language", &propVal);
        if (propVal == NULL) {
             /* FIXME provide appropriate non-dummy value */
-           propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.language",
"en");
+           propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.language",
(char *)hynls_get_language());
            if (VMI_ERROR_NONE != propRes) {
                /* goto fail2; */
            }
@@ -140,7 +140,7 @@ JNI_OnLoad (JavaVM * vm, void *reserved)
        (*vmInterface)->GetSystemProperty (vmInterface, "user.country", &propVal);
        if (propVal == NULL) {
            /* FIXME provide appropriate non-dummy value */
-           propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.country", "US");
+           propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.country", (char
*)hynls_get_region());
            if (VMI_ERROR_NONE != propRes) {
                /* goto fail2; */
            }

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
Fri Jul 16 12:36:24 2010
@@ -466,6 +466,34 @@ public class HttpURLConnectionTest exten
     }
 
     /**
+     * @tests the url with space
+     */
+    public void testConnectWithSpaceinURL() throws Exception {
+        String jettyURLwithSpace = "http://localhost:" + jettyPort
+                + "/servlet with space";
+        HttpURLConnection httpURLConnect = (HttpURLConnection) new URL(
+                jettyURLwithSpace).openConnection();
+        httpURLConnect.setDoOutput(true);
+        httpURLConnect.connect();
+        assertEquals(200, httpURLConnect.getResponseCode());
+        assertEquals("OK", httpURLConnect.getResponseMessage());
+    }
+
+    /**
+     * @tests the url with space
+     */
+    public void testConnectWithSpaceinURL1() throws Exception {
+        String jettyURLwithSpace = "http://localhost:" + jettyPort
+                + "/servlet with space?arg1=value>1&arg2=%aval%1Aue&arg3=#";
+        HttpURLConnection httpURLConnect = (HttpURLConnection) new URL(
+                jettyURLwithSpace).openConnection();
+        httpURLConnect.setDoOutput(true);
+        httpURLConnect.connect();
+        assertEquals(200, httpURLConnect.getResponseCode());
+        assertEquals("OK", httpURLConnect.getResponseMessage());
+    }
+
+    /**
      * @tests org.apache.harmony.luni.internal.net.www.http.getOutputStream()
      */
     public void testGetOutputStream() throws Exception {

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/String2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/String2Test.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/String2Test.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/String2Test.java
Fri Jul 16 12:36:24 2010
@@ -544,7 +544,7 @@ public class String2Test extends junit.f
     public void test_indexOfI() {
         // Test for method int java.lang.String.indexOf(int)
         assertEquals("Invalid index returned", 1, hw1.indexOf('e'));
-
+        assertEquals("Invalid index returned", 1, "a\ud800\udc00".indexOf(0x10000));
     }
 
     /**
@@ -553,7 +553,7 @@ public class String2Test extends junit.f
     public void test_indexOfII() {
         // Test for method int java.lang.String.indexOf(int, int)
         assertEquals("Invalid character index returned", 5, hw1.indexOf('W', 2));
-
+        assertEquals("Invalid index returned", 2, "ab\ud800\udc00".indexOf(0x10000, 1));
     }
 
     /**
@@ -595,7 +595,8 @@ public class String2Test extends junit.f
         assertEquals("Failed to return correct index", 5, hw1.lastIndexOf('W'));
         assertEquals("Returned index for non-existent char", -1, hw1
                 .lastIndexOf('Z'));
-
+        assertEquals("Failed to return correct index", 1, "a\ud800\udc00"
+                .lastIndexOf(0x10000));
     }
 
     /**

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java
Fri Jul 16 12:36:24 2010
@@ -249,6 +249,19 @@ public class URLTest extends TestCase {
         assertTrue("u10 returns a wrong port " + u10.getPort(),
                 u10.getPort() == -1);
 
+		URL u11 = new URL("file:////file.txt");
+        assertNull("u11 returns a wrong authority " + u11.getAuthority(), u11
+                .getAuthority());
+        assertTrue("u11 returns a wrong file " + u11.getFile(), u11.getFile()
+                .equals("////file.txt"));
+
+        URL u12 = new URL("file:///file.txt");
+        assertTrue("u12 returns a wrong authority", u12.getAuthority().equals(
+                ""));
+        assertTrue("u12 returns a wrong file " + u12.getFile(), u12.getFile()
+                .equals("/file.txt"));
+
+
         // test for error catching
 
         // Bad HTTP format - no "//"

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ScannerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ScannerTest.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ScannerTest.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ScannerTest.java
Fri Jul 16 12:36:24 2010
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.PipedInputStream;
+import java.io.PipedOutputStream;
 import java.io.StringReader;
 import java.math.BigDecimal;
 import java.math.BigInteger;
@@ -37,8 +38,10 @@ import java.nio.channels.FileChannel;
 import java.nio.channels.ReadableByteChannel;
 import java.nio.channels.SocketChannel;
 import java.nio.charset.Charset;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.InputMismatchException;
+import java.util.List;
 import java.util.Locale;
 import java.util.NoSuchElementException;
 import java.util.Scanner;
@@ -5614,7 +5617,6 @@ public class ScannerTest extends TestCas
      * @tests java.util.Scanner#hasNextLine()
      */
     public void test_hasNextLine() {
-        
         s = new Scanner("");
         s.close();
         try {
@@ -5682,7 +5684,40 @@ public class ScannerTest extends TestCas
         assertEquals(0, matchResult.start());
         assertEquals(1, matchResult.end());
     }
-    
+
+    public void test_hasNextLine_sequence() throws IOException {
+        final PipedInputStream pis = new PipedInputStream();
+        final PipedOutputStream pos = new PipedOutputStream();
+        final Scanner scanner = new Scanner(pis);
+        pis.connect(pos);
+        final List<String> result = new ArrayList<String>();
+        Thread thread = new Thread(new Runnable() {
+            public void run() {
+                while (scanner.hasNextLine()) {
+                    result.add(scanner.nextLine());
+                }
+            }
+        });
+        thread.start();
+        for (int index = 0; index < 5; index++) {
+            pos.write(("line" + index + "\n").getBytes());
+            try {
+                Thread.sleep(1000);
+            } catch (InterruptedException e) {
+                // Ignored
+            }
+            assertEquals(index + 1, result.size());
+        }
+        pis.close();
+        pos.close();
+        try {
+            thread.join(1000);
+        } catch (InterruptedException e) {
+            // Ignored
+        }
+        assertFalse(scanner.hasNextLine());
+    }
+
     protected void setUp() throws Exception {
         super.setUp();
 

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/util/UtilTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/util/UtilTest.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/util/UtilTest.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/util/UtilTest.java
Fri Jul 16 12:36:24 2010
@@ -55,4 +55,12 @@ public class UtilTest extends TestCase {
         }
     }
 
+    public void testEncodeURL() {
+        assertEquals("http://test.com/%25", Util.encodeURL("http://test.com/%"));
+        assertEquals("http://test.com/%250", Util.encodeURL("http://test.com/%0"));
+        assertEquals("http://test.com/%2b", Util.encodeURL("http://test.com/%2b"));
+        assertEquals("http://test.com/%2b/index", Util.encodeURL("http://test.com/%2b/index"));
+        assertEquals("http://test.com/%252z", Util.encodeURL("http://test.com/%2z"));
+        assertEquals("http://test.com/with%20space", Util.encodeURL("http://test.com/with
space"));
+    }
 }

Modified: harmony/enhanced/java/branches/java6/classlib/modules/sql/src/main/java/javax/sql/rowset/spi/SyncFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/sql/src/main/java/javax/sql/rowset/spi/SyncFactory.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/sql/src/main/java/javax/sql/rowset/spi/SyncFactory.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/sql/src/main/java/javax/sql/rowset/spi/SyncFactory.java
Fri Jul 16 12:36:24 2010
@@ -43,17 +43,17 @@ public class SyncFactory {
     /**
      * The property name for the synchronization provider's implementation class.
      */
-    public static final String ROWSET_SYNC_PROVIDER = "rowset.provider.classname"; //$NON-NLS-1$
+    public static String ROWSET_SYNC_PROVIDER = "rowset.provider.classname"; //$NON-NLS-1$
 
     /**
      * The property name for the synchronization provider's vendor name.
      */
-    public static final String ROWSET_SYNC_VENDOR = "rowset.provider.vendor"; //$NON-NLS-1$
+    public static String ROWSET_SYNC_VENDOR = "rowset.provider.vendor"; //$NON-NLS-1$
 
     /**
      * The property name for the synchronization provider's version information.
      */
-    public static final String ROWSET_SYNC_PROVIDER_VERSION = "rowset.provider.version";
//$NON-NLS-1$
+    public static String ROWSET_SYNC_PROVIDER_VERSION = "rowset.provider.version"; //$NON-NLS-1$
 
     private static SyncFactory instance = new SyncFactory();
 

Modified: harmony/enhanced/java/branches/java6/classlib/modules/sql/src/main/java/javax/sql/rowset/spi/SyncProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/sql/src/main/java/javax/sql/rowset/spi/SyncProvider.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/sql/src/main/java/javax/sql/rowset/spi/SyncProvider.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/sql/src/main/java/javax/sql/rowset/spi/SyncProvider.java
Fri Jul 16 12:36:24 2010
@@ -21,27 +21,27 @@ import javax.sql.RowSetReader;
 import javax.sql.RowSetWriter;
 
 public abstract class SyncProvider {
-    public static final int GRADE_NONE = 1;
+    public static int GRADE_NONE = 1;
 
-    public static final int GRADE_CHECK_MODIFIED_AT_COMMIT = 2;
+    public static int GRADE_CHECK_MODIFIED_AT_COMMIT = 2;
 
-    public static final int GRADE_CHECK_ALL_AT_COMMIT = 3;
+    public static int GRADE_CHECK_ALL_AT_COMMIT = 3;
 
-    public static final int GRADE_LOCK_WHEN_MODIFIED = 4;
+    public static int GRADE_LOCK_WHEN_MODIFIED = 4;
 
-    public static final int GRADE_LOCK_WHEN_LOADED = 5;
+    public static int GRADE_LOCK_WHEN_LOADED = 5;
 
-    public static final int DATASOURCE_NO_LOCK = 1;
+    public static int DATASOURCE_NO_LOCK = 1;
 
-    public static final int DATASOURCE_ROW_LOCK = 2;
+    public static int DATASOURCE_ROW_LOCK = 2;
 
-    public static final int DATASOURCE_TABLE_LOCK = 3;
+    public static int DATASOURCE_TABLE_LOCK = 3;
 
-    public static final int DATASOURCE_DB_LOCK = 4;
+    public static int DATASOURCE_DB_LOCK = 4;
 
-    public static final int UPDATABLE_VIEW_SYNC = 5;
+    public static int UPDATABLE_VIEW_SYNC = 5;
 
-    public static final int NONUPDATABLE_VIEW_SYNC = 6;
+    public static int NONUPDATABLE_VIEW_SYNC = 6;
 
     public SyncProvider() {
         super();

Modified: harmony/enhanced/java/branches/java6/classlib/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/FilteredRowSetTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/FilteredRowSetTest.java?rev=964785&r1=964784&r2=964785&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/FilteredRowSetTest.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/FilteredRowSetTest.java
Fri Jul 16 12:36:24 2010
@@ -868,7 +868,7 @@ class RangeThree implements Predicate {
 class OddRowFilter implements Predicate {
     public boolean evaluate(RowSet rs) {
         try {
-            return rs.getInt(1) % 2 == 1;
+            return (rs.getInt(1) & 1) == 1;
         } catch (SQLException e) {
             // do nothing
         }

Propchange: harmony/enhanced/java/branches/java6/drlvm/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 16 12:36:24 2010
@@ -1,5 +1,5 @@
 /harmony/enhanced/java/branches/mrh/drlvm:935751-941490
-/harmony/enhanced/java/trunk/drlvm:929253-964042
+/harmony/enhanced/java/trunk/drlvm:929253-964765
 /harmony/enhanced/trunk/drlvm:476395-929252
 /harmony/enhanced/trunk/working_vm:476396-920147
 /incubator/harmony/enhanced/trunk/drlvm:292550-476394

Propchange: harmony/enhanced/java/branches/java6/jdktools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 16 12:36:24 2010
@@ -1,4 +1,4 @@
-/harmony/enhanced/java/trunk/jdktools:929253-964042
+/harmony/enhanced/java/trunk/jdktools:929253-964765
 /harmony/enhanced/jdktools/trunk:630107-925933
 /harmony/enhanced/trunk/jdktools:476395-929252
 /harmony/enhanced/trunk/working_jdktools:476396-920147



Mime
View raw message