--- 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);
--- 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<String> 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);