This method exists for the benefit of testability, allowing
us to fake the flag that says we are running in a cloned
appserver.<p>

It should not be exposed to customer apps.
559036
public static void setIsClonedServer(Boolean newVal) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "setIsClonedServer", newVal);
        isCloned = newVal;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "setIsClonedServer");
    }
1150559
public static boolean isClonedServer() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "isClonedServer");

        // If we have not yet found out this information.
        if (isCloned == null) {
            isCloned = Boolean.valueOf(RuntimeInfo.isClusteredServer());
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "isClonedServer", isCloned);
        return isCloned.booleanValue();
    }
1141026
public void deleteStatusOverride(final String appName, final String id, final InstanceInfo info) {
        long expiryTime = System.currentTimeMillis() + maxProcessingDelayMs;
        batchingDispatcher.process(
                taskId("deleteStatusOverride", appName, id),
                new InstanceReplicationTask(targetHost, Action.DeleteStatusOverride, info, null, false) {
                    @Override
                    public EurekaHttpResponse<Void> execute() {
                        return replicationClient.deleteStatusOverride(appName, id, info);
                    }
                },
                expiryTime);
    }
127920
public void setHelp(String appVersion, String usageExample) {

		helpAppVersion = StringUtils.trimToNull(appVersion);
		helpAppExample = StringUtils.trimToNull(usageExample);
	}
814094
def _IsUnparsedFlagAccessAllowed(self, name):
    """"""
    if _UNPARSED_FLAG_ACCESS_ENV_NAME in os.environ:
      # We've been told explicitly what to do.
      allow_unparsed_flag_access = (
          os.getenv(_UNPARSED_FLAG_ACCESS_ENV_NAME) == '1')
    elif self.__dict__['__reset_called']:
      # Raise exception if .Reset() was called. This mostly happens in tests.
      allow_unparsed_flag_access = False
    elif _helpers.IsRunningTest():
      # Staged "rollout", based on name of the flag so that we don't break
      # everyone.  Hashing the flag is a way of choosing a random but
      # consistent subset of flags to lock down which we can make larger
      # over time.
      name_bytes = name.encode('utf8') if not isinstance(name, bytes) else name
      flag_percentile = (
          struct.unpack('<I', hashlib.md5(name_bytes).digest()[:4])[0] % 100)
      allow_unparsed_flag_access = (
          _UNPARSED_ACCESS_DISABLED_PERCENT <= flag_percentile)
    else:
      allow_unparsed_flag_access = True
    return allow_unparsed_flag_access
234415
public void checkServerTrusted( X509Certificate[] chain, String authType )
            throws CertificateException
    {
        X509Certificate certificate = chain[0];

        String cert = fingerprint( certificate );

        if ( this.fingerprint == null )
        {
            try
            {
                saveTrustedHost( cert );
            }
            catch ( IOException e )
            {
                throw new CertificateException( format(
                        "Failed to save the server ID and the certificate received from the server to file %s.\n" +
                        "Server ID: %s\nReceived cert:\n%s",
                        knownHosts.getAbsolutePath(), serverId, X509CertToString( cert ) ), e );
            }
        }
        else
        {
            if ( !this.fingerprint.equals( cert ) )
            {
                throw new CertificateException( format(
                        "Unable to connect to neo4j at `%s`, because the certificate the server uses has changed. " +
                        "This is a security feature to protect against man-in-the-middle attacks.\n" +
                        "If you trust the certificate the server uses now, simply remove the line that starts with " +
                        "`%s` " +
                        "in the file `%s`.\n" +
                        "The old certificate saved in file is:\n%sThe New certificate received is:\n%s",
                        serverId, serverId, knownHosts.getAbsolutePath(),
                        X509CertToString( this.fingerprint ), X509CertToString( cert ) ) );
            }
        }
    }
673563
private void validate() {
        // a non-null values object is the flag we use to determine whether
        // to reparse from UIManager.
        if (values != null)
            return;

        // reconstruct this SeaGlassStyle based on the entries in the UIManager
        // and possibly based on any overrides within the component's
        // client properties (assuming such a component exists and contains
        // any SeaGlass.Overrides)
        values = new Values();

        // the profiler revealed that a great deal of CPU time and useless
        // garbage was being produced by this method and the init method. One
        // culprit was the creation and reparsing of the entire UIDefaults
        // map on each call to this method where "values" was null. It turns
        // out this was happening a lot.
        // To remove this bottleneck, we store the compiled TreeMaps of defaults
        // in the appContext for reuse. It is nulled whenever the UIDefaults
        // changes and recomputed when necessary.
        final AppContext ctx = AppContext.getAppContext();

        // fetch the defaults from the app context. If null, then create and
        // store the compiled defaults
        Map<String, TreeMap<String, Object>> compiledDefaults = (Map<String, TreeMap<String, Object>>) ctx.get("SeaGlassStyle.defaults");

        if (compiledDefaults == null) {

            // the entire UIDefaults tables are parsed and compiled into
            // this map of maps. The key of the compiledDefaults is the
            // prefix for each style, while the value is a map of
            // keys->values for that prefix.
            compiledDefaults = new HashMap<String, TreeMap<String, Object>>();

            // get all the defaults from UIManager.getDefaults() and put them
            // into the compiledDefaults
            compileDefaults(compiledDefaults, UIManager.getDefaults());

            // This second statement pulls defaults from the laf defaults
            UIDefaults lafDefaults = UIManager.getLookAndFeelDefaults();

            compileDefaults(compiledDefaults, lafDefaults);

            // if it has not already been done, add a listener to both
            // UIManager.getDefaults() and UIManager.getLookAndFeelDefaults().
            PropertyChangeListener pcl = (PropertyChangeListener) ctx.get("SeaGlassStyle.defaults.pcl");

            // if pcl is null, then it has not yet been registered with
            // the UIManager defaults for this app context
            if (pcl == null) {

                // create a PCL which will simply clear out the compiled
                // defaults from the app context, causing it to be recomputed
                // on subsequent passes
                pcl = new DefaultsListener();

                // add the PCL to both defaults tables that we pay attention
                // to, so that if the UIDefaults are updated, then the
                // precompiled defaults will be cleared from the app context
                // and recomputed on subsequent passes
                UIManager.getDefaults().addPropertyChangeListener(pcl);
                UIManager.getLookAndFeelDefaults().addPropertyChangeListener(pcl);

                // save the PCL to the app context as a marker indicating
                // that the PCL has been registered so we don't end up adding
                // more than one listener to the UIDefaults tables.
                ctx.put("SeaGlassStyle.defaults.pcl", pcl);
            }

            // store the defaults for reuse
            ctx.put("SeaGlassStyle.defaults", compiledDefaults);
        }

        TreeMap<String, Object> defaults = compiledDefaults.get(prefix);
        if (defaults == null) {
            defaults = new TreeMap<String, Object>();
        }

        // inspect the client properties for the key "SeaGlass.Overrides". If
        // the
        // value is an instance of UIDefaults, then these defaults are used
        // in place of, or in addition to, the defaults in UIManager.
        if (component != null) {
            Object o = component.getClientProperty("SeaGlass.Overrides");

            if (o instanceof UIDefaults) {
                Object                  i       = component.getClientProperty("SeaGlass.Overrides.InheritDefaults");
                boolean                 inherit = i instanceof Boolean ? (Boolean) i : true;
                UIDefaults              d       = (UIDefaults) o;
                TreeMap<String, Object> map     = new TreeMap<String, Object>();

                for (Object obj : d.keySet()) {

                    if (obj instanceof String) {
                        String key = (String) obj;

                        if (key.startsWith(prefix)) {
                            map.put(key, d.get(key));
                        }
                    }
                }

                if (inherit) {
                    defaults.putAll(map);
                } else {
                    defaults = map;
                }
            }
        }

        // Now that I've accumulated all the defaults pertaining to this
        // style, call init which will read these defaults and configure
        // the default "values".
        init(values, defaults);
    }
748495
@VisibleForTesting synchronized void fakeSave() {
        try {
            wallet.commitTx(getContractInternal());
        } catch (VerificationException e) {
            throw new RuntimeException(e); // We created it
        }
        stateMachine.transition(State.PROVIDE_MULTISIG_CONTRACT_TO_SERVER);
    }
397577
private void verifyHTTP_1_0()
    {
        // Set content length
        int content_length=
            _request.getIntField(HttpFields.__ContentLength);
        if (content_length>=0)
            _inputStream.setContentLength(content_length);
        else if (content_length<0)
        {
            // TODO - can't do this check because IE does this after
            // a redirect.
            // Can't have content without a content length
            // String content_type=_request.getField(HttpFields.__ContentType);
            // if (content_type!=null && content_type.length()>0)
            //     throw new HttpException(_HttpResponse.__411_Length_Required);
            _inputStream.setContentLength(0);
        }

        // Check netscape proxy connection - this is not strictly correct.
        if (!_keepAlive && HttpFields.__KeepAlive.equalsIgnoreCase(_request.getField(HttpFields.__ProxyConnection)))
            _keepAlive=true;

        // persistent connections in HTTP/1.0 only if requested.
        _persistent=_keepAlive;
    }
589069
public void restoreOriginal() {
    if (original == null) {
      throw new IllegalStateException("Original EbeanServer instance is null");
    }
    if (original.getName() == null) {
      throw new IllegalStateException("Original EbeanServer name is null");
    }

    // restore the original EbeanServer back
    Ebean.mock(original.getName(), original, true);
  }
313914
static void checkHeapFlags(final int flags) {  //only used by checkPreLongsFlagsCap and test
    final int allowedFlags =
        READ_ONLY_FLAG_MASK | EMPTY_FLAG_MASK | COMPACT_FLAG_MASK | ORDERED_FLAG_MASK;
    final int flagsMask = ~allowedFlags;
    if ((flags & flagsMask) > 0) {
      throw new SketchesArgumentException(
         "Possible corruption: Invalid flags field: " + Integer.toBinaryString(flags));
    }
  }
1018241
def sanitize(self):
        '''
        
        '''
        super(EncapsulatedControlMessage, self).sanitize()

        # S: This is the Security bit.  When set to 1 the following
        # authentication information will be appended to the end of the Map-
        # Reply.  The detailed format of the Authentication Data Content is
        # for further study.
        if not isinstance(self.security, bool):
            raise ValueError('Security flag must be a boolean')

        if self.security:
            raise NotImplementedError('Handling security data is not ' +
                                      'implemented yet')

        # "D" is the "DDT-originated" flag and is set by a DDT client to
        # indicate that the receiver can and should return Map-Referral
        # messages as appropriate.
        if not isinstance(self.ddt_originated, bool):
            raise ValueError('DDT originated flag must be a boolean')

        # The 6th bit in the ECM LISP header is allocated as the "R"
        # bit.  The R bit indicates that the encapsulated Map-Register is
        # to be processed by an RTR.
        if not isinstance(self.for_rtr, bool):
            raise ValueError('For-RTR flag must be a boolean')

        # The 7th bit in the ECM header is allocated as the "N" bit.  The
        # N bit indicates that this Map-Register is being relayed by an
        # RTR.  When an RTR relays the ECM-ed Map-Register to a Map-Server,
        # the N bit must be set to 1.
        if not isinstance(self.relayed_by_rtr, bool):
            raise ValueError('Relayed-by-RTR flag must be a boolean')
319112
def use_ssl=(flag)
      flag = flag ? true : false
      if started? and @use_ssl != flag
        raise IOError, "use_ssl value changed, but session already started"
      end
      @use_ssl = flag
    end
161891
public void clearLocalisingUuidsSet()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "clearLocalisingUuidsSet");

    if (_queuePointsGuessSet != null)
    {
      synchronized (_queuePointsGuessSet)
      {
        _queuePointsGuessSet.clear();
      }
    }

    if (_remoteQueuePointsGuessSet != null)
    {
      synchronized (_remoteQueuePointsGuessSet)
      {
        _remoteQueuePointsGuessSet.clear();
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "clearLocalisingUuidsSet");
    return;
  }
967805
def stop_accepting_passive_svc_checks(self):
        
        if self.my_conf.accept_passive_service_checks:
            self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].value
            self.my_conf.accept_passive_service_checks = False
            self.my_conf.explode_global_conf()
            self.daemon.update_program_status()
131595
private void verifyConfiguration() throws DeploymentException {
        Map<URL, ModuleMetaData> mmds = getModuleMetaDataMap();
        if (mmds != null) {
            for (Map.Entry<URL, ModuleMetaData> entry : mmds.entrySet()) {
                ModuleMetaData mmd = entry.getValue();
                if (mmd instanceof WebModuleMetaData) {
                    String j2eeModuleName = mmd.getJ2EEName().getModule();
                    Map<Class<?>, Properties> authMechs = getAuthMechs(j2eeModuleName);
                    if (authMechs != null && !authMechs.isEmpty()) {
                        // make sure that only one HAM.
                        if (authMechs.size() != 1) {
                            String appName = mmd.getJ2EEName().getApplication();
                            String authMechNames = getAuthMechNames(authMechs);
                            Tr.error(tc, "JAVAEESEC_CDI_ERROR_MULTIPLE_HTTPAUTHMECHS", j2eeModuleName, appName, authMechNames);
                            String msg = Tr.formatMessage(tc, "JAVAEESEC_CDI_ERROR_MULTIPLE_HTTPAUTHMECHS", j2eeModuleName, appName, authMechNames);
                            throw new DeploymentException(msg);
                        }

                        SecurityMetadata smd = (SecurityMetadata) ((WebModuleMetaData) mmd).getSecurityMetaData();
                        if (smd != null) {
                            LoginConfiguration lc = smd.getLoginConfiguration();
                            if (lc != null && !lc.isAuthenticationMethodDefaulted()) {
                                String appName = mmd.getJ2EEName().getApplication();
                                String msg = Tr.formatMessage(tc, "JAVAEESEC_CDI_ERROR_LOGIN_CONFIG_EXISTS", j2eeModuleName, appName);
                                Tr.error(tc, "JAVAEESEC_CDI_ERROR_LOGIN_CONFIG_EXISTS", j2eeModuleName, appName);
                                throw new DeploymentException(msg);
                            }
                        }
                    }
                }
            }
        }
    }
833526
def audit_ghosts(self):
        """"""
        print_header = True
        for app_name in self._get_ghosts():
            if print_header:
                print_header = False
                print (
                    "Found the following in the state database but not "
                    "available as a configured job:"
                )
            print "\t%s" % (app_name,)