Incorrect test case in SandboxTest

Details

Description

Whilst debugging blacklisting of static functions using the Sandbox class and unable to get it to work I checked the testcase SandboxTest. I subsequently found that the test of System.exit() in testRestrict() passes not because System.currentTimeMillis() is whitelisted but because of a signature mismatch i.e System.exit() requires an int parameter. Changing the expression to System.exit(1) causes the test to end prematruely due to exit() being called.

The white listing fails in SandboxUberspectImpl.getMethod() because obj is a Class and getClass().getName() returns "java.lang.Class" which doesn't match "java.lang.System" as specified in SandboxTest.testRestrict().