< prev index next >
test/jdk/java/util/concurrent/atomic/AtomicUpdaters.java
Print this page
rev 47439 : 8189291: Test policy should extend the default system policy
Reviewed-by:
*** 1,7 ****
/*
! * Copyright (c) 2012, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2012, 2017, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 21,31 ****
* questions.
*/
/*
* @test
! * @bug 7103570
* @author David Holmes
* @run main/othervm AtomicUpdaters
* @run main/othervm AtomicUpdaters UseSM
* @summary Checks the (in)ability to create field updaters for differently
* accessible fields in different locations with/without a security
--- 21,31 ----
* questions.
*/
/*
* @test
! * @bug 7103570 8189291
* @author David Holmes
* @run main/othervm AtomicUpdaters
* @run main/othervm AtomicUpdaters UseSM
* @summary Checks the (in)ability to create field updaters for differently
* accessible fields in different locations with/without a security
*** 45,54 ****
--- 45,56 ----
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
public class AtomicUpdaters {
+ static final Policy DEFAULT_POLICY = Policy.getPolicy();
+
enum TYPE { INT, LONG, REF }
static class Config {
final Class<?> clazz;
final String field;
*** 214,222 ****
return Policy.UNSUPPORTED_EMPTY_COLLECTION;
}
@Override
public boolean implies(ProtectionDomain pd, Permission p) {
! return Policy.UNSUPPORTED_EMPTY_COLLECTION.implies(p);
}
}
}
--- 216,225 ----
return Policy.UNSUPPORTED_EMPTY_COLLECTION;
}
@Override
public boolean implies(ProtectionDomain pd, Permission p) {
! return Policy.UNSUPPORTED_EMPTY_COLLECTION.implies(p) ||
! DEFAULT_POLICY.implies(pd, p);
}
}
}
< prev index next >