Gets the hash code for the element settings.<p>

@param individualSettings the individual settings
@param createNew the create new flag

@return the hash code for the element settings
494059
private static String getSettingsHash(Map<String, String> individualSettings, boolean createNew) {

        if (!individualSettings.isEmpty() || createNew) {
            int hash = (individualSettings.toString() + createNew).hashCode();
            return CmsADEManager.CLIENT_ID_SEPERATOR + hash;
        }
        return "";
    }
5319
private static @Nullable
    User getOrCreateById(@Nonnull String id, @Nonnull String fullName, boolean create) {
        User u = AllUsers.get(id);
        if (u == null && (create || UserIdMapper.getInstance().isMapped(id))) {
            u = new User(id, fullName);
            AllUsers.put(id, u);
            if (!id.equals(fullName) && !UserIdMapper.getInstance().isMapped(id)) {
                try {
                    u.save();
                } catch (IOException x) {
                    LOGGER.log(Level.WARNING, "Failed to save user configuration for " + id, x);
                }
            }
        }
        return u;
    }
324083
static MemberMap createNew(int version, MemberImpl... members) {
        Map<Address, MemberImpl> addressMap = createLinkedHashMap(members.length);
        Map<String, MemberImpl> uuidMap = createLinkedHashMap(members.length);

        for (MemberImpl member : members) {
            putMember(addressMap, uuidMap, member);
        }

        return new MemberMap(version, addressMap, uuidMap);
    }
257301
@Override
  @Nonnull
  @OverridingMethodsMustInvokeSuper
  protected IMicroNode internalConvertToMicroNode (@Nonnull final IHCConversionSettingsToNode aConversionSettings)
  {
    // Create the element
    final IMicroElement ret = createMicroElement (aConversionSettings);
    if (ret == null)
      throw new IllegalStateException ("Created a null element!");

    // Set all HTML attributes etc.
    fillMicroElement (ret, aConversionSettings);

    // Optional callback after everything was done (implementation dependent)
    finishMicroElement (ret, aConversionSettings);
    return ret;
  }
611415
public static long getNextGenerationId() {
        // ENG-14511- these calls may hit assertion failures in testing environments
        try {
            return UniqueIdGenerator.makeIdFromComponents(System.currentTimeMillis(),
                    m_generationId.incrementAndGet(),
                    MpInitiator.MP_INIT_PID);
        }
        catch (Throwable t) {
            // Try resetting the generation
            m_generationId.set(0L);
            return UniqueIdGenerator.makeIdFromComponents(System.currentTimeMillis(),
                    m_generationId.incrementAndGet(),
                    MpInitiator.MP_INIT_PID);
        }
    }
1106583
public Object hashBlankNodes(Collection<String> unnamed_) throws JsonLdError {
        List<String> unnamed = new ArrayList<String>(unnamed_);
        List<String> nextUnnamed = new ArrayList<String>();
        Map<String, List<String>> duplicates = new LinkedHashMap<String, List<String>>();
        Map<String, String> unique = new LinkedHashMap<String, String>();

        // NOTE: not using the same structure as javascript here to avoid
        // possible stack overflows
        // hash quads for each unnamed bnode
        for (int hui = 0;; hui++) {
            if (hui == unnamed.size()) {
                // done, name blank nodes
                Boolean named = false;
                List<String> hashes = new ArrayList<String>(unique.keySet());
                Collections.sort(hashes);
                for (final String hash : hashes) {
                    final String bnode = unique.get(hash);
                    namer.getName(bnode);
                    named = true;
                }

                // continue to hash bnodes if a bnode was assigned a name
                if (named) {
                    // this resets the initial variables, so it seems like it
                    // has to go on the stack
                    // but since this is the end of the function either way, it
                    // might not have to
                    // hashBlankNodes(unnamed);
                    hui = -1;
                    unnamed = nextUnnamed;
                    nextUnnamed = new ArrayList<String>();
                    duplicates = new LinkedHashMap<String, List<String>>();
                    unique = new LinkedHashMap<String, String>();
                    continue;
                }
                // name the duplicate hash bnods
                else {
                    // names duplicate hash bnodes
                    // enumerate duplicate hash groups in sorted order
                    hashes = new ArrayList<String>(duplicates.keySet());
                    Collections.sort(hashes);

                    // process each group
                    for (int pgi = 0;; pgi++) {
                        if (pgi == hashes.size()) {
                            // done, create JSON-LD array
                            // return createArray();
                            final List<String> normalized = new ArrayList<String>();

                            // Note: At this point all bnodes in the set of RDF
                            // quads have been
                            // assigned canonical names, which have been stored
                            // in the 'namer' object.
                            // Here each quad is updated by assigning each of
                            // its bnodes its new name
                            // via the 'namer' object

                            // update bnode names in each quad and serialize
                            for (int cai = 0; cai < quads.size(); ++cai) {
                                final Map<String, Object> quad = (Map<String, Object>) quads
                                        .get(cai);
                                for (final String attr : new String[] { "subject", "object",
                                        "name" }) {
                                    if (quad.containsKey(attr)) {
                                        final Map<String, Object> qa = (Map<String, Object>) quad
                                                .get(attr);
                                        if (qa != null && "blank node".equals(qa.get("type"))
                                                && ((String) qa.get("value"))
                                                        .indexOf("_:c14n") != 0) {
                                            qa.put("value",
                                                    namer.getName((String) qa.get(("value"))));
                                        }
                                    }
                                }
                                normalized.add(toNQuad((RDFDataset.Quad) quad,
                                        quad.containsKey("name") && quad.get("name") != null
                                                ? (String) ((Map<String, Object>) quad.get("name"))
                                                        .get("value")
                                                : null));
                            }

                            // sort normalized output
                            Collections.sort(normalized);

                            // handle output format
                            if (options.format != null) {
                                if (JsonLdConsts.APPLICATION_NQUADS.equals(options.format)) {
                                    final StringBuilder rval = new StringBuilder();
                                    for (final String n : normalized) {
                                        rval.append(n);
                                    }
                                    return rval.toString();
                                } else {
                                    throw new JsonLdError(JsonLdError.Error.UNKNOWN_FORMAT,
                                            options.format);
                                }
                            }
                            final StringBuilder rval = new StringBuilder();
                            for (final String n : normalized) {
                                rval.append(n);
                            }
                            return parseNQuads(rval.toString());
                        }

                        // name each group member
                        final List<String> group = duplicates.get(hashes.get(pgi));
                        final List<HashResult> results = new ArrayList<HashResult>();
                        for (int n = 0;; n++) {
                            if (n == group.size()) {
                                // name bnodes in hash order
                                Collections.sort(results, new Comparator<HashResult>() {
                                    @Override
                                    public int compare(HashResult a, HashResult b) {
                                        final int res = a.hash.compareTo(b.hash);
                                        return res;
                                    }
                                });
                                for (final HashResult r : results) {
                                    // name all bnodes in path namer in
                                    // key-entry order
                                    // Note: key-order is preserved in
                                    // javascript
                                    for (final String key : r.pathNamer.existing().keySet()) {
                                        namer.getName(key);
                                    }
                                }
                                // processGroup(i+1);
                                break;
                            } else {
                                // skip already-named bnodes
                                final String bnode = group.get(n);
                                if (namer.isNamed(bnode)) {
                                    continue;
                                }

                                // hash bnode paths
                                final UniqueNamer pathNamer = new UniqueNamer("_:b");
                                pathNamer.getName(bnode);

                                final HashResult result = hashPaths(bnode, bnodes, namer,
                                        pathNamer);
                                results.add(result);
                            }
                        }
                    }
                }
            }

            // hash unnamed bnode
            final String bnode = unnamed.get(hui);
            final String hash = hashQuads(bnode, bnodes, namer);

            // store hash as unique or a duplicate
            if (duplicates.containsKey(hash)) {
                duplicates.get(hash).add(bnode);
                nextUnnamed.add(bnode);
            } else if (unique.containsKey(hash)) {
                final List<String> tmp = new ArrayList<String>();
                tmp.add(unique.get(hash));
                tmp.add(bnode);
                duplicates.put(hash, tmp);
                nextUnnamed.add(unique.get(hash));
                nextUnnamed.add(bnode);
                unique.remove(hash);
            } else {
                unique.put(hash, bnode);
            }
        }
    }
1042323
static OrganizationSettings getOrganizationSettings(OrganizationName organizationName) {
    try (SecurityCenterClient client = SecurityCenterClient.create()) {
      // Start setting up a request to get OrganizationSettings for.
      // OrganizationName organizationName = OrganizationName.of(/*organizationId=*/"123234324");
      GetOrganizationSettingsRequest.Builder request =
          GetOrganizationSettingsRequest.newBuilder()
              .setName(organizationName.toString() + "/organizationSettings");

      // Call the API.
      OrganizationSettings response = client.getOrganizationSettings(request.build());

      System.out.println("Organization Settings:");
      System.out.println(response);
      return response;
    } catch (IOException e) {
      throw new RuntimeException("Couldn't create client.", e);
    }
  }
1193574
def editor_settings_lookup(root)
      previous_node = nil
      new_nodelist  = []

      return if root.nodelist.blank?

      root.nodelist.each_with_index do |node, index|
        if node.is_a?(::Liquid::Variable) && previous_node.is_a?(::Liquid::Token)
          matches = node.raw.match(Locomotive::Steam::SECTIONS_SETTINGS_VARIABLE_REGEXP)

          # is a section setting variable?
          if matches && matches[:id] && wrapped_around_tag?(index, root.nodelist)
            # open the closest HTML tag
            previous_node.gsub!(/>(\s*)\z/, '\1')

            # here we go, add a liquid variable!
            new_nodelist.push(::Liquid::Variable.new(
              "section.editor_setting_data.#{matches[:id]}",
              node.instance_variable_get(:@options))
            )

            # close the tag
            new_nodelist.push(::Liquid::Token.new('>', previous_node.line_number))
          end
        elsif node.respond_to?(:nodelist)
          editor_settings_lookup(node)
        end

        new_nodelist.push(node)

        previous_node = node
      end

      (root.instance_variable_get(:@body) || root).instance_variable_set(:@nodelist, new_nodelist)
    end
1311428
private static void storeRecentConnectionSettings(Hashtable settings) {

        try {
            if (recentSettings == null) {
                setHomeDir();

                if (homedir == null) {
                    return;
                }

                recentSettings = new File(homedir, fileName);

                if (!recentSettings.exists()) {

//                    recentSettings.createNewFile();
                }
            }

            if (settings == null || settings.size() == 0) {
                return;
            }

            // setup a stream to a physical file on the filesystem
            FileOutputStream   out = new FileOutputStream(recentSettings);
            ObjectOutputStream objStream = new ObjectOutputStream(out);
            Enumeration        en        = settings.elements();

            while (en.hasMoreElements()) {
                objStream.writeObject(en.nextElement());
            }

            objStream.flush();
            objStream.close();
            out.close();
        } catch (Throwable t) {}
    }
1123739
@Override
  public Identifier getNewInstance(final String str) {

    final int index = str.indexOf("://");
    if (index < 0) {
      throw new RemoteRuntimeException("Invalid remote identifier name: " + str);
    }

    final String type = str.substring(0, index);
    final Class<? extends Identifier> clazz = typeToClazzMap.get(type);

    try {

      final Constructor<? extends Identifier> constructor = clazz.getDeclaredConstructor(CONSTRUCTOR_ARG_TYPES);
      final Object[] args = new Object[] {str.substring(index + 3)};

      final Identifier instance = constructor.newInstance(args);
      LOG.log(Level.FINER, "Created new identifier: {0} for {1}", new Object[] {instance, str});
      return instance;

    } catch (final NoSuchMethodException | SecurityException | InstantiationException
        | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
      LOG.log(Level.SEVERE, "Cannot create new identifier for: " + str, e);
      throw new RemoteRuntimeException(e);
    }
  }
334257
@Deprecated
  public UnaryCallSettings.Builder getApiCallSettings(RetrySettings retrySettings) {
    return UnaryCallSettings.newUnaryCallSettingsBuilder().setRetrySettings(retrySettings);
  }
1195378
public java.util.List<Setting> getSettings() {
        if (settings == null) {
            settings = new com.amazonaws.internal.SdkInternalList<Setting>();
        }
        return settings;
    }
570640
@Override
	protected void initFromSettings( Settings settings )
    {
        this.name = settings.getStringProperty("name");
        this.initialBlockCount = settings.getIntProperty("persistentStore.initialBlockCount",0);
        this.maxBlockCount = settings.getIntProperty("persistentStore.maxBlockCount",0);
        this.autoExtendAmount = settings.getIntProperty("persistentStore.autoExtendAmount",0);
        this.blockSize = settings.getIntProperty("persistentStore.blockSize",4096);
        this.rawDataFolder = settings.getStringProperty("persistentStore.dataFolder","${FFMQ_BASE}/data",false);
        this.dataFolder = new File(SystemTools.replaceSystemProperties(rawDataFolder));
        this.maxNonPersistentMessages = settings.getIntProperty("memoryStore.maxMessages",0);
        this.useJournal = settings.getBooleanProperty("persistentStore.useJournal",true);
        this.rawJournalFolder = settings.getStringProperty("persistentStore.journal.dataFolder",rawDataFolder,false);
        this.journalFolder = new File(SystemTools.replaceSystemProperties(rawJournalFolder));
        this.maxJournalSize = settings.getLongProperty("persistentStore.journal.maxFileSize", 1024*1024*32 /* 32 MB */);
        this.maxWriteBatchSize = settings.getIntProperty("persistentStore.journal.maxWriteBatchSize", 1000);
        this.maxUnflushedJournalSize = settings.getIntProperty("persistentStore.journal.maxUnflushedJournalSize", 1024*1024*4 /* 4 MB */);
        this.maxUncommittedStoreSize = settings.getIntProperty("persistentStore.journal.maxUncommittedStoreSize", 1024*1024*16 /* 16 MB */);
        this.journalOutputBuffer = settings.getIntProperty("persistentStore.journal.outputBufferSize", 16384 /* 16 KB */);
        this.temporary = settings.getBooleanProperty("temporary",false);
        this.storageSyncMethod = settings.getIntProperty("persistentStore.syncMethod", StorageSyncMethod.CHANNEL_FORCE_NO_META);
        this.preAllocateFiles = settings.getBooleanProperty("persistentStore.journal.preAllocateFiles",false);
        this.overflowToPersistent = settings.getBooleanProperty("memoryStore.overflowToPersistent",false);
    }
1245822
@SafeVarargs
	public static <E> HashSet<E> newHashSet(E... elements) {
		HashSet<E> set = new HashSet<E>();
		Collections.addAll(set, elements);
		return set;
	}
166410
static Settings create(final ConfigItemSet viewSettings, final ConfigItemMapEntrySet firstView,
                                 final ConfigItemSet configurationSettings) {
        final List<ConfigBlock> rootBlocks = new ArrayList<ConfigBlock>();
        final ConfigItemMapIndexed views = new ConfigItemMapIndexed("Views");
        final Map<String, ConfigItemMapEntrySet> viewById = new HashMap<String, ConfigItemMapEntrySet>();
        final ConfigItemMapNamed tablesMap = new ConfigItemMapNamed("Tables");

        return new Settings(rootBlocks, viewSettings, views, viewById, firstView, tablesMap, configurationSettings);
    }
735083
private String getSettingsHash() {

        String instanceId = getInstanceId();
        if (instanceId == null) {
            throw new RuntimeException("Missing instance id");
        }
        return CmsADEManager.CLIENT_ID_SEPERATOR + getInstanceId();
    }
1110198
public synchronized @Nonnull TokenUuidAndPlainValue generateNewToken(@Nonnull String name) {
        // 16x8=128bit worth of randomness, using brute-force you need on average 2^127 tries (~10^37)
        byte[] random = new byte[16];
        RANDOM.nextBytes(random);
        String secretValue = Util.toHexString(random);
        String tokenTheUserWillUse = HASH_VERSION + secretValue;
        assert tokenTheUserWillUse.length() == 2 + 32;
        
        String secretValueHashed = this.plainSecretToHashInHex(secretValue);
        
        HashValue hashValue = new HashValue(HASH_VERSION, secretValueHashed);
        HashedToken token = HashedToken.buildNew(name, hashValue);
        
        this.addToken(token);
        
        return new TokenUuidAndPlainValue(token.uuid, tokenTheUserWillUse);
    }