com.sun.corba.se.impl.io.ObjectStreamClass Java Examples

The following examples show how to use com.sun.corba.se.impl.io.ObjectStreamClass. 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 Project: jdk1.8-source-analysis   Author: raysonfang   File: IIOPInputStream.java    License: Apache License 2.0 6 votes vote down vote up
private void resetStream() throws IOException {

        if (classes == null)
            classes = new Class[20];
        else {
            for (int i = 0; i < classes.length; i++)
                classes[i] = null;
        }
        if (classdesc == null)
            classdesc = new ObjectStreamClass[20];
        else {
            for (int i = 0; i < classdesc.length; i++)
                classdesc[i] = null;
        }
        spClass = 0;

        if (callbacks != null)
            callbacks.setSize(0);       // discard any pending callbacks
    }
 
Example #2
Source Project: TencentKona-8   Author: Tencent   File: IIOPInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void resetStream() throws IOException {

        if (classes == null)
            classes = new Class[20];
        else {
            for (int i = 0; i < classes.length; i++)
                classes[i] = null;
        }
        if (classdesc == null)
            classdesc = new ObjectStreamClass[20];
        else {
            for (int i = 0; i < classdesc.length; i++)
                classdesc[i] = null;
        }
        spClass = 0;

        if (callbacks != null)
            callbacks.setSize(0);       // discard any pending callbacks
    }
 
Example #3
Source Project: TencentKona-8   Author: Tencent   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private boolean checkSpecialClasses(Object obj) throws IOException {

        /*
         * If this is a class, don't allow substitution
         */
        //if (obj instanceof Class) {
        //    throw new IOException("Serialization of Class not supported");
        //}

        if (obj instanceof ObjectStreamClass) {
            // XXX I18N, Logging needed.
            throw new IOException("Serialization of ObjectStreamClass not supported");
        }

        return false;
    }
 
Example #4
Source Project: jdk8u60   Author: chenghanpeng   File: IIOPInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void resetStream() throws IOException {

        if (classes == null)
            classes = new Class[20];
        else {
            for (int i = 0; i < classes.length; i++)
                classes[i] = null;
        }
        if (classdesc == null)
            classdesc = new ObjectStreamClass[20];
        else {
            for (int i = 0; i < classdesc.length; i++)
                classdesc[i] = null;
        }
        spClass = 0;

        if (callbacks != null)
            callbacks.setSize(0);       // discard any pending callbacks
    }
 
Example #5
Source Project: jdk8u60   Author: chenghanpeng   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private boolean checkSpecialClasses(Object obj) throws IOException {

        /*
         * If this is a class, don't allow substitution
         */
        //if (obj instanceof Class) {
        //    throw new IOException("Serialization of Class not supported");
        //}

        if (obj instanceof ObjectStreamClass) {
            // XXX I18N, Logging needed.
            throw new IOException("Serialization of ObjectStreamClass not supported");
        }

        return false;
    }
 
Example #6
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: IIOPInputStream.java    License: MIT License 6 votes vote down vote up
private void resetStream() throws IOException {

        if (classes == null)
            classes = new Class[20];
        else {
            for (int i = 0; i < classes.length; i++)
                classes[i] = null;
        }
        if (classdesc == null)
            classdesc = new ObjectStreamClass[20];
        else {
            for (int i = 0; i < classdesc.length; i++)
                classdesc[i] = null;
        }
        spClass = 0;

        if (callbacks != null)
            callbacks.setSize(0);       // discard any pending callbacks
    }
 
Example #7
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: IIOPOutputStream.java    License: MIT License 6 votes vote down vote up
private boolean checkSpecialClasses(Object obj) throws IOException {

        /*
         * If this is a class, don't allow substitution
         */
        //if (obj instanceof Class) {
        //    throw new IOException("Serialization of Class not supported");
        //}

        if (obj instanceof ObjectStreamClass) {
            // XXX I18N, Logging needed.
            throw new IOException("Serialization of ObjectStreamClass not supported");
        }

        return false;
    }
 
Example #8
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: IIOPInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void resetStream() throws IOException {

        if (classes == null)
            classes = new Class[20];
        else {
            for (int i = 0; i < classes.length; i++)
                classes[i] = null;
        }
        if (classdesc == null)
            classdesc = new ObjectStreamClass[20];
        else {
            for (int i = 0; i < classdesc.length; i++)
                classdesc[i] = null;
        }
        spClass = 0;

        if (callbacks != null)
            callbacks.setSize(0);       // discard any pending callbacks
    }
 
Example #9
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private boolean checkSpecialClasses(Object obj) throws IOException {

        /*
         * If this is a class, don't allow substitution
         */
        //if (obj instanceof Class) {
        //    throw new IOException("Serialization of Class not supported");
        //}

        if (obj instanceof ObjectStreamClass) {
            // XXX I18N, Logging needed.
            throw new IOException("Serialization of ObjectStreamClass not supported");
        }

        return false;
    }
 
Example #10
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: IIOPInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void resetStream() throws IOException {

        if (classes == null)
            classes = new Class[20];
        else {
            for (int i = 0; i < classes.length; i++)
                classes[i] = null;
        }
        if (classdesc == null)
            classdesc = new ObjectStreamClass[20];
        else {
            for (int i = 0; i < classdesc.length; i++)
                classdesc[i] = null;
        }
        spClass = 0;

        if (callbacks != null)
            callbacks.setSize(0);       // discard any pending callbacks
    }
 
Example #11
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private boolean checkSpecialClasses(Object obj) throws IOException {

        /*
         * If this is a class, don't allow substitution
         */
        //if (obj instanceof Class) {
        //    throw new IOException("Serialization of Class not supported");
        //}

        if (obj instanceof ObjectStreamClass) {
            // XXX I18N, Logging needed.
            throw new IOException("Serialization of ObjectStreamClass not supported");
        }

        return false;
    }
 
Example #12
Source Project: hottub   Author: dsrg-uoft   File: IIOPInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void resetStream() throws IOException {

        if (classes == null)
            classes = new Class[20];
        else {
            for (int i = 0; i < classes.length; i++)
                classes[i] = null;
        }
        if (classdesc == null)
            classdesc = new ObjectStreamClass[20];
        else {
            for (int i = 0; i < classdesc.length; i++)
                classdesc[i] = null;
        }
        spClass = 0;

        if (callbacks != null)
            callbacks.setSize(0);       // discard any pending callbacks
    }
 
Example #13
Source Project: hottub   Author: dsrg-uoft   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private boolean checkSpecialClasses(Object obj) throws IOException {

        /*
         * If this is a class, don't allow substitution
         */
        //if (obj instanceof Class) {
        //    throw new IOException("Serialization of Class not supported");
        //}

        if (obj instanceof ObjectStreamClass) {
            // XXX I18N, Logging needed.
            throw new IOException("Serialization of ObjectStreamClass not supported");
        }

        return false;
    }
 
Example #14
Source Project: openjdk-8-source   Author: keerath   File: IIOPInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void resetStream() throws IOException {

        if (classes == null)
            classes = new Class[20];
        else {
            for (int i = 0; i < classes.length; i++)
                classes[i] = null;
        }
        if (classdesc == null)
            classdesc = new ObjectStreamClass[20];
        else {
            for (int i = 0; i < classdesc.length; i++)
                classdesc[i] = null;
        }
        spClass = 0;

        if (callbacks != null)
            callbacks.setSize(0);       // discard any pending callbacks
    }
 
Example #15
Source Project: openjdk-8-source   Author: keerath   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private boolean checkSpecialClasses(Object obj) throws IOException {

        /*
         * If this is a class, don't allow substitution
         */
        //if (obj instanceof Class) {
        //    throw new IOException("Serialization of Class not supported");
        //}

        if (obj instanceof ObjectStreamClass) {
            // XXX I18N, Logging needed.
            throw new IOException("Serialization of ObjectStreamClass not supported");
        }

        return false;
    }
 
Example #16
Source Project: openjdk-8   Author: bpupadhyaya   File: IIOPInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void resetStream() throws IOException {

        if (classes == null)
            classes = new Class[20];
        else {
            for (int i = 0; i < classes.length; i++)
                classes[i] = null;
        }
        if (classdesc == null)
            classdesc = new ObjectStreamClass[20];
        else {
            for (int i = 0; i < classdesc.length; i++)
                classdesc[i] = null;
        }
        spClass = 0;

        if (callbacks != null)
            callbacks.setSize(0);       // discard any pending callbacks
    }
 
Example #17
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: ObjectStreamClassUtil_1_3.java    License: Apache License 2.0 5 votes vote down vote up
public static long computeSerialVersionUID(final Class cl) {

        long csuid = ObjectStreamClass.getSerialVersionUID(cl);
        if (csuid == 0)
            return csuid; // for non-serializable/proxy classes

        csuid = (ObjectStreamClassUtil_1_3.getSerialVersion(csuid, cl).longValue());
        return csuid;
    }
 
Example #18
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: RepositoryId.java    License: Apache License 2.0 5 votes vote down vote up
private static String createHashString(java.lang.Class clazz) {

        if (clazz.isInterface() || !java.io.Serializable.class.isAssignableFrom(clazz))
            return kInterfaceHashCode;

        //ObjectStreamClass osc = ObjectStreamClass.lookup(clazz);

        long actualLong = ObjectStreamClass.getActualSerialVersionUID(clazz);
        String hash = null;
        if (actualLong == 0)
            hash = kInterfaceOnlyHashStr;
        else if (actualLong == 1)
            hash = kExternalizableHashStr;
        else
            hash = Long.toHexString(actualLong).toUpperCase();
        while(hash.length() < 16){
            hash = "0" + hash;
        }

        long declaredLong = ObjectStreamClass.getSerialVersionUID(clazz);
        String declared = null;
        if (declaredLong == 0)
            declared = kInterfaceOnlyHashStr;
        else if (declaredLong == 1)
            declared = kExternalizableHashStr;
        else
            declared = Long.toHexString(declaredLong).toUpperCase();
        while (declared.length() < 16){
            declared = "0" + declared;
    }
        hash = hash + ":" + declared;

        return ":" + hash;
    }
 
Example #19
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: IIOPOutputStream.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Override the actions of the final method "writeObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void simpleWriteObject(Object obj, byte formatVersion)
/* throws IOException */
{
    byte oldStreamFormatVersion = streamFormatVersion;

    streamFormatVersion = formatVersion;

    Object prevObject = currentObject;
    ObjectStreamClass prevClassDesc = currentClassDesc;
    simpleWriteDepth++;

    try {
        // if (!checkSpecialClasses(obj) && !checkSubstitutableSpecialClasses(obj))
        outputObject(obj);

    } catch (IOException ee) {
        if (abortIOException == null)
            abortIOException = ee;
    } finally {
        /* Restore state of previous call incase this is a nested call */
        streamFormatVersion = oldStreamFormatVersion;
        simpleWriteDepth--;
        currentObject = prevObject;
        currentClassDesc = prevClassDesc;
    }

    /* If the recursion depth is 0, test for and clear the pending exception.
     * If there is a pending exception throw it.
     */
    IOException pending = abortIOException;
    if (simpleWriteDepth == 0)
        abortIOException = null;
    if (pending != null) {
        bridge.throwException( pending ) ;
    }
}
 
Example #20
Source Project: TencentKona-8   Author: Tencent   File: ObjectStreamClassUtil_1_3.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static long computeSerialVersionUID(final Class cl) {

        long csuid = ObjectStreamClass.getSerialVersionUID(cl);
        if (csuid == 0)
            return csuid; // for non-serializable/proxy classes

        csuid = (ObjectStreamClassUtil_1_3.getSerialVersion(csuid, cl).longValue());
        return csuid;
    }
 
Example #21
Source Project: TencentKona-8   Author: Tencent   File: RepositoryId.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static String createHashString(java.lang.Class clazz) {

        if (clazz.isInterface() || !java.io.Serializable.class.isAssignableFrom(clazz))
            return kInterfaceHashCode;

        //ObjectStreamClass osc = ObjectStreamClass.lookup(clazz);

        long actualLong = ObjectStreamClass.getActualSerialVersionUID(clazz);
        String hash = null;
        if (actualLong == 0)
            hash = kInterfaceOnlyHashStr;
        else if (actualLong == 1)
            hash = kExternalizableHashStr;
        else
            hash = Long.toHexString(actualLong).toUpperCase();
        while(hash.length() < 16){
            hash = "0" + hash;
        }

        long declaredLong = ObjectStreamClass.getSerialVersionUID(clazz);
        String declared = null;
        if (declaredLong == 0)
            declared = kInterfaceOnlyHashStr;
        else if (declaredLong == 1)
            declared = kExternalizableHashStr;
        else
            declared = Long.toHexString(declaredLong).toUpperCase();
        while (declared.length() < 16){
            declared = "0" + declared;
    }
        hash = hash + ":" + declared;

        return ":" + hash;
    }
 
Example #22
Source Project: TencentKona-8   Author: Tencent   File: IIOPOutputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Override the actions of the final method "writeObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void simpleWriteObject(Object obj, byte formatVersion)
/* throws IOException */
{
    byte oldStreamFormatVersion = streamFormatVersion;

    streamFormatVersion = formatVersion;

    Object prevObject = currentObject;
    ObjectStreamClass prevClassDesc = currentClassDesc;
    simpleWriteDepth++;

    try {
        // if (!checkSpecialClasses(obj) && !checkSubstitutableSpecialClasses(obj))
        outputObject(obj);

    } catch (IOException ee) {
        if (abortIOException == null)
            abortIOException = ee;
    } finally {
        /* Restore state of previous call incase this is a nested call */
        streamFormatVersion = oldStreamFormatVersion;
        simpleWriteDepth--;
        currentObject = prevObject;
        currentClassDesc = prevClassDesc;
    }

    /* If the recursion depth is 0, test for and clear the pending exception.
     * If there is a pending exception throw it.
     */
    IOException pending = abortIOException;
    if (simpleWriteDepth == 0)
        abortIOException = null;
    if (pending != null) {
        bridge.throwException( pending ) ;
    }
}
 
Example #23
Source Project: jdk8u60   Author: chenghanpeng   File: ObjectStreamClassUtil_1_3.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static long computeSerialVersionUID(final Class cl) {

        long csuid = ObjectStreamClass.getSerialVersionUID(cl);
        if (csuid == 0)
            return csuid; // for non-serializable/proxy classes

        csuid = (ObjectStreamClassUtil_1_3.getSerialVersion(csuid, cl).longValue());
        return csuid;
    }
 
Example #24
Source Project: jdk8u60   Author: chenghanpeng   File: RepositoryId.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static String createHashString(java.lang.Class clazz) {

        if (clazz.isInterface() || !java.io.Serializable.class.isAssignableFrom(clazz))
            return kInterfaceHashCode;

        //ObjectStreamClass osc = ObjectStreamClass.lookup(clazz);

        long actualLong = ObjectStreamClass.getActualSerialVersionUID(clazz);
        String hash = null;
        if (actualLong == 0)
            hash = kInterfaceOnlyHashStr;
        else if (actualLong == 1)
            hash = kExternalizableHashStr;
        else
            hash = Long.toHexString(actualLong).toUpperCase();
        while(hash.length() < 16){
            hash = "0" + hash;
        }

        long declaredLong = ObjectStreamClass.getSerialVersionUID(clazz);
        String declared = null;
        if (declaredLong == 0)
            declared = kInterfaceOnlyHashStr;
        else if (declaredLong == 1)
            declared = kExternalizableHashStr;
        else
            declared = Long.toHexString(declaredLong).toUpperCase();
        while (declared.length() < 16){
            declared = "0" + declared;
    }
        hash = hash + ":" + declared;

        return ":" + hash;
    }
 
Example #25
Source Project: jdk8u60   Author: chenghanpeng   File: IIOPOutputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Override the actions of the final method "writeObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void simpleWriteObject(Object obj, byte formatVersion)
/* throws IOException */
{
    byte oldStreamFormatVersion = streamFormatVersion;

    streamFormatVersion = formatVersion;

    Object prevObject = currentObject;
    ObjectStreamClass prevClassDesc = currentClassDesc;
    simpleWriteDepth++;

    try {
        // if (!checkSpecialClasses(obj) && !checkSubstitutableSpecialClasses(obj))
        outputObject(obj);

    } catch (IOException ee) {
        if (abortIOException == null)
            abortIOException = ee;
    } finally {
        /* Restore state of previous call incase this is a nested call */
        streamFormatVersion = oldStreamFormatVersion;
        simpleWriteDepth--;
        currentObject = prevObject;
        currentClassDesc = prevClassDesc;
    }

    /* If the recursion depth is 0, test for and clear the pending exception.
     * If there is a pending exception throw it.
     */
    IOException pending = abortIOException;
    if (simpleWriteDepth == 0)
        abortIOException = null;
    if (pending != null) {
        bridge.throwException( pending ) ;
    }
}
 
Example #26
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: ObjectStreamClassUtil_1_3.java    License: MIT License 5 votes vote down vote up
public static long computeSerialVersionUID(final Class cl) {

        long csuid = ObjectStreamClass.getSerialVersionUID(cl);
        if (csuid == 0)
            return csuid; // for non-serializable/proxy classes

        csuid = (ObjectStreamClassUtil_1_3.getSerialVersion(csuid, cl).longValue());
        return csuid;
    }
 
Example #27
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: RepositoryId.java    License: MIT License 5 votes vote down vote up
private static String createHashString(java.lang.Class clazz) {

        if (clazz.isInterface() || !java.io.Serializable.class.isAssignableFrom(clazz))
            return kInterfaceHashCode;

        //ObjectStreamClass osc = ObjectStreamClass.lookup(clazz);

        long actualLong = ObjectStreamClass.getActualSerialVersionUID(clazz);
        String hash = null;
        if (actualLong == 0)
            hash = kInterfaceOnlyHashStr;
        else if (actualLong == 1)
            hash = kExternalizableHashStr;
        else
            hash = Long.toHexString(actualLong).toUpperCase();
        while(hash.length() < 16){
            hash = "0" + hash;
        }

        long declaredLong = ObjectStreamClass.getSerialVersionUID(clazz);
        String declared = null;
        if (declaredLong == 0)
            declared = kInterfaceOnlyHashStr;
        else if (declaredLong == 1)
            declared = kExternalizableHashStr;
        else
            declared = Long.toHexString(declaredLong).toUpperCase();
        while (declared.length() < 16){
            declared = "0" + declared;
    }
        hash = hash + ":" + declared;

        return ":" + hash;
    }
 
Example #28
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: IIOPOutputStream.java    License: MIT License 5 votes vote down vote up
/**
 * Override the actions of the final method "writeObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void simpleWriteObject(Object obj, byte formatVersion)
/* throws IOException */
{
    byte oldStreamFormatVersion = streamFormatVersion;

    streamFormatVersion = formatVersion;

    Object prevObject = currentObject;
    ObjectStreamClass prevClassDesc = currentClassDesc;
    simpleWriteDepth++;

    try {
        // if (!checkSpecialClasses(obj) && !checkSubstitutableSpecialClasses(obj))
        outputObject(obj);

    } catch (IOException ee) {
        if (abortIOException == null)
            abortIOException = ee;
    } finally {
        /* Restore state of previous call incase this is a nested call */
        streamFormatVersion = oldStreamFormatVersion;
        simpleWriteDepth--;
        currentObject = prevObject;
        currentClassDesc = prevClassDesc;
    }

    /* If the recursion depth is 0, test for and clear the pending exception.
     * If there is a pending exception throw it.
     */
    IOException pending = abortIOException;
    if (simpleWriteDepth == 0)
        abortIOException = null;
    if (pending != null) {
        bridge.throwException( pending ) ;
    }
}
 
Example #29
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: ObjectStreamClassUtil_1_3.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static long computeSerialVersionUID(final Class cl) {

        long csuid = ObjectStreamClass.getSerialVersionUID(cl);
        if (csuid == 0)
            return csuid; // for non-serializable/proxy classes

        csuid = (ObjectStreamClassUtil_1_3.getSerialVersion(csuid, cl).longValue());
        return csuid;
    }
 
Example #30
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: RepositoryId.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static String createHashString(java.lang.Class clazz) {

        if (clazz.isInterface() || !java.io.Serializable.class.isAssignableFrom(clazz))
            return kInterfaceHashCode;

        //ObjectStreamClass osc = ObjectStreamClass.lookup(clazz);

        long actualLong = ObjectStreamClass.getActualSerialVersionUID(clazz);
        String hash = null;
        if (actualLong == 0)
            hash = kInterfaceOnlyHashStr;
        else if (actualLong == 1)
            hash = kExternalizableHashStr;
        else
            hash = Long.toHexString(actualLong).toUpperCase();
        while(hash.length() < 16){
            hash = "0" + hash;
        }

        long declaredLong = ObjectStreamClass.getSerialVersionUID(clazz);
        String declared = null;
        if (declaredLong == 0)
            declared = kInterfaceOnlyHashStr;
        else if (declaredLong == 1)
            declared = kExternalizableHashStr;
        else
            declared = Long.toHexString(declaredLong).toUpperCase();
        while (declared.length() < 16){
            declared = "0" + declared;
    }
        hash = hash + ":" + declared;

        return ":" + hash;
    }