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 File: IIOPInputStream.java    From JDKSourceCode1.8 with 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 #2
Source File: IIOPInputStream.java    From openjdk-8-source with 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 File: IIOPInputStream.java    From jdk1.8-source-analysis with 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 #4
Source File: IIOPOutputStream.java    From openjdk-8-source with 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 #5
Source File: IIOPInputStream.java    From openjdk-8 with 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 #6
Source File: IIOPOutputStream.java    From hottub with 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 #7
Source File: IIOPInputStream.java    From hottub with 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 #8
Source File: IIOPInputStream.java    From TencentKona-8 with 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 File: IIOPInputStream.java    From openjdk-jdk8u-backup with 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 #10
Source File: IIOPInputStream.java    From jdk8u60 with 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 File: IIOPOutputStream.java    From jdk8u60 with 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 File: IIOPOutputStream.java    From openjdk-jdk8u with 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 #13
Source File: IIOPInputStream.java    From openjdk-jdk8u with 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 #14
Source File: IIOPOutputStream.java    From JDKSourceCode1.8 with 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 #15
Source File: IIOPOutputStream.java    From TencentKona-8 with 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 File: IIOPOutputStream.java    From openjdk-jdk8u-backup with 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 #17
Source File: RepositoryId.java    From openjdk-jdk8u-backup with 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 #18
Source File: RepositoryId.java    From openjdk-8-source with 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 #19
Source File: ObjectStreamClassUtil_1_3.java    From openjdk-jdk9 with 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 #20
Source File: RepositoryId.java    From openjdk-jdk9 with 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 #21
Source File: IIOPOutputStream.java    From openjdk-jdk8u-backup with 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 #22
Source File: ObjectStreamClassUtil_1_3.java    From openjdk-8-source with 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 #23
Source File: RepositoryId.java    From hottub with 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 #24
Source File: IIOPOutputStream.java    From openjdk-jdk8u with 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 #25
Source File: ObjectStreamClassUtil_1_3.java    From openjdk-8 with 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 #26
Source File: RepositoryId.java    From openjdk-jdk8u with 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 #27
Source File: ObjectStreamClassUtil_1_3.java    From openjdk-jdk8u with 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 #28
Source File: RepositoryId.java    From openjdk-8 with 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 #29
Source File: IIOPOutputStream.java    From hottub with 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 #30
Source File: ObjectStreamClassUtil_1_3.java    From openjdk-jdk8u-backup with 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;
    }