diff --git a/make/tools/CharsetMapping/Big5.c2b b/make/tools/CharsetMapping/Big5.c2b deleted file mode 100644 index a4ed3176312ddcca7df0f7f4cff758c8a47ed147..0000000000000000000000000000000000000000 --- a/make/tools/CharsetMapping/Big5.c2b +++ /dev/null @@ -1,8 +0,0 @@ -#Add the following 5 characters which are duplicated -#or have conflicts with other characters. -0xA1C4 0xFF3F #REGWARN Fallback 0xA1C4 SPACING UNDERSCORE -0xA2AC 0x2571 #REGWARN Fallback 0xA2AC LT DIAG UP RIGHT TO LOW LEFT -0xA2AD 0x2572 #REGWARN Fallback 0xA2AD LT DIAG UP LEFT TO LOW RIGHT -0xA451 0x5341 #REGWARN Fallback 0xA451 HANGZHOU NUMERAL TEN -0xA4CA 0x5345 #REGWARN Fallback 0xA4CA HANGZHOU NUMERAL THIRTY -# diff --git a/make/tools/CharsetMapping/Big5.map b/make/tools/CharsetMapping/Big5.map index dcfa244c310aa6eb1b3b2e3d1d97651372b52b8e..93242f1ebaad1e7abef1fbca8905bd3f470b7f25 100644 --- a/make/tools/CharsetMapping/Big5.map +++ b/make/tools/CharsetMapping/Big5.map @@ -13830,8 +13830,21 @@ 0xF9D4 0x9F49 # 0xF9D5 0x9F98 # # +# from Big5.b2c-irreversible +# 0xA15A 0xFF3F #SPACING UNDERSCORE 0xA1FE 0x2571 #LT DIAG UP RIGHT TO LOW LEFT 0xA240 0x2572 #LT DIAG UP LEFT TO LOW RIGHTG 0xA2CC 0x5341 #HANGHZOU NUMERAL TEN 0xA2CE 0x5345 #HANGZHOU NUMERAL THIRTY +# +# Add the following 5 characters from Big5.c2b-irreversible +# It appears these 5 should be here to be the round-trip +# for these 5 characters. Above 5 are the b->c only nrt. +# +0xA1C4 0xFF3F +0xA2AC 0x2571 +0xA2AD 0x2572 +0xA451 0x5341 +0xA4CA 0x5345 +# diff --git a/src/share/classes/sun/misc/SharedSecrets.java b/src/share/classes/sun/misc/SharedSecrets.java index 7ebbe46e7122e7ed9009c6c0dbf6f51d8a4dba43..c9f50728860792fe55e9acfedbc446a158af036e 100644 --- a/src/share/classes/sun/misc/SharedSecrets.java +++ b/src/share/classes/sun/misc/SharedSecrets.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ import java.util.jar.JarFile; import java.io.Console; import java.io.File; import java.io.FileDescriptor; +import java.security.ProtectionDomain; /** A repository of "shared secrets", which are a mechanism for calling implementation-private methods in another package without @@ -121,6 +122,8 @@ public class SharedSecrets { public static JavaSecurityProtectionDomainAccess getJavaSecurityProtectionDomainAccess() { + if (javaSecurityProtectionDomainAccess == null) + unsafe.ensureClassInitialized(ProtectionDomain.class); return javaSecurityProtectionDomainAccess; } } diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java index d8cdb2ea2c963f624e2170b0ea6e5f0c37abfd27..eddbd29e19005a6a6d1515e977d29526d2a4f709 100644 --- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java +++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java @@ -623,6 +623,11 @@ public class DNSIdentities { */ volatile static boolean serverReady = false; + /* + * Is the connection ready to close? + */ + volatile static boolean closeReady = false; + /* * Turn on SSL debugging? */ @@ -670,11 +675,14 @@ public class DNSIdentities { out.print("Testing\r\n"); out.flush(); } finally { - // close the socket - Thread.sleep(2000); - System.out.println("Server closing socket"); - sslSocket.close(); - serverReady = false; + // close the socket + while (!closeReady) { + Thread.sleep(50); + } + + System.out.println("Server closing socket"); + sslSocket.close(); + serverReady = false; } } @@ -704,12 +712,17 @@ public class DNSIdentities { URL url = new URL("https://localhost:" + serverPort+"/"); System.out.println("url is "+url.toString()); - http = (HttpsURLConnection)url.openConnection(); - - int respCode = http.getResponseCode(); - System.out.println("respCode = "+respCode); + try { + http = (HttpsURLConnection)url.openConnection(); - http.disconnect(); + int respCode = http.getResponseCode(); + System.out.println("respCode = "+respCode); + } finally { + if (http != null) { + http.disconnect(); + } + closeReady = true; + } } /* diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java index 33ebfda5805da804339e4f027bc4948ee398bffa..0e55c60eeabe40d467a143aa527b3681b73f089b 100644 --- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java +++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java @@ -60,6 +60,11 @@ public class HttpsPost { */ volatile static boolean serverReady = false; + /* + * Is the connection ready to close? + */ + volatile static boolean closeReady = false; + /* * Turn on SSL debugging? */ @@ -98,25 +103,34 @@ public class HttpsPost { serverReady = true; SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); - InputStream sslIS = sslSocket.getInputStream(); - OutputStream sslOS = sslSocket.getOutputStream(); - BufferedReader br = new BufferedReader(new InputStreamReader(sslIS)); - PrintStream ps = new PrintStream(sslOS); - // process HTTP POST request from client - System.out.println("status line: "+br.readLine()); - String msg = null; - while ((msg = br.readLine()) != null && msg.length() > 0); - - msg = br.readLine(); - if (msg.equals(postMsg)) { - ps.println("HTTP/1.1 200 OK\n\n"); - } else { - ps.println("HTTP/1.1 500 Not OK\n\n"); + try { + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + BufferedReader br = + new BufferedReader(new InputStreamReader(sslIS)); + PrintStream ps = new PrintStream(sslOS); + + // process HTTP POST request from client + System.out.println("status line: "+br.readLine()); + String msg = null; + while ((msg = br.readLine()) != null && msg.length() > 0); + + msg = br.readLine(); + if (msg.equals(postMsg)) { + ps.println("HTTP/1.1 200 OK\n\n"); + } else { + ps.println("HTTP/1.1 500 Not OK\n\n"); + } + ps.flush(); + + // close the socket + while (!closeReady) { + Thread.sleep(50); + } + } finally { + sslSocket.close(); + sslServerSocket.close(); } - ps.flush(); - Thread.sleep(2000); - sslSocket.close(); - sslServerSocket.close(); } /* @@ -144,12 +158,17 @@ public class HttpsPost { http.setRequestMethod("POST"); PrintStream ps = new PrintStream(http.getOutputStream()); - ps.println(postMsg); - ps.flush(); - if (http.getResponseCode() != 200) { - throw new RuntimeException("test Failed"); + try { + ps.println(postMsg); + ps.flush(); + if (http.getResponseCode() != 200) { + throw new RuntimeException("test Failed"); + } + } finally { + ps.close(); + http.disconnect(); + closeReady = true; } - ps.close(); } static class NameVerifier implements HostnameVerifier { diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java index c4d48cc108006f1a78f7077629f95c632bb37538..4cc3a0f05549f944f977a90b0c5de8cc3ff87ba2 100644 --- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java +++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java @@ -623,6 +623,11 @@ public class IPAddressDNSIdentities { */ volatile static boolean serverReady = false; + /* + * Is the connection ready to close? + */ + volatile static boolean closeReady = false; + /* * Turn on SSL debugging? */ @@ -670,11 +675,14 @@ public class IPAddressDNSIdentities { out.print("Testing\r\n"); out.flush(); } finally { - // close the socket - Thread.sleep(2000); - System.out.println("Server closing socket"); - sslSocket.close(); - serverReady = false; + // close the socket + while (!closeReady) { + Thread.sleep(50); + } + + System.out.println("Server closing socket"); + sslSocket.close(); + serverReady = false; } } @@ -716,7 +724,10 @@ public class IPAddressDNSIdentities { // no subject alternative names matching IP address 127.0.0.1 found // that's the expected exception, ignore it. } finally { - http.disconnect(); + if (http != null) { + http.disconnect(); + } + closeReady = true; } } diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java index 4bafaf24b516dbe3b24b70e29667fde974f2bf43..d30efd81ebfcd6da51b9b2bd6f3adc29e4b0753a 100644 --- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java +++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java @@ -624,6 +624,11 @@ public class IPAddressIPIdentities { */ volatile static boolean serverReady = false; + /* + * Is the connection ready to close? + */ + volatile static boolean closeReady = false; + /* * Turn on SSL debugging? */ @@ -672,7 +677,10 @@ public class IPAddressIPIdentities { out.flush(); } finally { // close the socket - Thread.sleep(2000); + while (!closeReady) { + Thread.sleep(50); + } + System.out.println("Server closing socket"); sslSocket.close(); serverReady = false; @@ -705,12 +713,17 @@ public class IPAddressIPIdentities { URL url = new URL("https://127.0.0.1:" + serverPort+"/"); System.out.println("url is "+url.toString()); - http = (HttpsURLConnection)url.openConnection(); - - int respCode = http.getResponseCode(); - System.out.println("respCode = "+respCode); + try { + http = (HttpsURLConnection)url.openConnection(); - http.disconnect(); + int respCode = http.getResponseCode(); + System.out.println("respCode = "+respCode); + } finally { + if (http != null) { + http.disconnect(); + } + closeReady = true; + } } /* diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java index 7e1d48fdfb1aa9196b04ff78fe6040c4a92d226c..10dc8d8301a55d83efb6cd7e774ced7588e77c9a 100644 --- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java +++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java @@ -624,6 +624,11 @@ public class IPIdentities { */ volatile static boolean serverReady = false; + /* + * Is the connection ready to close? + */ + volatile static boolean closeReady = false; + /* * Turn on SSL debugging? */ @@ -672,7 +677,10 @@ public class IPIdentities { out.flush(); } finally { // close the socket - Thread.sleep(2000); + while (!closeReady) { + Thread.sleep(50); + } + System.out.println("Server closing socket"); sslSocket.close(); serverReady = false; @@ -705,12 +713,17 @@ public class IPIdentities { URL url = new URL("https://localhost:" + serverPort+"/"); System.out.println("url is "+url.toString()); - http = (HttpsURLConnection)url.openConnection(); - - int respCode = http.getResponseCode(); - System.out.println("respCode = "+respCode); + try { + http = (HttpsURLConnection)url.openConnection(); - http.disconnect(); + int respCode = http.getResponseCode(); + System.out.println("respCode = "+respCode); + } finally { + if (http != null) { + http.disconnect(); + } + closeReady = true; + } } /* diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Identities.java b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Identities.java index 0bde45f909d666a795d31491a5ed7973737bb9ca..79224b0ac70b261f1f28b2692cb3c31e87ab8627 100644 --- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Identities.java +++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Identities.java @@ -623,6 +623,11 @@ public class Identities { */ volatile static boolean serverReady = false; + /* + * Is the connection ready to close? + */ + volatile static boolean closeReady = false; + /* * Turn on SSL debugging? */ @@ -671,7 +676,10 @@ public class Identities { out.flush(); } finally { // close the socket - Thread.sleep(2000); + while (!closeReady) { + Thread.sleep(50); + } + System.out.println("Server closing socket"); sslSocket.close(); serverReady = false; @@ -704,12 +712,17 @@ public class Identities { URL url = new URL("https://localhost:" + serverPort+"/"); System.out.println("url is "+url.toString()); - http = (HttpsURLConnection)url.openConnection(); - - int respCode = http.getResponseCode(); - System.out.println("respCode = "+respCode); + try { + http = (HttpsURLConnection)url.openConnection(); - http.disconnect(); + int respCode = http.getResponseCode(); + System.out.println("respCode = "+respCode); + } finally { + if (http != null) { + http.disconnect(); + } + closeReady = true; + } } /* diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Redirect.java b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Redirect.java index 838647ab76a9e22face619dbe1bf76c93fc02148..9321820f7555255529164d4e00ffb063e12cad1f 100644 --- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Redirect.java +++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Redirect.java @@ -60,6 +60,11 @@ public class Redirect { */ volatile static boolean serverReady = false; + /* + * Is the connection ready to close? + */ + volatile static boolean closeReady = false; + /* * Turn on SSL debugging? */ @@ -98,24 +103,33 @@ public class Redirect { serverReady = true; SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); - InputStream sslIS = sslSocket.getInputStream(); - OutputStream sslOS = sslSocket.getOutputStream(); - BufferedReader br = new BufferedReader(new InputStreamReader(sslIS)); - PrintStream ps = new PrintStream(sslOS); - // process HTTP POST request from client - System.out.println("status line: "+br.readLine()); - - ps.println("HTTP/1.1 307 Redirect"); - ps.println("Location: https://localhost:"+serverPort+"/index.html\n\n"); - ps.flush(); - sslSocket = (SSLSocket) sslServerSocket.accept(); - sslOS = sslSocket.getOutputStream(); - ps = new PrintStream(sslOS); - ps.println("HTTP/1.1 200 Redirect succeeded\n\n"); - ps.flush(); - Thread.sleep(2000); - sslSocket.close(); - sslServerSocket.close(); + try { + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + BufferedReader br = + new BufferedReader(new InputStreamReader(sslIS)); + PrintStream ps = new PrintStream(sslOS); + + // process HTTP POST request from client + System.out.println("status line: "+br.readLine()); + + ps.println("HTTP/1.1 307 Redirect"); + ps.println("Location: https://localhost:" + serverPort + + "/index.html\n\n"); + ps.flush(); + sslSocket = (SSLSocket) sslServerSocket.accept(); + sslOS = sslSocket.getOutputStream(); + ps = new PrintStream(sslOS); + ps.println("HTTP/1.1 200 Redirect succeeded\n\n"); + ps.flush(); + } finally { + // close the socket + while (!closeReady) { + Thread.sleep(50); + } + sslSocket.close(); + sslServerSocket.close(); + } } /* @@ -139,10 +153,14 @@ public class Redirect { HttpsURLConnection.setDefaultHostnameVerifier( new NameVerifier()); HttpsURLConnection http = (HttpsURLConnection)url.openConnection(); - - System.out.println("response header: "+http.getHeaderField(0)); - if (http.getResponseCode() != 200) { - throw new RuntimeException("test Failed"); + try { + System.out.println("response header: "+http.getHeaderField(0)); + if (http.getResponseCode() != 200) { + throw new RuntimeException("test Failed"); + } + } finally { + http.disconnect(); + closeReady = true; } }