提交 7b912547 编写于 作者: C chegar

6693244: Java Web Start app fails on 6u10 beta w/ AssertionError in...

6693244: Java Web Start app fails on 6u10 beta w/ AssertionError in AuthenticationInfo.requestCompleted
Reviewed-by: michaelm
上级 4ca34dab
...@@ -111,7 +111,7 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone ...@@ -111,7 +111,7 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone
* at the same time, then all but the first will block until * at the same time, then all but the first will block until
* the first completes its authentication. * the first completes its authentication.
*/ */
static private HashMap requests = new HashMap (); static private HashMap<String,Thread> requests = new HashMap<>();
/* check if a request for this destination is in progress /* check if a request for this destination is in progress
* return false immediately if not. Otherwise block until * return false immediately if not. Otherwise block until
...@@ -125,7 +125,7 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone ...@@ -125,7 +125,7 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone
synchronized (requests) { synchronized (requests) {
Thread t, c; Thread t, c;
c = Thread.currentThread(); c = Thread.currentThread();
if ((t=(Thread)requests.get(key))==null) { if ((t = requests.get(key)) == null) {
requests.put (key, c); requests.put (key, c);
return false; return false;
} }
...@@ -147,8 +147,11 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone ...@@ -147,8 +147,11 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone
*/ */
static private void requestCompleted (String key) { static private void requestCompleted (String key) {
synchronized (requests) { synchronized (requests) {
boolean waspresent = requests.remove (key) != null; Thread thread = requests.get(key);
assert waspresent; if (thread != null && thread == Thread.currentThread()) {
boolean waspresent = requests.remove(key) != null;
assert waspresent;
}
requests.notifyAll(); requests.notifyAll();
} }
} }
......
...@@ -692,7 +692,6 @@ java/net/URLConnection/TimeoutTest.java generic-all ...@@ -692,7 +692,6 @@ java/net/URLConnection/TimeoutTest.java generic-all
java/net/URLConnection/ZeroContentLength.java generic-all java/net/URLConnection/ZeroContentLength.java generic-all
# Solaris 11 i586 fails with samevm, not sure why # Solaris 11 i586 fails with samevm, not sure why
java/net/Authenticator/B4769350.java generic-all
java/net/HttpURLConnection/HttpResponseCode.java generic-all java/net/HttpURLConnection/HttpResponseCode.java generic-all
java/net/ResponseCache/B6181108.java generic-all java/net/ResponseCache/B6181108.java generic-all
java/net/ResponseCache/ResponseCacheTest.java generic-all java/net/ResponseCache/ResponseCacheTest.java generic-all
......
...@@ -26,9 +26,12 @@ ...@@ -26,9 +26,12 @@
* @bug 4769350 * @bug 4769350
* @library ../../../sun/net/www/httptest/ * @library ../../../sun/net/www/httptest/
* @build HttpCallback HttpServer ClosedChannelList HttpTransaction AbstractCallback * @build HttpCallback HttpServer ClosedChannelList HttpTransaction AbstractCallback
* @run main B4769350 server * @run main/othervm B4769350 server
* @run main B4769350 proxy * @run main/othervm B4769350 proxy
* @summary proxy authentication username and password caching only works in serial case * @summary proxy authentication username and password caching only works in serial case
* Run in othervm since the test sets system properties that are read by the
* networking stack and cached when the HTTP handler is invoked, and previous
* tests may already have invoked the HTTP handler.
*/ */
import java.io.*; import java.io.*;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册