http-client-branch: Fixed variable lenght logic in HttpServerAdapters.java http-client-branch
authordfuchs
Thu, 15 Feb 2018 19:11:34 +0000
branchhttp-client-branch
changeset 56135 e359a2716711
parent 56134 2fc9edf5628d
child 56136 3b58e5bacad6
http-client-branch: Fixed variable lenght logic in HttpServerAdapters.java
test/jdk/java/net/httpclient/HttpServerAdapters.java
--- a/test/jdk/java/net/httpclient/HttpServerAdapters.java	Thu Feb 15 16:32:53 2018 +0000
+++ b/test/jdk/java/net/httpclient/HttpServerAdapters.java	Thu Feb 15 19:11:34 2018 +0000
@@ -213,7 +213,7 @@
             @Override
             public void sendResponseHeaders(int code, int contentLength) throws IOException {
                 if (contentLength == 0) contentLength = -1;
-                if (contentLength < 0) contentLength = 0;
+                else if (contentLength < 0) contentLength = 0;
                 exchange.sendResponseHeaders(code, contentLength);
             }
             @Override
@@ -259,7 +259,7 @@
             @Override
             public void sendResponseHeaders(int code, int contentLength) throws IOException {
                 if (contentLength == 0) contentLength = -1;
-                if (contentLength < 0) contentLength = 0;
+                else if (contentLength < 0) contentLength = 0;
                 exchange.sendResponseHeaders(code, contentLength);
             }
             void doFilter(Filter.Chain filter) throws IOException {