Sets the original subject with the shared state contents.
336722
protected void updateSubjectWithSharedStateContents() {
        subject.getPrincipals().add((WSPrincipal) sharedState.get(Constants.WSPRINCIPAL_KEY));
        subject.getPublicCredentials().add(sharedState.get(Constants.WSCREDENTIAL_KEY));
        if (sharedState.get(Constants.WSSSOTOKEN_KEY) != null)
            subject.getPrivateCredentials().add(sharedState.get(Constants.WSSSOTOKEN_KEY));
    }
1179894
public void setState(State state) {
    this.state = state;
    setText(state.isPrimary() ? text1 : text2);
  }
999950
private void setState(State state) {
    if (this.state != state) {
      this.state = state;
      log.debug("State changed: {}", state);
    }
  }
374823
def set_subject(self, value: Union[Literal, Identifier, str], lang: str= None):
        
        return self.metadata.add(key=DC.subject, value=value, lang=lang)
223327
def transfer_state_data(cls, source_entity, target_entity):
        
        state_data = cls.get_state_data(source_entity)
        cls.set_state_data(target_entity, state_data)
306258
public void setState(TransferState state) {
        synchronized (this) {
            this.state = state;
        }
        for ( TransferStateChangeListener listener : stateChangeListeners ) {
            listener.transferStateChanged(this, state);
        }
    }
419476
public JWTPayload setSubject(String subject) {
        this.subject = subject;
        this.put(PayloadConstants.SUBJECT, subject);
        return this;
    }
1031965
private void optimize(final Subject subject) {
        if (System.getSecurityManager() == null)
            subject.setReadOnly();
        else
            AccessController.doPrivileged(new PrivilegedAction<Void>() {
                @Override
                public Void run() {
                    subject.setReadOnly();
                    return null;
                }
            });
    }
691234
def set_initial_state(self, initial_state, initial_frames):
    """"""
    self._initial_state = initial_state
    self._initial_frames = initial_frames[:, -1, ...]
    self._should_preprocess_on_reset = False
372879
public void setStateForDurability(Iv2InitiateTaskMessage initiateTask,
                                      Collection<Integer> involvedPartitions) {
        m_initiateTask = initiateTask;
        m_involvedPartitions = ImmutableSet.copyOf(involvedPartitions);
        assert(!m_nPartTxn || m_involvedPartitions.size() > 0);
        // this function may be called for the same instance twice, with slightly different
        // but same size initiateTask. The second call is intended to update the spHandle in
        // the initiateTask to a new value and update the corresponding buffer, therefore it
        // only change the spHandle which takes a fixed amount of bytes, the only component
        // that can change size, which is the StoredProcedureInvocation, isn't changed at all.
        // Because of these, the serialized size will be the same for the two calls and the
        // buffer only needs to be allocated once. When this function is called the second
        // time, just reset the position and limit and reserialize the updated content to the
        // existing ByteBuffer so we can save an allocation.
        if (m_initiateTaskBuffer == null) {
            m_initiateTaskBuffer = ByteBuffer.allocate(initiateTask.getSerializedSize());
        }
        else {
            m_initiateTaskBuffer.position(0);
            m_initiateTaskBuffer.limit(initiateTask.getSerializedSize());
        }
        try {
            initiateTask.flattenToBuffer(m_initiateTaskBuffer);
            m_initiateTaskBuffer.flip();
        } catch (IOException e) {
            //Executive decision, don't throw a checked exception. Let it burn.
            throw new RuntimeException(e);
        }
    }
35862
def setcontents(source, identifier, pointer):
    """"""
    record = Record.get_record(identifier)
    Document(record, pointer).setcontents(source)
167750
def set_state(self, state):
        
        SimStatePlugin.set_state(self, state)

        # Delayed initialization
        stack_region_map, generic_region_map = self._temp_stack_region_map, self._temp_generic_region_map

        if stack_region_map or generic_region_map:
            # Inherited from its parent
            self._stack_region_map = stack_region_map.copy()
            self._generic_region_map = generic_region_map.copy()

        else:
            if not self._abstract_backer and o.REGION_MAPPING in self.state.options:
                # Only the top-level SimMemory instance can have region maps.
                self._stack_region_map = RegionMap(True)
                self._generic_region_map = RegionMap(False)

            else:
                self._stack_region_map = None
                self._generic_region_map = None
72017
@Override
	public void setSubject(final String subject) throws MessagingException
	{
		if (charset == null)
		{
			super.setSubject(subject);
			return;
		}
		setSubject(subject, charset);
	}
580715
private static SubjectCookie setInvocationSubject(Subject s) {
        final SubjectCookie cookie = new SubjectCookie();
        SubjectManagerService sms = smServiceRef.getService();
        if (sms != null) {
            if (s == null) {
                s = new Subject();
            }

            Subject currentInvocationSubject = sms.getInvocationSubject();
            sms.setInvocationSubject(s);

            cookie.subject = currentInvocationSubject;

            // If SYNC-TO-OS-THREAD support is enabled for the server and configured for this app,
            // then sync the Subject's identity to the thread.  The returned token is handed back
            // to the ThreadIdentityManager when we restore of the previous invocation subject
            // (under restoreInvocationSubject).
            try {
                cookie.token = ThreadIdentityManager.setAppThreadIdentity(s);
            } catch (ThreadIdentityException e) {
                throw new SecurityException(e);
            }
        }
        return cookie;
    }
1258235
@Override
    public void setShareDurableSubscriptions(String sharePolicy) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setShareDurableSubscriptions", sharePolicy);

        // First of all, convert null and empty to mean the default.
        if ((sharePolicy == null) || ("".equals(sharePolicy))) {
            jcaManagedConnectionFactory.setShareDurableSubscriptions(ApiJmsConstants.SHARED_DSUBS_NEVER);
        }
        // Then check for another legal value
        else if ((ApiJmsConstants.SHARED_DSUBS_IN_CLUSTER.equals(sharePolicy)) ||
                 (ApiJmsConstants.SHARED_DSUBS_ALWAYS.equals(sharePolicy)) ||
                 (ApiJmsConstants.SHARED_DSUBS_NEVER.equals(sharePolicy))) {
            jcaManagedConnectionFactory.setShareDurableSubscriptions(sharePolicy);
        }
        else {
            // This is not a legal value.
            throw (JMSException) JmsErrorUtils.newThrowable(
                                                            JMSException.class,
                                                            "INVALID_VALUE_CWSIA0261",
                                                            new Object[] { "shareDurableSubscriptions", sharePolicy },
                                                            tc
                            );
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setShareDurableSubscriptions");
    }
999139
public function setSubject($subject)
    {
        if (!is_string($subject)) {
            throw new TypeException('$subject must be of type string.');
        }
        if (!($subject instanceof Subject)) {
            $this->subject = new Subject($subject);
        } else {
            $this->subject = $subject;
        }
    }
480004
protected void setUpSubject() throws WSLoginFailedException {
        try {
            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                @Override
                public Object run() throws Exception {
                    updateSubjectWithTemporarySubjectContents();
                    return null;
                }
            });
        } catch (PrivilegedActionException e) {
            throw new WSLoginFailedException("Unable to setup the Subject: " + e.getLocalizedMessage());
        }
    }