8033425: Delay loading of net library in PortConfig initialization (workaround for for 8033367)

Reviewed-by: alanb, chegar
This commit is contained in:
Michael McMahon 2014-02-03 14:40:28 +00:00
parent 0abb2b14ed
commit b2af3087a4

View File

@ -235,13 +235,11 @@ public final class SocketPermission extends Permission
private static Debug debug = null; private static Debug debug = null;
private static boolean debugInit = false; private static boolean debugInit = false;
// ephemeral port range for this system // lazy initializer
private static final int ephemeralLow = initEphemeralPorts( private static class EphemeralRange {
"low", DEF_EPH_LOW static final int low = initEphemeralPorts("low", DEF_EPH_LOW);
); static final int high = initEphemeralPorts("high", PORT_MAX);
private static final int ephemeralHigh = initEphemeralPorts( };
"high", PORT_MAX
);
static { static {
Boolean tmp = java.security.AccessController.doPrivileged( Boolean tmp = java.security.AccessController.doPrivileged(
@ -1235,6 +1233,9 @@ public final class SocketPermission extends Permission
int policyLow, int policyHigh, int targetLow, int targetHigh int policyLow, int policyHigh, int targetLow, int targetHigh
) )
{ {
final int ephemeralLow = EphemeralRange.low;
final int ephemeralHigh = EphemeralRange.high;
if (targetLow == 0) { if (targetLow == 0) {
// check policy includes ephemeral range // check policy includes ephemeral range
if (!inRange(policyLow, policyHigh, ephemeralLow, ephemeralHigh)) { if (!inRange(policyLow, policyHigh, ephemeralLow, ephemeralHigh)) {