# HG changeset patch # User chegar # Date 1510150849 0 # Node ID 5cd3c3a62aaf545da7c38479838a83bdad26f3cd # Parent 0586f8664ba816bd5e87974e7d41b49c64ef4743# Parent 16e7156053f50558179c6d26c92e5a2b9335891b http-client-branch: Merge diff -r 0586f8664ba8 -r 5cd3c3a62aaf src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java --- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java Wed Nov 08 12:44:07 2017 +0000 +++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java Wed Nov 08 14:20:49 2017 +0000 @@ -79,7 +79,7 @@ class HttpClientImpl extends HttpClient { static final boolean DEBUG = Utils.DEBUG; // Revisit: temporary dev flag. - static final boolean DEBUGELAPSED = Utils.ASSERTIONSENABLED || DEBUG; // Revisit: temporary dev flag. + static final boolean DEBUGELAPSED = Utils.TESTING || DEBUG; // Revisit: temporary dev flag. static final boolean DEBUGTIMEOUT = false; // Revisit: temporary dev flag. final System.Logger debug = Utils.getDebugLogger(this::dbgString, DEBUG); final System.Logger debugelapsed = Utils.getDebugLogger(this::dbgString, DEBUGELAPSED); diff -r 0586f8664ba8 -r 5cd3c3a62aaf src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Utils.java --- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Utils.java Wed Nov 08 12:44:07 2017 +0000 +++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Utils.java Wed Nov 08 14:20:49 2017 +0000 @@ -78,8 +78,15 @@ assert enabled = true; ASSERTIONSENABLED = enabled; } - public static final boolean DEBUG = true;// Revisit: temporary dev flag. - //getBooleanProperty(DebugLogger.HTTP_NAME, false); + public static final boolean TESTING; + static { + if (ASSERTIONSENABLED) { + PrivilegedAction action = () -> System.getProperty("test.src"); + TESTING = AccessController.doPrivileged(action) != null; + } else TESTING = false; + } + public static final boolean DEBUG = // Revisit: temporary dev flag. + getBooleanProperty(DebugLogger.HTTP_NAME, false); public static final boolean DEBUG_HPACK = // Revisit: temporary dev flag. getBooleanProperty(DebugLogger.HPACK_NAME, false);