diff --git a/src/java.base/share/classes/sun/net/NetProperties.java b/src/java.base/share/classes/sun/net/NetProperties.java index 9381c437380f1..c0a20c4a19f0c 100644 --- a/src/java.base/share/classes/sun/net/NetProperties.java +++ b/src/java.base/share/classes/sun/net/NetProperties.java @@ -38,10 +38,7 @@ * */ public class NetProperties { - private static Properties props = new Properties(); - static { - loadDefaultProperties(); - } + private static final Properties props = loadDefaultProperties(new Properties()); private NetProperties() { }; @@ -50,7 +47,7 @@ public class NetProperties { * Loads the default networking system properties * the file is in jre/lib/net.properties */ - private static void loadDefaultProperties() { + private static Properties loadDefaultProperties(Properties props) { String fname = StaticProperty.javaHome(); if (fname == null) { throw new Error("Can't find java.home ??"); @@ -66,6 +63,7 @@ private static void loadDefaultProperties() { // Do nothing. We couldn't find or access the file // so we won't have default properties... } + return props; } /** diff --git a/src/java.base/share/classes/sun/net/www/http/KeepAliveStreamCleaner.java b/src/java.base/share/classes/sun/net/www/http/KeepAliveStreamCleaner.java index fd3223737b728..66b039d6c4d9d 100644 --- a/src/java.base/share/classes/sun/net/www/http/KeepAliveStreamCleaner.java +++ b/src/java.base/share/classes/sun/net/www/http/KeepAliveStreamCleaner.java @@ -49,7 +49,7 @@ class KeepAliveStreamCleaner implements Runnable { // maximum amount of remaining data that we will try to clean up - protected static final int MAX_DATA_REMAINING; + protected static final long MAX_DATA_REMAINING; // maximum amount of KeepAliveStreams to be queued protected static final int MAX_CAPACITY; @@ -62,7 +62,7 @@ class KeepAliveStreamCleaner static { final String maxDataKey = "http.KeepAlive.remainingData"; - MAX_DATA_REMAINING = NetProperties.getInteger(maxDataKey, 512) * 1024; + MAX_DATA_REMAINING = NetProperties.getInteger(maxDataKey, 512) * 1024L; final String maxCapacityKey = "http.KeepAlive.queuedConnections"; MAX_CAPACITY = NetProperties.getInteger(maxCapacityKey, 10);