harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Wu (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2955) [classlib][luni]File.deleteOnExit should implement with doPrivileged
Date Tue, 09 Jan 2007 16:26:27 GMT
[classlib][luni]File.deleteOnExit should implement with doPrivileged
--------------------------------------------------------------------

                 Key: HARMONY-2955
                 URL: https://issues.apache.org/jira/browse/HARMONY-2955
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Tony Wu


As title, following testcase passes on RI whereas throws "AccessControlException:Access denied"
on Harmony

    public void test() throws IOException {
        File dir = File.createTempFile("hytemp", "");
        dir.deleteOnExit();
        SecurityManager backup = System.getSecurityManager();
        try {
            System.setSecurityManager(new MySecurityManager());
        } finally {
            System.setSecurityManager(backup);
        }
    }

    class MySecurityManager extends SecurityManager {
        public void checkPermission(Permission perm) {
            if ("setSecurityManager".equals(perm.getName())) {
                return;
            }
            super.checkPermission(perm);
        }
    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message