From 7df849224bef6b55c50f4640fdd31d4584e99000 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Thu, 31 Oct 2019 19:31:03 +0000 Subject: [PATCH] 8231631: sun/net/ftp/FtpURLConnectionLeak.java fails intermittently with NPE Sun/net/www/ftptest/FtpCommandHandler.java is modified to handle EOF properly Reviewed-by: chegar, vtewari --- test/jdk/sun/net/www/ftptest/FtpCommandHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/jdk/sun/net/www/ftptest/FtpCommandHandler.java b/test/jdk/sun/net/www/ftptest/FtpCommandHandler.java index fea4273e257..1e491961851 100644 --- a/test/jdk/sun/net/www/ftptest/FtpCommandHandler.java +++ b/test/jdk/sun/net/www/ftptest/FtpCommandHandler.java @@ -466,6 +466,10 @@ public class FtpCommandHandler extends Thread { 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) {