Java 类java.io.SerializablePermission 实例源码

项目:OpenJSharp    文件:InputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:OpenJSharp    文件:OutputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:OpenJSharp    文件:StubFactoryDynamicBase.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
项目:marshalsec    文件:SideEffectSecurityManager.java   
/**
 * {@inheritDoc}
 *
 * @see java.lang.SecurityManager#checkPermission(java.security.Permission)
 */
@Override
public void checkPermission ( Permission perm ) {
    if ( perm instanceof RuntimePermission ) {
        if ( checkRuntimePermission((RuntimePermission) perm) ) {
            return;
        }
    }
    else if ( perm instanceof ReflectPermission ) {
        return;
    }
    else if ( perm instanceof LoggingPermission ) {
        return;
    }
    else if ( perm instanceof SecurityPermission ) {
        return;
    }
    else if ( perm instanceof PropertyPermission ) {
        return;
    }
    else if ( perm instanceof NetPermission && perm.getName().equals("specifyStreamHandler") ) {
        return;
    }
    else if ( perm instanceof FilePermission && perm.getActions().equals("read") ) {
        return;
    }
    else if ( perm instanceof SerializablePermission ) {
        return;
    }

    super.checkPermission(perm);
}
项目:jdk8u-jdk    文件:ObjectInputFilter.java   
/**
 * Set the process-wide filter if it has not already been configured or set.
 *
 * @param filter the serialization filter to set as the process-wide filter; not null
 * @throws SecurityException if there is security manager and the
 *       {@code SerializablePermission("serialFilter")} is not granted
 * @throws IllegalStateException if the filter has already been set {@code non-null}
 */
public static void setSerialFilter(ObjectInputFilter filter) {
    Objects.requireNonNull(filter, "filter");
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission("serialFilter"));
    }
    synchronized (serialFilterLock) {
        if (serialFilter != null) {
            throw new IllegalStateException("Serial filter can only be set once");
        }
        serialFilter = filter;
    }
}
项目:openjdk-jdk10    文件:InputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:openjdk-jdk10    文件:OutputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:openjdk-jdk10    文件:StubFactoryDynamicBase.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
项目:openjdk-jdk10    文件:Util.java   
private static void isCustomSerializationPermitted() {
        SecurityManager sm = System.getSecurityManager();
        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"));
}
    }
项目:openjdk9    文件:InputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:openjdk9    文件:OutputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:openjdk9    文件:StubFactoryDynamicBase.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
项目:Java8CN    文件:InputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:Java8CN    文件:OutputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:jdk8u_jdk    文件:ObjectInputFilter.java   
/**
 * Set the process-wide filter if it has not already been configured or set.
 *
 * @param filter the serialization filter to set as the process-wide filter; not null
 * @throws SecurityException if there is security manager and the
 *       {@code SerializablePermission("serialFilter")} is not granted
 * @throws IllegalStateException if the filter has already been set {@code non-null}
 */
public static void setSerialFilter(ObjectInputFilter filter) {
    Objects.requireNonNull(filter, "filter");
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission("serialFilter"));
    }
    synchronized (serialFilterLock) {
        if (serialFilter != null) {
            throw new IllegalStateException("Serial filter can only be set once");
        }
        serialFilter = filter;
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:InputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:lookaside_java-1.8.0-openjdk    文件:OutputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:lookaside_java-1.8.0-openjdk    文件:StubFactoryDynamicBase.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
项目:lookaside_java-1.8.0-openjdk    文件:Util.java   
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"));
        }
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:ObjectInputFilter.java   
/**
 * Set the process-wide filter if it has not already been configured or set.
 *
 * @param filter the serialization filter to set as the process-wide filter; not null
 * @throws SecurityException if there is security manager and the
 *       {@code SerializablePermission("serialFilter")} is not granted
 * @throws IllegalStateException if the filter has already been set {@code non-null}
 */
public static void setSerialFilter(ObjectInputFilter filter) {
    Objects.requireNonNull(filter, "filter");
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission("serialFilter"));
    }
    synchronized (serialFilterLock) {
        if (serialFilter != null) {
            throw new IllegalStateException("Serial filter can only be set once");
        }
        serialFilter = filter;
    }
}
项目:jdk8u_corba    文件:InputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:jdk8u_corba    文件:OutputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:jdk8u_corba    文件:StubFactoryDynamicBase.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
项目:jdk8u_corba    文件:Util.java   
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"));
        }
    }
}
项目:infobip-open-jdk-8    文件:InputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:infobip-open-jdk-8    文件:OutputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:infobip-open-jdk-8    文件:StubFactoryDynamicBase.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
项目:In-the-Box-Fork    文件:SerializablePermissionTest.java   
/**
 * @tests java.io.SerializablePermission#SerializablePermission(java.lang.String)
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "SerializablePermission",
    args = {java.lang.String.class}
)
public void test_ConstructorLjava_lang_String() {
    // Test for method java.io.SerializablePermission(java.lang.String)
    assertEquals("permission ill-formed",
            "enableSubclassImplementation", new SerializablePermission(
            "enableSubclassImplementation").getName());
}
项目:In-the-Box-Fork    文件:SerializablePermissionTest.java   
/**
 * @tests java.io.SerializablePermission#SerializablePermission(java.lang.String,
 *        java.lang.String)
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "SerializablePermission",
    args = {java.lang.String.class, java.lang.String.class}
)
public void test_ConstructorLjava_lang_StringLjava_lang_String() {
    // Test for method java.io.SerializablePermission(java.lang.String,
    // java.lang.String)
    assertEquals("permission ill-formed",
            "enableSubclassImplementation", new SerializablePermission(
            "enableSubclassImplementation", "").getName());
}
项目:OLD-OpenJDK8    文件:InputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:OLD-OpenJDK8    文件:OutputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:OLD-OpenJDK8    文件:StubFactoryDynamicBase.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
项目:cn1    文件:SerializablePermissionTest.java   
/**
 * @tests java.io.SerializablePermission#SerializablePermission(java.lang.String)
 */
public void test_ConstructorLjava_lang_String() {
    // Test for method java.io.SerializablePermission(java.lang.String)
    assertEquals("permission ill-formed", 
            "enableSubclassImplementation", new SerializablePermission(
            "enableSubclassImplementation").getName());
}
项目:cn1    文件:SerializablePermissionTest.java   
/**
 * @tests java.io.SerializablePermission#SerializablePermission(java.lang.String,
 *        java.lang.String)
 */
public void test_ConstructorLjava_lang_StringLjava_lang_String() {
    // Test for method java.io.SerializablePermission(java.lang.String,
    // java.lang.String)
    assertEquals("permission ill-formed", 
            "enableSubclassImplementation", new SerializablePermission(
            "enableSubclassImplementation", "").getName());
}
项目:openjdk-orb    文件:InputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:openjdk-orb    文件:OutputStream.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
项目:openjdk-orb    文件:StubFactoryDynamicBase.java   
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
项目:openjdk-orb    文件:Util.java   
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"));
        }
    }
}
项目:freeVM    文件:SerializablePermissionTest.java   
/**
 * @tests java.io.SerializablePermission#SerializablePermission(java.lang.String)
 */
public void test_ConstructorLjava_lang_String() {
    // Test for method java.io.SerializablePermission(java.lang.String)
    assertEquals("permission ill-formed", 
            "enableSubclassImplementation", new SerializablePermission(
            "enableSubclassImplementation").getName());
}
项目:freeVM    文件:SerializablePermissionTest.java   
/**
 * @tests java.io.SerializablePermission#SerializablePermission(java.lang.String,
 *        java.lang.String)
 */
public void test_ConstructorLjava_lang_StringLjava_lang_String() {
    // Test for method java.io.SerializablePermission(java.lang.String,
    // java.lang.String)
    assertEquals("permission ill-formed", 
            "enableSubclassImplementation", new SerializablePermission(
            "enableSubclassImplementation", "").getName());
}