8231631: sun/net/ftp/FtpURLConnectionLeak.java fails intermittently with NPE
authordfuchs
Thu, 31 Oct 2019 19:31:03 +0000
changeset 58873 5f1fe5971ff9
parent 58872 ca70299778b9
child 58874 c440a6b4e096
8231631: sun/net/ftp/FtpURLConnectionLeak.java fails intermittently with NPE Summary: sun/net/www/ftptest/FtpCommandHandler.java is modified to handle EOF properly Reviewed-by: chegar, vtewari
test/jdk/sun/net/www/ftptest/FtpCommandHandler.java
--- a/test/jdk/sun/net/www/ftptest/FtpCommandHandler.java	Thu Oct 31 16:45:58 2019 +0000
+++ b/test/jdk/sun/net/www/ftptest/FtpCommandHandler.java	Thu Oct 31 19:31:03 2019 +0000
@@ -466,6 +466,10 @@
             try {
                 str = in.readLine();
                 System.out.println("line: " + str);
+                if (str == null) {
+                    System.out.println("EOF read from input");
+                    break;
+                }
                 buf = new StringBuffer(str);
                 res = parseCmd(buf);
                 switch (res) {