Performs value substitution for the given key. For values containing ${...} strings, we substitute if the stuff
in the {...} is a defined key.

@param aKey the key to run the substitution for.
@return true if a substitutions was made, false otherwise.
425533
private boolean substitute(final String aKey) {
		boolean madeChange = false;

		if (substituting.contains(aKey)) {
			backing.put(aKey, "");
			booleanBacking.remove(aKey);
			recordMessage("WARNING: Recursive substitution detected on parameter " + aKey);
			String history = locations.get(aKey);
			locations.put(aKey, history + "recursion detected, using null value; " + history);
			return true;
		}

		try {
			substituting.add(aKey);

			String value = (String) backing.get(aKey);

			int start = findStartVariable(value);

			if (start == -1) {
				return madeChange;
			}

			int end = value.indexOf('}', start);

			if (end == -1) {
				return madeChange;
			}

			String variableName = value.substring(start + 2, end);

			madeChange = madeChange || substitute(variableName);

			String variableValue = get(variableName);

			if (variableValue == null) {
				return madeChange;
			}

			String newValue = value.substring(0, start) + variableValue + value.substring(end + 1);

			madeChange = true;

			backing.put(aKey, newValue);

			if ("yes".equals(newValue) || "true".equals(newValue)) {
				booleanBacking.add(aKey);
			} else {
				booleanBacking.remove(aKey);
			}

			// Record this substitution in the history
			String history = locations.get(aKey);
			history = "substitution of ${" + variableName + "}; " + history;
			locations.put(aKey, history);

			return madeChange;
		} finally {
			substituting.remove(aKey);
		}
	}
123806
@Override
    public boolean replace(K key, V oldValue, V newValue) {
        int hash = hash(key);
        if (oldValue == null || newValue == null) {
          throw new NullPointerException();
        }
        Segment<K,V> s = segmentForHash(hash);
        return s != null && s.replace(key, hash, oldValue, newValue);
    }
560449
private static boolean hasSingleValueWithDefaultKey(AnnotationMirror annotation) {
    if (annotation.getElementValues().size() != 1) {
      return false;
    }
    ExecutableElement key = getOnlyElement(annotation.getElementValues().keySet());
    return key.getSimpleName().contentEquals("value");
  }
710783
public void key( String skey ) throws jsqlite.Exception {
        synchronized (this) {
            byte ekey[] = null;
            if (skey != null && skey.length() > 0) {
                ekey = new byte[skey.length()];
                for( int i = 0; i < skey.length(); i++ ) {
                    char c = skey.charAt(i);
                    ekey[i] = (byte) ((c & 0xff) ^ (c >> 8));
                }
            }
            _key(ekey);
        }
    }
644087
public final <T> boolean replace(final String key, final int exp, final T value,
      final Transcoder<T> transcoder)
      throws TimeoutException, InterruptedException, MemcachedException {
    return this.replace(key, exp, value, transcoder, this.opTimeout);
  }
938718
public void put(K key, V value) {
        final int hash = key.hashCode();
        final int row = hash / SIZE_ROW;
        final int column = hash & (SIZE_ROW - 1); // DON'T use the % operator as we
                                                  // need the result to be
                                                  // non-negative (-1%16 is -1 for
                                                  // example)
        validateKey(hash);
        validateTable(row);
        this.values[row][column] = value;
        this.keys[hash] = key;
    }
943645
public boolean remove(String inputKey, String inputValue) {
        String key = Normalizer.normalize(inputKey, Normalizer.NORMALIZE_LOWER);
        String value = Normalizer.normalize(inputValue, Normalizer.NORMALIZE_LOWER);
        boolean rc = remove(this.values.get(key), value);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "remove: " + key + "=" + value + " rc=" + rc);
        }
        return rc;
    }
1234501
public boolean containsKey(final int key)
    {
        @DoNotSub final int mask = values.length - 1;
        @DoNotSub int index = Hashing.hash(key, mask);

        boolean found = false;
        while (null != values[index])
        {
            if (key == keys[index])
            {
                found = true;
                break;
            }

            index = ++index & mask;
        }

        return found;
    }
989869
public boolean containsKey(Object key) {
	if (key == null) {
	    throw new NullPointerException("key cannot be null");
	}
	else if (key instanceof String) {
	    Node<V> n = lookup((String)key);
	    return n != null && n.isTerminal();
	}
	else {
	    throw new ClassCastException("The provided key does not implement" +
					 " String: " + key);
	}
    }
1164699
protected static function _checkKey($sKey) {
		if ($sKey === '_id') {
			return FALSE;
		}
		if ($sKey === static::$_mKey) {
			return FALSE;
		}
		if (strpos($sKey, '.') !== FALSE) {
			return FALSE;
		}
		if (substr($sKey, 0, 1) === '$') {
			return FALSE;
		}
		return TRUE;
	}
186480
def substitute_variables!(properties)
      # transform values and substitute for special values
      # https://stackoverflow.com/questions/34595142/process-nested-hash-to-convert-all-values-to-strings
      #
      # Examples:
      #   "{stack_name}.stag.boltops.com." => development-demo-web.stag.boltops.com.
      #   "{stack_name}.stag.boltops.com." => dev-demo-web-2.stag.boltops.com.
      properties.deep_merge(properties) do |_,_,v|
        if v.is_a?(String)
          v.sub!('{stack_name}', @stack_name) # unsure why need shebang, but it works
        else
          v
        end
      end
      properties
    end
1120329
private static String formatKey(String prjKey) {
        String formatKey = prjKey;
        if (prjKey.startsWith("+")) {
            formatKey = prjKey.substring(1);
        }
        return formatKey;
    }
999775
protected boolean replace(final K key, final boolean _compare, final V _oldValue, final V _newValue) {
    Entry e = lookupEntry(key);
    if (e == null) {
      metrics.peekMiss();
      return false;
    }
    synchronized (e) {
      e.waitForProcessing();
      if (e.isGone() || !e.hasFreshData(clock)) {
        return false;
      }
      if (_compare && !e.equalsValue(_oldValue)) {
        return false;
      }
      putValue(e, _newValue);
    }
    return true;
  }
451838
public Groundy arg(String key, CharSequence value) {
    mArgs.putCharSequence(key, value);
    return this;
  }
15261
private boolean arrayKeyValueExists(String key, String value) {
    if (visitedPost.containsKey(key)) {
      for(String s : visitedPost.get(key)) {
        if(s.equals(value)) {
          return true;
        }
      }
    }

    return false;

  }
890664
public void rekey( String skey ) throws jsqlite.Exception {
        synchronized (this) {
            byte ekey[] = null;
            if (skey != null && skey.length() > 0) {
                ekey = new byte[skey.length()];
                for( int i = 0; i < skey.length(); i++ ) {
                    char c = skey.charAt(i);
                    ekey[i] = (byte) ((c & 0xff) ^ (c >> 8));
                }
            }
            _rekey(ekey);
        }
    }
950119
function makeKey(aKey) {

        if (aKey &&
          utils.isAnArray(aKey)) {

          var keyLenght = aKey.length
            , tmpKey = []
            , index = 0
            , nValue
            , limitedKey
            , k64Cnt = keyLenght / 8
            , subkeyCnt = ROUND_SUBKEYS + 2 * ROUNDS
            , k32e = []
            , k32o = []
            , sBoxKey = []
            , i
            , j
            , offset = 0
            , q
            , A
            , B
            , subKeys = []
            , lB0
            , lB1
            , lB2
            , lB3
            , sBox = []
            , k0
            , k1
            , k2
            , k3;
          if (keyLenght < 8 ||
              keyLenght > 8 && keyLenght < 16 ||
              keyLenght > 16 && keyLenght < 24 ||
              keyLenght > 24 && keyLenght < 32) {

            for (index = 0; index < aKey.length + (8 - aKey.length); index += 1) {

              nValue = aKey[index];
              if (nValue !== undefined) {

                tmpKey.push(nValue);
              } else {

                tmpKey.push(0x00);
              }
            }
            aKey = tmpKey;
          } else if (keyLenght > 32) {

            limitedKey = [];
            for (index = 0; index < 32; index += 1) {

              limitedKey.push(aKey[index]);
            }
            aKey = limitedKey;
          }
          aKey = new Uint8Array(aKey);
          keyLenght = aKey.length;
          for (i = 0, j = k64Cnt - 1; i < 4 && offset < keyLenght; i += 1, j -= 1) {

            /*eslint-disable no-plusplus*/
            k32e[i] = aKey[offset++] & 0xFF | (aKey[offset++] & 0xFF) << 8 | (aKey[offset++] & 0xFF) << 16 | (aKey[offset++] & 0xFF) << 24;
            k32o[i] = aKey[offset++] & 0xFF | (aKey[offset++] & 0xFF) << 8 | (aKey[offset++] & 0xFF) << 16 | (aKey[offset++] & 0xFF) << 24;
            /*eslint-enable no-plusplus*/
            sBoxKey[j] = rsMDSEncode(k32e[i], k32o[i]);
          }
          for (i = q = 0; i < subkeyCnt / 2; i += 1, q += SK_STEP) {

            A = f32(k64Cnt, q, k32e);
            B = f32(k64Cnt, q + SK_BUMP, k32o);
            B = B << 8 | B >>> 24;
            A += B;
            subKeys[2 * i] = A;
            A += B;
            subKeys[2 * i + 1] = A << SK_ROTL | A >>> 32 - SK_ROTL;
          }
          k0 = sBoxKey[0];
          k1 = sBoxKey[1];
          k2 = sBoxKey[2];
          k3 = sBoxKey[3];
          for (i = 0; i < 256; i += 1) {

            lB0 = lB1 = lB2 = lB3 = i;
            switch (k64Cnt & 3) {

              case 1:
                sBox[2 * i] = MDS[0][P[P_01][lB0] & 0xFF ^ b0(k0)];
                sBox[2 * i + 1] = MDS[1][P[P_11][lB1] & 0xFF ^ b1(k0)];
                sBox[0x200 + 2 * i] = MDS[2][P[P_21][lB2] & 0xFF ^ b2(k0)];
                sBox[0x200 + 2 * i + 1] = MDS[3][P[P_31][lB3] & 0xFF ^ b3(k0)];
                break;

              case 0:
                lB0 = P[P_04][lB0] & 0xFF ^ b0(k3);
                lB1 = P[P_14][lB1] & 0xFF ^ b1(k3);
                lB2 = P[P_24][lB2] & 0xFF ^ b2(k3);
                lB3 = P[P_34][lB3] & 0xFF ^ b3(k3);
                /* falls through */

              case 3:
                lB0 = P[P_03][lB0] & 0xFF ^ b0(k2);
                lB1 = P[P_13][lB1] & 0xFF ^ b1(k2);
                lB2 = P[P_23][lB2] & 0xFF ^ b2(k2);
                lB3 = P[P_33][lB3] & 0xFF ^ b3(k2);
                /* falls through */

              case 2:
                sBox[2 * i] = MDS[0][P[P_01][P[P_02][lB0] & 0xFF ^ b0(k1)] & 0xFF ^ b0(k0)];
                sBox[2 * i + 1] = MDS[1][P[P_11][P[P_12][lB1] & 0xFF ^ b1(k1)] & 0xFF ^ b1(k0)];
                sBox[0x200 + 2 * i] = MDS[2][P[P_21][P[P_22][lB2] & 0xFF ^ b2(k1)] & 0xFF ^ b2(k0)];
                sBox[0x200 + 2 * i + 1] = MDS[3][P[P_31][P[P_32][lB3] & 0xFF ^ b3(k1)] & 0xFF ^ b3(k0)];
                break;

              default:
            }
          }

          return [sBox, subKeys];
        }

        throw 'key passed is undefined or not an array';
      }