http-client-branch: Merge http-client-branch
authorchegar
Wed, 08 Nov 2017 14:20:49 +0000
branchhttp-client-branch
changeset 55783 5cd3c3a62aaf
parent 55782 0586f8664ba8 (current diff)
parent 55781 16e7156053f5 (diff)
child 55784 8b2d7be041dc
child 55785 eb4826e9f3f6
http-client-branch: Merge
--- 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);