From 7b49c40ee96cb5fc78071cd87c7c4edcd50417b3 Mon Sep 17 00:00:00 2001 From: Julia Boes Date: Wed, 4 Sep 2019 17:36:53 +0100 Subject: [PATCH] 8171405: java/net/URLConnection/ResendPostBody.java failed with "Error while cleaning up threads after test" Test cleaned up to improve safe termination Reviewed-by: michaelm, vtewari, dfuchs --- .../net/URLConnection/ResendPostBody.java | 135 ++++++++++-------- 1 file changed, 72 insertions(+), 63 deletions(-) diff --git a/test/jdk/java/net/URLConnection/ResendPostBody.java b/test/jdk/java/net/URLConnection/ResendPostBody.java index a8fec538ebb..f3c16a3754d 100644 --- a/test/jdk/java/net/URLConnection/ResendPostBody.java +++ b/test/jdk/java/net/URLConnection/ResendPostBody.java @@ -51,100 +51,109 @@ public class ResendPostBody { static class Server extends Thread { - InputStream in; - OutputStream out; - Socket sock; - StringBuffer response; - ServerSocket server; + private InputStream in; + private OutputStream out; + private Socket sock; + private StringBuffer response; + private ServerSocket server; - Server (ServerSocket s) throws IOException - { + Server(ServerSocket s) throws IOException { server = s; } - void waitFor (String s) throws IOException - { - byte[] w = s.getBytes (); - for(int c=0; c