/*
(non-Javadoc)

@see SimplifiedSerialization.readObject(java.io.DataInputStream,ObjectManagerState)
548828
public void readObject(java.io.DataInputStream dataInputStream,
                           ObjectManagerState objectManagerState)
                    throws ObjectManagerException {
        final String methodName = "readObject";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, methodName, new Object[] { dataInputStream,
                                                                objectManagerState });

        try {
            byte version = dataInputStream.readByte();
            if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled())
                trace.debug(this, cclass, methodName, new Object[] { new Byte(version) });
            super.readObject(dataInputStream, objectManagerState);

            if (dataInputStream.readByte() == 1) {
                // Use ManagedObjectInpuStream so as to get the correct classloader.
                java.io.ObjectInputStream objectInputStream = new ManagedObjectInputStream(dataInputStream, objectManagerState);
                comparator = (java.util.Comparator) objectInputStream.readObject();
                objectInputStream.close();
            } // if (dataInputStream.readByte() == 1).
            if (dataInputStream.readByte() == 1) {
                root = Token.restore(dataInputStream
                                     , objectManagerState
                                );
            } // if (dataInputStream.readByte() == 1).
            size = dataInputStream.readLong();

        } catch (java.io.IOException exception) {
            // No FFDC Code Needed.
            ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:2412:1.44");

            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this, cclass, methodName, exception);
            throw new PermanentIOException(this, exception);

        } catch (java.lang.ClassNotFoundException exception) {
            // No FFDC Code Needed.
            ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:2420:1.44");

            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this, cclass, methodName, new Object[] { "ClassNotFoundException:2423",
                                                                   exception });
            throw new com.ibm.ws.objectManager.ClassNotFoundException(this, exception);
        } // try.

        availableSize = size; // Start as last commited.

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, methodName);
    }
203583
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        if ( null == this.object )
            return;
        Class<?> cls = this.object.getClass();
        if ( this.object instanceof Class )
            cls = (Class<?>) this.object;
        this.field = BshClassManager.memberCache.get(cls).findField(varName);
    }
125960
private void readObject(ObjectInputStream in) throws ClassNotFoundException, NoSuchMethodException, IOException {
        type = ClassRef.read(in);
        name = in.readUTF();
        val = in.readObject();
    }
1008622
private void readObject(java.io.ObjectInputStream objectInputStreamIn)
                    throws java.io.IOException
                    , java.lang.ClassNotFoundException
    {

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass
                        , "readObject"
                        , "objectInputStreamIn=" + objectInputStreamIn + "(java.io.ObjectInputStream)"
                            );

        objectInputStreamIn.defaultReadObject();
        availableSize = size; // Start as last commited.
        managedObjectsToAdd = new java.util.HashSet(1);
        managedObjectsToReplace = new java.util.HashSet();
        tokensToNotify = new java.util.HashSet(1); // Holds the set of tokens to notify about replacements. 

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass
                       , "readObject"
                            );

    }
384129
private void readObject(ObjectInputStream in) throws IOException,
	ClassNotFoundException {

		// Call the default implementation to de-serialize our object
		in.defaultReadObject();

		parent = new WeakReference<DepTreeNode>(null);

		// restore parent reference on all children
		if (children != null) {
			for (Entry<String, DepTreeNode> entry : children.entrySet()) {
				entry.getValue().setParent(this);
			}
		}
	}
868755
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
        ObjectInputStream.GetField getField = s.readFields();

        version = getField.get("version", 1);
        resourceAdapterKey = (String) getField.get("resourceAdapterKey", null);
    }
1336633
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
    {
        try
        {
            in.defaultReadObject();

            // p113380 - start of change
            // Read in eye catcher.
            byte[] ec = new byte[EYECATCHER_LENGTH];

            //d164415 start
            int bytesRead = 0;
            for (int offset = 0; offset < EYECATCHER_LENGTH; offset += bytesRead)
            {
                bytesRead = in.read(ec, offset, EYECATCHER_LENGTH - offset);
                if (bytesRead == -1)
                {
                    throw new IOException("end of input stream while reading eye catcher");
                }
            }
            //d164415 end

            // Validate that the eyecatcher matches
            for (int i = 0; i < EYECATCHER_LENGTH; i++)
            {
                if (EYECATCHER[i] != ec[i])
                {
                    String eyeCatcherString = new String(ec);
                    throw new IOException("Invalid eye catcher '" + eyeCatcherString + "' in EJBMetaData input stream");
                }
            }

            // read in the rest of the header.
            in.readShort(); // platform
            in.readShort(); // version
            // p113380 - end of change

            // Read in the common data
            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.readObject entry");
            }

            ivSession = in.readBoolean();
            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.readObject: ivSession = " + ivSession);
            }

            ivStatelessSession = in.readBoolean();
            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.readObject: ivStatelessSession = " + ivStatelessSession);
            }

            ClassLoader loader = (ClassLoader) AccessController.doPrivileged( // 363037
            new PrivilegedAction() {
                public java.lang.Object run() {
                    return Thread.currentThread().getContextClassLoader();
                }
            }
                            );

            ivBeanClassName = in.readUTF();//184994
            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.readObject: ivBeanClass is " + ivBeanClassName);//184994
            }

            ivHomeClass = loader.loadClass(in.readUTF());
            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.readObject: ivHomeClass is " + ivHomeClass);
            }

            ivRemoteClass = loader.loadClass(in.readUTF());
            if (ivSession == false)
            {
                ivPKClass = loader.loadClass(in.readUTF());
                if (DEBUG_ON)
                {
                    System.out.println("EJBMetaDataImpl.readObject loading PKEY class");
                    System.out.println("EJBMetaDataImpl.readObject: ivPKClass is " + ivPKClass);
                }
            }

            ivHomeHandle = (HomeHandle) in.readObject();
            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.readObject: read HomeHandle");
            }

            EJBHome ejbHomeStub = ivHomeHandle.getEJBHome();
            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.readObject: got EJBHome, doing narrow");
            }

            ivEjbHome = (EJBHome) PortableRemoteObject.narrow(ejbHomeStub, ivHomeClass);
            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.readObject normal exit");
            }
        } catch (IOException e)
        {
            // FFDCFilter.processException(e, CLASS_NAME + ".readObject", "346", this);
            if (DEBUG_ON)
            {
                System.out.println("***ERROR**** EJBMetaDataImpl.readObject caught unexpected exception");
                e.printStackTrace();
            }
            throw e;
        } catch (ClassNotFoundException e)
        {
            // FFDCFilter.processException(e, CLASS_NAME + ".readObject", "356", this);
            if (DEBUG_ON)
            {
                System.out.println("***ERROR**** EJBMetaDataImpl.readObject caught unexpected exception");
                e.printStackTrace();
            }
            throw e;
        }
    }
1129272
private void readObject(java.io.ObjectInputStream in) throws IOException,
                    ClassNotFoundException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "readObject");

        ivPuId = (JPAPuId) in.readObject();
        ivJ2eeName = (J2EEName) in.readObject(); // d510184

        // restore the provider factory from JPA Service via puInfo object.
        //F743-16027 - using JPAAccessor to get JPAComponent, rather than using cached (possibly stale) static reference
        JPAPUnitInfo puInfo = ((AbstractJPAComponent) JPAAccessor.getJPAComponent()).findPersistenceUnitInfo(ivPuId); // d416151.3.5, F743-18776

        ivFactory = puInfo.getEntityManagerFactory(ivJ2eeName); // d510184

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "readObject : " + this);
    }
754959
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
   {
      in.defaultReadObject();
      validatorFactory = BeanValidationImpl.createValidatorFactory();
   }
646669
@Trivial
    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        GetField fields = in.readFields();
        failure = (Throwable) fields.get(FAILURE, null);
        params = (String[]) fields.get(PARAMS, new String[] {});
        reason = fields.get(REASON, (short) 0);
    }
1147911
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        this.factoryLoader = ServiceLoader.load(PropertyFactory.class, PropertyFactory.class.getClassLoader());
    }
1290867
private void readObject(java.io.ObjectInputStream objectInputStream)
                    throws java.io.IOException
                    , java.lang.ClassNotFoundException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass,
                        "readObject",
                        "objectInputStream=" + objectInputStream + "(java.io.ObjectInputStream)");

        objectInputStream.defaultReadObject();
        // We cannot set the available head during recovery because the links may get deleted before
        // recovery is complete, instead force a scan when we use availableHead for the first time.    
        availableHead = null;
        availableSize = size; // All links are initially available.
        availableSizeLock = new Object();
        managedObjectsToAdd = new java.util.ArrayList(1);
        managedObjectsToReplace = new java.util.ArrayList(3);
        tokensToNotify = new java.util.ArrayList(1);

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass,
                       "readObject");
    }
537419
private void readObject(ObjectInputStream ois)
        throws IOException, ClassNotFoundException {
        // Read in the non-transient fields
        // (revocationDate, reason, authority)
        ois.defaultReadObject();

        // Defensively copy the revocation date
        revocationDate = new Date(revocationDate.getTime());

        // Read in the size (number of mappings) of the extensions map
        // and create the extensions map
        int size = ois.readInt();
        if (size == 0) {
            extensions = Collections.emptyMap();
        } else {
            extensions = new HashMap<String, Extension>(size);
        }

        // Read in the extensions and put the mappings in the extensions map
        for (int i = 0; i < size; i++) {
            String oid = (String) ois.readObject();
            boolean critical = ois.readBoolean();
            int length = ois.readInt();
            byte[] extVal = new byte[length];
            ois.readFully(extVal);
            Extension ext = sun.security.x509.Extension.newExtension
                (new ObjectIdentifier(oid), critical, extVal);
            extensions.put(oid, ext);
        }
    }
905305
void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
        // when deserializing, parse the json string
        try {
            int length = in.readInt();
            byte[] buf = new byte[length];
            in.readFully(buf);
            if (parser == null) {
                // create it lazily, static so won't increase object size
                parser = new JsonParser();
            }
            JsonElement o = parser.parse(new String(buf, StandardCharsets.UTF_8));
            Field f = getClass().getDeclaredField("intMap");
            f.setAccessible(true);
            f.set(this, new SimpleIntKeyMap<>());

            for (Entry<String, JsonElement> e : o.asObject().entrySet()) {
                put(e.getKey(), e.getValue());
            }
        } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
            throw new IllegalStateException(e);
        }
    }
1131880
private void readObject(ObjectInputStream in) throws ClassNotFoundException, NoSuchMethodException, IOException {
        result = ClassRef.read(in);
        arg = ClassRef.read(in);
        name = in.readUTF();
    }
404053
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        this.runtimeMetaData = new HashMap<String, Object>();
    }
410963
private void readObject(ObjectInputStream in)
        throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        if (null != params) {
            this.serializer = params.getDefaultSerializer();
        }
    }