mirror of
https://github.com/darlinghq/darling-openjdk.git
synced 2024-12-03 01:51:32 +00:00
8227574: [TESTBUG] JTReg tests fail with Graal due to access denied
Reviewed-by: kvn
This commit is contained in:
parent
74143d5ab8
commit
53635b436c
@ -276,7 +276,9 @@ public class URLTest {
|
||||
}
|
||||
|
||||
static class CustomPolicy extends Policy {
|
||||
static final Policy DEFAULT_POLICY = Policy.getPolicy();
|
||||
final PermissionCollection perms = new Permissions();
|
||||
|
||||
CustomPolicy(Permission... permissions) {
|
||||
java.util.Arrays.stream(permissions).forEach(perms::add);
|
||||
|
||||
@ -301,7 +303,7 @@ public class URLTest {
|
||||
}
|
||||
|
||||
public boolean implies(ProtectionDomain domain, Permission perm) {
|
||||
return perms.implies(perm);
|
||||
return perms.implies(perm) || DEFAULT_POLICY.implies(domain, perm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -42,6 +42,7 @@ import java.util.logging.LoggingPermission;
|
||||
* JDBC concrete classes
|
||||
*/
|
||||
public class TestPolicy extends Policy {
|
||||
static final Policy DEFAULT_POLICY = Policy.getPolicy();
|
||||
|
||||
final PermissionCollection permissions = new Permissions();
|
||||
|
||||
@ -137,6 +138,6 @@ public class TestPolicy extends Policy {
|
||||
|
||||
@Override
|
||||
public boolean implies(ProtectionDomain domain, Permission perm) {
|
||||
return permissions.implies(perm);
|
||||
return permissions.implies(perm) || DEFAULT_POLICY.implies(domain, perm);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user