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
--- 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) {