On Thu, May 2, 2019 at 2:28 AM Daniel Fuchs <daniel.fu...@oracle.com> wrote:
> > 1. IPSupport needs to read system properties, attempts > to bind sockets etc... I wonder how that might interact > with tests that use a security manager, as some of these > operations may throw a SecurityException. > Maybe some double checking would be in order for those. > Reading system properties is such a common operation that test library code should simply rely on the security manager allowing it. Yes, it is sometimes useful to have a DraconianSecurityManager in a test, including one that disallows System.getProperty (I've written such a test myself!) but then the use of that security manager should be scoped to a limited operation that includes no test library code, as in /** * Runs Runnable r with a security policy that permits precisely * the specified permissions. If there is no current security * manager, a temporary one is set for the duration of the * Runnable. We require that any security manager permit * getPolicy/setPolicy. */ public void runWithSecurityManagerWithPermissions(Runnable r, Permission... permissions) { The same argument might apply to socket operations as well.