提交 109385f5 编写于 作者: M michaelm

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

Reviewed-by: alanb, chegar
上级 a576f5de
...@@ -235,13 +235,11 @@ public final class SocketPermission extends Permission ...@@ -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 ...@@ -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)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册