restore the state of this object from stream
including the scope information, only if the
scoped interface name is valid on this system
190405
private void readObject(ObjectInputStream s)
        throws IOException, ClassNotFoundException {
        scope_ifname = null;
        scope_ifname_set = false;

        if (getClass().getClassLoader() != Class.class.getClassLoader()) {
            throw new SecurityException ("invalid address type");
        }

        s.defaultReadObject();

        if (ifname != null && !"".equals (ifname)) {
            try {
                scope_ifname = NetworkInterface.getByName(ifname);
                if (scope_ifname == null) {
                    /* the interface does not exist on this system, so we clear
                     * the scope information completely */
                    scope_id_set = false;
                    scope_ifname_set = false;
                    scope_id = 0;
                } else {
                    try {
                        scope_id = deriveNumericScope (scope_ifname);
                    } catch (UnknownHostException e) {
                        // typically should not happen, but it may be that
                        // the machine being used for deserialization has
                        // the same interface name but without IPv6 configured.
                    }
                }
            } catch (SocketException e) {}

        }
        /* if ifname was not supplied, then the numeric info is used */

        ipaddress = ipaddress.clone();

        // Check that our invariants are satisfied
        if (ipaddress.length != INADDRSZ) {
            throw new InvalidObjectException("invalid address length: "+
                                             ipaddress.length);
        }

        if (holder().getFamily() != AF_INET6) {
            throw new InvalidObjectException("invalid address family type");
        }
    }
1355614
private synchronized void writeObject(java.io.ObjectOutputStream s)
        throws IOException
    {
        if (scope_ifname_set) {
            ifname = scope_ifname.getName();
        }
        s.defaultWriteObject();
    }
886315
private Cache getScopeCache(String scope) throws InvalidScopeException {
        Cache scopeCache = scopeManager.getCache(scope);
        if (scopeCache == null) {
            throw new InvalidScopeException("The scope " + scope + " doesn't exist");
        } else {
            return scopeCache;
        }
    }
1263284
def without_global_scope(self, scope):
        
        if isinstance(scope, basestring):
            del self._scopes[scope]

            return self

        keys = []
        for key, value in self._scopes.items():
            if scope == value.__class__ or isinstance(scope, value.__class__):
                keys.append(key)

        for key in keys:
            del self._scopes[key]

        return self
381708
public void restore(HttpServletRequest req, HttpServletResponse res, boolean anyMethod) {
		if (!(req instanceof IExtendedRequest)) {
			if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
				Tr.debug(tc, "It is not an IExtendedRequest object");
			}
			return;
		}
		if (!anyMethod && !req.getMethod().equalsIgnoreCase("GET")) {
			return;
		}

		String reqURL = req.getRequestURI();
		IExtendedRequest extRequest = (IExtendedRequest) req;
		if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
			Tr.debug(tc, " method : " + req.getMethod() + " URL:" + reqURL);
		}
		String postParamSaveMethod = webAppSecurityConfig.getPostParamSaveMethod();
		if (postParamSaveMethod.equalsIgnoreCase(WebAppSecurityConfig.POST_PARAM_SAVE_TO_COOKIE)) {
			restoreFromCookie(extRequest, res, reqURL);
		} else if (postParamSaveMethod.equalsIgnoreCase(WebAppSecurityConfig.POST_PARAM_SAVE_TO_SESSION)) {
			restoreFromSession(extRequest, req, reqURL);
		}
	}
684805
public void restoreTransientState(FacesContext context, Object state)
    {
        boolean forceCreate = (state != null);
        TransientStateHelper helper = getTransientStateHelper(forceCreate);

        if (helper != null) {
            helper.restoreTransientState(context, state);
        }
    }
126765
@Override
    public void sawOpcode(int seen) {
        boolean reset = true;
        switch (state) { // TODO: Refactor this to use state pattern, not nested
                         // switches
            case SEEN_NOTHING:
                reset = sawOpcodeAfterNothing(seen);
            break;

            case SEEN_ALOAD:
                reset = sawOpcodeAfterLoad(seen);
            break;

            case SEEN_GETFIELD:
                reset = sawOpcodeAfterGetField(seen);
            break;

            case SEEN_DUAL_LOADS:
                reset = sawOpcodeAfterDualLoads(seen);
            break;

            case SEEN_INVOKEVIRTUAL:
                if (seen == Const.INVOKEVIRTUAL) {
                    checkForSGSU();
                }
            break;
        }

        if (reset) {
            beanReference1 = null;
            beanReference2 = null;
            propType = null;
            propName = null;
            sawField = false;
            state = State.SEEN_NOTHING;
        }
    }
1240812
protected IStreamAwareScopeHandler getStreamAwareHandler() {
        if (scope != null) {
            IScopeHandler handler = scope.getHandler();
            if (handler instanceof IStreamAwareScopeHandler) {
                return (IStreamAwareScopeHandler) handler;
            }
        }
        return null;
    }
989398
def current(self):
        
        if self.obj is not None:
            return {name: mstate(self.obj, self.cls)
                for name, mstate in self.statemanager.states.items()
                if mstate(self.obj, self.cls)}
417674
def _get_scope_with_symbol(self, name):
        """"""
        scope = self
        while True:
            parent = scope.get_enclosing_scope()
            if parent is None:
                return

            if name in parent.symbols:
                return parent

            scope = parent
402883
private void readObject(java.io.ObjectInputStream in)
                    throws IOException,
                    ClassNotFoundException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "readObject : " + this); // d468174

        ivAbstractJPAComponent = (AbstractJPAComponent) JPAAccessor.getJPAComponent();

        ivPuRefId = (JPAPuId) in.readObject();
        ivJ2eeName = (J2EEName) in.readObject(); // d510184
        ivRefName = (String) in.readObject(); // d510184
        ivProperties = (Map<?, ?>) in.readObject();
        ivUnsynchronized = in.readBoolean();

        //F743-16027 - using JPAAccessor to get JPAComponent, rather than using cached (possibly stale) static reference
        ivPuInfo = ivAbstractJPAComponent.findPersistenceUnitInfo(ivPuRefId); // F743-18776
        ivTxKeyPuId = ivPuInfo.getPuId(); // d689596

        // Obtain reference to the pool again.                             d510184
        ivEntityManagerPool = ivPuInfo.getEntityManagerPool(ivJ2eeName,
                                                            ivRefName,
                                                            ivProperties);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "readObject : " + this);
    }
956745
public void restoreState(FacesContext facesContext, Object state)
    {
        if (state != null)
        {
            Object values[] = (Object[])state;
            _currencyCode = (String)values[0];
            _currencySymbol = (String)values[1];
            _locale = (Locale)values[2];
            Integer value = (Integer)values[3];
            _maxFractionDigits = value != null ? value.intValue() : 0;
            value = (Integer)values[4];
            _maxIntegerDigits = value != null ? value.intValue() : 0;
            value = (Integer)values[5];
            _minFractionDigits = value != null ? value.intValue() : 0;
            value = (Integer)values[6];
            _minIntegerDigits = value != null ? value.intValue() : 0;
            _pattern = (String)values[7];
            _type = (String)values[8];
            _groupingUsed = ((Boolean)values[9]).booleanValue();
            _integerOnly = ((Boolean)values[10]).booleanValue();
            _maxFractionDigitsSet = ((Boolean)values[11]).booleanValue();
            _maxIntegerDigitsSet = ((Boolean)values[12]).booleanValue();
            _minFractionDigitsSet = ((Boolean)values[13]).booleanValue();
            _minIntegerDigitsSet = ((Boolean)values[14]).booleanValue();
        }
    }
314742
public void restoreState(FacesContext context, Object state) {

        if (context == null) {
            throw new NullPointerException();
        }
        if (state == null) {
            return;
        }
        
        if (!component.initialStateMarked() && !defaultMap.isEmpty())
        {
            defaultMap.clear();
            if(deltaMap != null && !deltaMap.isEmpty())
            {
                deltaMap.clear();
            }
        }
        
        Object[] savedState = (Object[]) state;
        if (savedState[savedState.length - 1] != null) {
            component.initialState = (Boolean) savedState[savedState.length - 1];
        }
        int length = (savedState.length-1)/2;
        for (int i = 0; i < length; i++) {
           Object value = savedState[i * 2 + 1];
            Serializable serializable = (Serializable) savedState[i * 2];
            if (value != null) {
                if (value instanceof Collection) {
                    value = restoreAttachedState(context, value);
                } else if (value instanceof StateHolderSaver) {
                    value = ((StateHolderSaver) value).restore(context);
                } else {
                    value = (value instanceof Serializable
                             ? value
                             : restoreAttachedState(context, value));
                }
            }
            if (value instanceof Map) {
                for (Map.Entry<String, Object> entry : ((Map<String, Object>) value)
                      .entrySet()) {
                    this.put(serializable, entry.getKey(), entry.getValue());
                }
            } else if (value instanceof List) {
                List<Object> list = (List) get(serializable);
                for (Object o : ((List<Object>) value)) {
                    if (list == null || !list.contains(o)) {
                        this.add(serializable, o);
                    }
                }
            } else {
                put(serializable, value);
            }
        }
    }
1070728
def Restore(cls, state):
        """"""

        target = SlotIdentifier.FromString(state.get('target'))
        data = base64.b64decode(state.get('data'))
        var_id = state.get('var_id')
        valid = state.get('valid')

        return ConfigEntry(target, var_id, data, valid)
1055655
final void restoreState(final Persistable tuple) throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "restoreState", tuple);

        PersistentTranId xid = tuple.getPersistentTranId();
        boolean logicallyDeleted = tuple.isLogicallyDeleted();
        PersistentTransaction transaction = null;

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            SibTr.debug(this, tc, "xid = " + xid + "; logicallyDeleted = " + logicallyDeleted);

        if (xid != null)
        {
            transaction = getMessageStoreImpl().getXidManager().getTransactionFromTranId(xid);
        }
        if (null == transaction)
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "no transaction so tuple is not in doubt ");

            // We get here if transaction is null - either XID is null (a rolled
            // back transaction has reset the row to its original state) or XID
            // is not null, but no transaction was found (a completed transaction)
            if (logicallyDeleted)
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "tuple is logically deleted - removing link");
            }
            else
            {
                boolean canExpireSilently = false /* tuple.canExpireSilently() */;
                boolean expired = false /* tuple.isExpired() */;
                if (expired && canExpireSilently)
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        SibTr.debug(this, tc, "tuple is expired and can expire silently - removing link");
                }
                else
                {
                    // The itemLink is AVAILABLE or LOCKED
                    long lockID = tuple.getLockID();
                    if (AbstractItem.NO_LOCK_ID != lockID)
                    {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                            SibTr.debug(this, tc, "tuple is locked. LockID = " + lockID);

                        _restoreStatePersistentlyLocked(this, _owningStreamLink, lockID);
                        _owningStreamLink.append(this);
                    }
                    else
                    {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                            SibTr.debug(this, tc, "tuple is not locked");

                        /*
                         * If the deliverydelaytime is greater than the current time during reconstitution then
                         * the item has to be added as locked.And it must be locked using DELIVERY_DELAY_LOCK_ID
                         * lock ID
                         * In the other case we just add the item as available so that it is available for
                         * consumption
                         */
                        if (tuple.getDeliveryDelayTime() > System.currentTimeMillis()) {
                            _restoreStateLocked(this, _owningStreamLink, Item.DELIVERY_DELAY_LOCK_ID);
                            // Register with the DeliveryDelayManager
                            registerWithDeliveryDelayManager();
                        }
                        else {
                            _restoreStateAvailable(this, _owningStreamLink);
                        }
                        _owningStreamLink.append(this);
                    }
                    //Only register with expirer when we are in available or locked state. The other
                    // states will register when either the commit call comes in, or don't require
                    // expiry as the item is already deleted.
                    registerWithExpirer();

                }
            }
        }
        else
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "Tuple is in doubt. transaction = " + transaction);

            Task task = null;
            if (logicallyDeleted)
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "tuple is logically deleted - tuple is deleting");

                //Instantiate the itemLink as REMOVING
                long lockID = tuple.getLockID();
                if (AbstractItem.NO_LOCK_ID != lockID)
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        SibTr.debug(this, tc, "tuple is 'removingLocked'. lockID = " + lockID);

                    _restoreStateRemovingPersistentlyLocked(this, _owningStreamLink, getLockID(), transaction);
                    _owningStreamLink.append(this);
                    task = new RemoveLockedTask(this);
                    //D184032
                }
                else
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        SibTr.debug(this, tc, "tuple is not locked");

                    _restoreStateRemovingNoLock(this, _owningStreamLink, transaction);
                    _owningStreamLink.append(this);
                    task = new RemoveTask(this);
                    //D184032
                }
            }
            else
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "tuple is not logicallyDeleted, so is adding");

                /*
                 * If the deliverydelaytime is greater than the current time during reconstitution then
                 * the item has to be added as locked.And it must be locked using DELIVERY_DELAY_LOCK_ID
                 * lock ID
                 * In the other case we just add the item as available so that it is available for
                 * consumption
                 */
                if (tuple.getDeliveryDelayTime() > System.currentTimeMillis()) {
                    _restoreStateLocked(this, _owningStreamLink, Item.DELIVERY_DELAY_LOCK_ID);
                    //Not adding to deliverydelay manager here because it will be done in AddTask.commitExternal
                } else {
                    //Instantiate the itemLink as ADDING
                    _restoreStateAdding(this, _owningStreamLink, transaction);
                }
                _owningStreamLink.append(this);
                task = new AddTask(this);
                //D184032
            }
            try
            {
                transaction.addWork(task);
                ((TaskList) transaction.getWorkList()).declareAlreadyPrecommitted();
            } catch (MessageStoreException e)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.restoreState", "1:3526:1.241", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "Exception " + e + " while adding task to tasklist");
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(this, tc, "restoreState");
                throw new SevereMessageStoreException("SIMS_NNNN", e);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "restoreState");
    }
646095
public static void clear(ObjectReader reader, final CacheScope scope) {
        withCache(reader, cache -> {
            if (scope == CacheScope.GLOBAL_SCOPE) {
                if (debugLogEnabled)
                    logger.debug("clearing global-level cache with size {}", cache.globalCache.size());
                cache.globalCache.clear();
            }
            if (debugLogEnabled)
                logger.debug("clearing app-level serialization cache with size {}", cache.applicationCache.size());
            cache.applicationCache.clear();
            return null;
        });
    }
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");
    }