test/jdk/internal/jrtfs/WithSecurityManager.java
Print this page
*** 29,38 ****
--- 29,39 ----
import java.net.URI;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.Paths;
+ import java.util.Collections;
public class WithSecurityManager {
public static void main(String[] args) throws Exception {
boolean allow = args[0].equals("allow");
*** 59,69 ****
throw se;
}
// check FileSystems.newFileSystem
try {
! FileSystems.newFileSystem(URI.create("jrt:/"), null);
if (!allow) throw new RuntimeException("access not expected");
} catch (SecurityException se) {
if (allow)
throw se;
}
--- 60,70 ----
throw se;
}
// check FileSystems.newFileSystem
try {
! FileSystems.newFileSystem(URI.create("jrt:/"), Collections.emptyMap());
if (!allow) throw new RuntimeException("access not expected");
} catch (SecurityException se) {
if (allow)
throw se;
}