@@ -95,26 +95,10 @@ static CheckAction alwaysDenied(CheckedRunnable<Exception> action) {
9595
9696 private static final Map <String , CheckAction > checkActions = Stream .of (
9797 Stream .<Entry <String , CheckAction >>of (
98- entry ("create_classloader" , forPlugins (RestEntitlementsCheckAction ::createClassLoader )),
99- entry ("processBuilder_start" , deniedToPlugins (RestEntitlementsCheckAction ::processBuilder_start )),
100- entry ("processBuilder_startPipeline" , deniedToPlugins (RestEntitlementsCheckAction ::processBuilder_startPipeline )),
10198 entry ("set_https_connection_properties" , forPlugins (RestEntitlementsCheckAction ::setHttpsConnectionProperties )),
10299 entry ("set_default_ssl_socket_factory" , alwaysDenied (RestEntitlementsCheckAction ::setDefaultSSLSocketFactory )),
103100 entry ("set_default_hostname_verifier" , alwaysDenied (RestEntitlementsCheckAction ::setDefaultHostnameVerifier )),
104101 entry ("set_default_ssl_context" , alwaysDenied (RestEntitlementsCheckAction ::setDefaultSSLContext )),
105- entry (
106- "thread_setDefaultUncaughtExceptionHandler" ,
107- alwaysDenied (RestEntitlementsCheckAction ::thread$$setDefaultUncaughtExceptionHandler )
108- ),
109- entry ("logManager" , alwaysDenied (RestEntitlementsCheckAction ::logManager$ )),
110-
111- entry ("locale_setDefault" , alwaysDenied (WritePropertiesCheckActions ::setDefaultLocale )),
112- entry ("locale_setDefaultForCategory" , alwaysDenied (WritePropertiesCheckActions ::setDefaultLocaleForCategory )),
113- entry ("timeZone_setDefault" , alwaysDenied (WritePropertiesCheckActions ::setDefaultTimeZone )),
114-
115- entry ("system_setProperty" , forPlugins (WritePropertiesCheckActions ::setSystemProperty )),
116- entry ("system_clearProperty" , forPlugins (WritePropertiesCheckActions ::clearSystemProperty )),
117- entry ("system_setSystemProperties" , alwaysDenied (WritePropertiesCheckActions ::setSystemProperties )),
118102
119103 // This group is a bit nasty: if entitlements don't prevent these, then networking is
120104 // irreparably borked for the remainder of the test run.
@@ -211,7 +195,9 @@ static CheckAction alwaysDenied(CheckedRunnable<Exception> action) {
211195 getTestEntries (SpiActions .class ),
212196 getTestEntries (SystemActions .class ),
213197 getTestEntries (URLConnectionFileActions .class ),
214- getTestEntries (URLConnectionNetworkActions .class )
198+ getTestEntries (URLConnectionNetworkActions .class ),
199+ getTestEntries (JvmActions .class ),
200+ getTestEntries (OperatingSystemActions .class )
215201 )
216202 .flatMap (Function .identity ())
217203 .filter (entry -> entry .getValue ().fromJavaVersion () == null || Runtime .version ().feature () >= entry .getValue ().fromJavaVersion ())
@@ -323,33 +309,10 @@ private static void setDefaultSSLSocketFactory() {
323309 HttpsURLConnection .setDefaultSSLSocketFactory (new DummyImplementations .DummySSLSocketFactory ());
324310 }
325311
326- private static void createClassLoader () throws IOException {
327- try (var classLoader = new URLClassLoader ("test" , new URL [0 ], RestEntitlementsCheckAction .class .getClassLoader ())) {
328- logger .info ("Created URLClassLoader [{}]" , classLoader .getName ());
329- }
330- }
331-
332- private static void processBuilder_start () throws IOException {
333- new ProcessBuilder ("" ).start ();
334- }
335-
336- private static void processBuilder_startPipeline () throws IOException {
337- ProcessBuilder .startPipeline (List .of ());
338- }
339-
340312 private static void setHttpsConnectionProperties () {
341313 new DummyImplementations .DummyHttpsURLConnection ().setSSLSocketFactory (new DummyImplementations .DummySSLSocketFactory ());
342314 }
343315
344- private static void thread$$setDefaultUncaughtExceptionHandler () {
345- Thread .setDefaultUncaughtExceptionHandler (Thread .getDefaultUncaughtExceptionHandler ());
346- }
347-
348- private static void logManager$ () {
349- new java .util .logging .LogManager () {
350- };
351- }
352-
353316 @ SuppressWarnings ("deprecation" )
354317 @ SuppressForbidden (reason = "We're required to prevent calls to this forbidden API" )
355318 private static void datagramSocket$$setDatagramSocketImplFactory () throws IOException {
0 commit comments