private static Void checkPermission() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new SerializablePermission( "enableSubclassImplementation")); } return null; }
@Override public Object run() { new SerializablePermission("enableSubclassImplementation").checkGuard(null); new SerializablePermission("enableSubstitution").checkGuard(null); return null; } });
private static Void checkPermission() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { if (!allowSubclass) sm.checkPermission(new SerializablePermission("enableSubclassImplementation")); } return null; }
private static Void checkPermission() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { if (!allowSubclass) sm.checkPermission(new SerializablePermission("enableSubclassImplementation")); } return null; } private OutputStream(Void ignore) { }
private static void isCustomSerializationPermitted() { SecurityManager sm = System.getSecurityManager(); if (!allowCustomValueHandler) { if ( sm != null) { // check that a serialization permission has been // set to allow the loading of the Util delegate // which provides access to custom ValueHandler sm.checkPermission(new SerializablePermission( "enableCustomValueHandler")); } } } }
@RequiresNonNull("name") public SerializablePermission build() { return new SerializablePermission(name, actions); }
@Test public void testCommitThrowsNullPointerException2() throws Throwable { LogEvent evt = new LogEvent(); try { transactionManager.commit(1, 100L, new SerializablePermission("testTransactionManagerParam1"), null, true, evt, null); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull("ex.getMessage()", ex.getMessage()); } }
add(new SerializablePermission("creator")); add(new SerializablePermission("allowSerializationReflection")); add(new SerializablePermission("enableSubclassImplementation")); add(new RuntimePermission("reflectionFactoryAccess"));