java.io.ObjectStreamClass.WeakClassKey Java Examples

The following examples show how to use java.io.ObjectStreamClass.WeakClassKey. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ObjectInputStream.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #2
Source File: ObjectInputStream.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #3
Source File: ObjectOutputStream.java    From Java8CN with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #4
Source File: ObjectInputStream.java    From Java8CN with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #5
Source File: ObjectOutputStream.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #6
Source File: ObjectInputStream.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #7
Source File: ObjectOutputStream.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #8
Source File: ObjectInputStream.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #9
Source File: ObjectOutputStream.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #10
Source File: ObjectOutputStream.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #11
Source File: ObjectOutputStream.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #12
Source File: ObjectInputStream.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #13
Source File: ObjectOutputStream.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #14
Source File: ObjectInputStream.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #15
Source File: ObjectOutputStream.java    From jdk-1.7-annotated with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #16
Source File: ObjectInputStream.java    From jdk-1.7-annotated with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #17
Source File: ObjectOutputStream.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #18
Source File: ObjectInputStream.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #19
Source File: ObjectInputStream.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #20
Source File: ObjectInputStream.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #21
Source File: ObjectOutputStream.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #22
Source File: ObjectInputStream.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #23
Source File: ObjectOutputStream.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #24
Source File: ObjectInputStream.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #25
Source File: ObjectOutputStream.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #26
Source File: ObjectInputStream.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #27
Source File: ObjectOutputStream.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #28
Source File: ObjectOutputStream.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #29
Source File: ObjectOutputStream.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectOutputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}
 
Example #30
Source File: ObjectInputStream.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Verifies that this (possibly subclass) instance can be constructed
 * without violating security constraints: the subclass must not override
 * security-sensitive non-final methods, or else the
 * "enableSubclassImplementation" SerializablePermission is checked.
 */
private void verifySubclass() {
    Class<?> cl = getClass();
    if (cl == ObjectInputStream.class) {
        return;
    }
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        return;
    }
    processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
    WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
    Boolean result = Caches.subclassAudits.get(key);
    if (result == null) {
        result = Boolean.valueOf(auditSubclass(cl));
        Caches.subclassAudits.putIfAbsent(key, result);
    }
    if (result.booleanValue()) {
        return;
    }
    sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
}