Get the mcw from the hash map

@param mc
@return
165725
public Object getMCWFromMctoMCWMap(Object mc) {
        Object mcw = null;
        mcToMCWMapRead.lock();
        try {
            mcw = mcToMCWMap.get(mc);
        } finally {
            mcToMCWMapRead.unlock();
        }
        return mcw;
    }
396069
String hash(TemplateClass tc) {
        try {
            //Object enhancer = engine.conf().byteCodeEnhancer();
            MessageDigest messageDigest = MessageDigest.getInstance("MD5");
            messageDigest.reset();
            messageDigest.update((engine.version() + tc.getTemplateSource(true)).getBytes("utf-8"));
            byte[] digest = messageDigest.digest();
            StringBuilder builder = new StringBuilder();
            for (int i = 0; i < digest.length; ++i) {
                int value = digest[i];
                if (value < 0) {
                    value += 256;
                }
                builder.append(Integer.toHexString(value));
            }
            return builder.toString();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
1217334
@SuppressWarnings({ "rawtypes", "unchecked" })
    @Deprecated
    public static Hashtable getContext() {
        Map map = org.slf4j.MDC.getCopyOfContextMap();

        if (map != null) {
            return new Hashtable(map);
        } else {
            return new Hashtable();
        }
    }
599161
public Map<String, Object> getMBeanResult(final String mbeanName) {
    final Map<String, Object> ret = new HashMap<>();
    try {
      final ObjectName name = new ObjectName(mbeanName);
      final MBeanInfo info = getMBeanInfo(name);

      final MBeanAttributeInfo[] mbeanAttrs = info.getAttributes();
      final Map<String, Object> attributes = new TreeMap<>();

      for (final MBeanAttributeInfo attrInfo : mbeanAttrs) {
        final Object obj = getMBeanAttribute(name, attrInfo.getName());
        attributes.put(attrInfo.getName(), obj);
      }

      ret.put("attributes", attributes);
    } catch (final Exception e) {
      logger.error("Invalid MBean Name. name = " + mbeanName, e);
      ret.put("error", "'" + mbeanName + "' is not a valid mBean name");
    }

    return ret;
  }
69646
public Sha256Hash getWTxId() {
        if (cachedWTxId == null) {
            if (!hasWitnesses() && cachedTxId != null) {
                cachedWTxId = cachedTxId;
            } else {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                try {
                    bitcoinSerializeToStream(baos, hasWitnesses());
                } catch (IOException e) {
                    throw new RuntimeException(e); // cannot happen
                }
                cachedWTxId = Sha256Hash.wrapReversed(Sha256Hash.hashTwice(baos.toByteArray()));
            }
        }
        return cachedWTxId;
    }
299496
@Override
	public String getCustomCacheKeyFromJwtSSOToken(String encodedjwt) {
		// TODO Auto-generated method stub
		JwtSsoTokenUtils tokenUtil = getSimpleJwtSsoTokenUtils();
		if (encodedjwt != null) {
			return tokenUtil.getCustomCacheKeyFromToken(encodedjwt);
		}
		return null;
	}
479083
public static SandboxSignkey sandboxnewPayGetsignkey(String mch_id,String key){
		MchBaseResult mchBaseResult = new MchBaseResult();
		mchBaseResult.setMch_id(mch_id);
		mchBaseResult.setNonce_str(UUID.randomUUID().toString().replace("-", ""));
		Map<String,String> map = MapUtil.objectToMap(mchBaseResult);
		String sign = SignatureUtil.generateSign(map,mchBaseResult.getSign_type(),key);
		mchBaseResult.setSign(sign);
		String closeorderXML = XMLConverUtil.convertToXML(mchBaseResult);
		HttpUriRequest httpUriRequest = RequestBuilder.post()
				.setHeader(xmlHeader)
				.setUri(MCH_URI + "/sandboxnew/pay/getsignkey")
				.setEntity(new StringEntity(closeorderXML,Charset.forName("utf-8")))
				.build();
		return LocalHttpClient.executeXmlResult(httpUriRequest, SandboxSignkey.class, mchBaseResult.getSign_type(), key);
	}
777169
public static <K, V> V getIfAbsent(Map<K, V> map, K key, Function0<? extends V> instanceBlock)
    {
        if (map instanceof UnsortedMapIterable)
        {
            return ((MapIterable<K, V>) map).getIfAbsent(key, instanceBlock);
        }
        V result = map.get(key);
        if (MapIterate.isAbsent(result, map, key))
        {
            result = instanceBlock.value();
        }
        return result;
    }
237284
public Multimap<Sha256Hash, StoredClientChannel> getChannelMap() {
        lock.lock();
        try {
            return ImmutableMultimap.copyOf(mapChannels);
        } finally {
            lock.unlock();
        }
    }
1301856
protected static <K, V> HashTrieMap<K, V> makeHashTrieMap(int hash0, CompactHashMap<K, V> elem0, int hash1, CompactHashMap<K, V> elem1, int level, int size) {
        int index0 = (hash0 >>> level) & 0x1f;
        int index1 = (hash1 >>> level) & 0x1f;
        if (index0 != index1) {
            int bitmap = (1 << index0) | (1 << index1);
            @SuppressWarnings("unchecked")
            Object[] elems = new Object[2];
            if (index0 < index1) {
                elems[0] = unwrap(elem0);
                elems[1] = unwrap(elem1);
            } else {
                elems[0] = unwrap(elem1);
                elems[1] = unwrap(elem0);
            }
            return new HashTrieMap<K, V>(bitmap, elems, size);
        } else {
            @SuppressWarnings("unchecked")
            Object[] elems = new Object[1];
            int bitmap = (1 << index0);
            elems[0] = makeHashTrieMap(hash0, elem0, hash1, elem1, level + 5, size);
            return new HashTrieMap<K, V>(bitmap, elems, size);
        }
    }
107455
private HashMap<String, Integer> getWisley_500() {
        HashMap<String, Integer> map = new HashMap<String, Integer>();

        map.put("C", 39);
        map.put("H", 72);
        map.put("N", 20);
        map.put("O", 20);
        map.put("P", 9);
        map.put("S", 10);
        map.put("F", 16);
        map.put("Cl", 10);
        map.put("Br", 4);
        map.put("Si", 8);

        return map;
    }
368517
static final CouponHashSet heapifySet(final Memory mem) {
    final int lgConfigK = extractLgK(mem);
    final TgtHllType tgtHllType = extractTgtHllType(mem);

    final CurMode curMode = extractCurMode(mem);
    final int memArrStart = (curMode == CurMode.LIST) ? LIST_INT_ARR_START : HASH_SET_INT_ARR_START;
    final CouponHashSet set = new CouponHashSet(lgConfigK, tgtHllType);
    set.putOutOfOrderFlag(true);
    final boolean memIsCompact = extractCompactFlag(mem);
    final int couponCount = extractHashSetCount(mem);
    int lgCouponArrInts = extractLgArr(mem);
    if (lgCouponArrInts < LG_INIT_SET_SIZE) {
      lgCouponArrInts = computeLgArr(mem, couponCount, lgConfigK);
    }
    if (memIsCompact) {
      for (int i = 0; i < couponCount; i++) {
        set.couponUpdate(extractInt(mem, memArrStart + (i << 2)));
      }
    } else { //updatable
      set.couponCount = couponCount;
      set.lgCouponArrInts = lgCouponArrInts;
      final int couponArrInts = 1 << lgCouponArrInts;
      set.couponIntArr = new int[couponArrInts];
      mem.getIntArray(HASH_SET_INT_ARR_START, set.couponIntArr, 0, couponArrInts);
    }
    return set;
  }
236924
public Response<String> hmset(final byte[] key, final Map<byte[], byte[]> hash) {
		if (CompressionStrategy.NONE == connPool.getConfiguration().getCompressionStrategy()) {
			return new PipelineOperation<String>() {
				@Override
				Response<String> execute(Pipeline jedisPipeline) throws DynoException {
					long startTime = System.nanoTime() / 1000;
					try {
						return jedisPipeline.hmset(key, hash);
					} finally {
						long duration = System.nanoTime() / 1000 - startTime;
						opMonitor.recordSendLatency(OpName.HMSET.name(), duration, TimeUnit.MICROSECONDS);
					}
				}
			}.execute(key, OpName.HMSET);
		} else {
			return new PipelineCompressionOperation<String>() {
				@Override
				Response<String> execute(final Pipeline jedisPipeline) throws DynoException {
					return new PipelineResponse(null).apply(new Func0<Response<String>>() {
						@Override
						public Response<String> call() {
							return jedisPipeline.hmset(key, CollectionUtils.transform(hash,
									new CollectionUtils.MapEntryTransform<byte[], byte[], byte[]>() {
										@Override
										public byte[] get(byte[] key, byte[] val) {
											return compressValue(val);
										}
									}));
						}
					});
				}
			}.execute(key, OpName.HMSET);
		}
	}
570126
private MCWrapper getMCWrapperFromMatch(
                                            Subject subject,
                                            ConnectionRequestInfo cri,
                                            ManagedConnectionFactory managedFactory,
                                            MCWrapper mcWrapperTemp) throws ResourceAllocationException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "getMCWrapperFromMatch", mcWrapperTemp);
        }
        MCWrapper mcWrapper = null;
        ManagedConnection mc = null;
        /*
         * Create a new set for every matchManagedConnection. This currently is faster than having a object pool
         * of HashSet objects that would be require synchronization. In the future, we may need to use an object pool or
         * have a matchManagedConnection that support passing a managedConnection instead of a Set.
         */
        Set<ManagedConnection> freePoolMCSet = new HashSet<ManagedConnection>(1);
        try {
            freePoolMCSet.add(mcWrapperTemp.getManagedConnection());
        } catch (java.lang.IllegalStateException e) {
            /*
             * This was an addition to do to application threading issue,
             * where we had a problem with bad mcWrappers staying in the free pool.
             * Instead of leaving this bad mcWrapper in the free pool, we are going
             * to remove it and throw the same exception, This will reduce the chance
             * of bad mcWrappers staying in the pool resulting in an unrecoverable pool.
             */
            synchronized (freeConnectionLockObject) {
                mcWrapperList.remove(mcWrapperTemp);
            }
            throw e;
        }

        try {
            int poolState = mcWrapperTemp.getPoolState();
            mcWrapperTemp.setPoolState(50);
            mc = managedFactory.matchManagedConnections(freePoolMCSet, subject, cri);

            mcWrapperTemp.setPoolState(poolState);
        } catch (ResourceException exn1) {
            com.ibm.ws.ffdc.FFDCFilter.processException(exn1, "com.ibm.ejs.j2c.poolmanager.FreePool.getMCWrapperFromMatch", "786", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(this, tc, "datasource " + gConfigProps.cfName + ": ResourceException " + exn1);
                Tr.debug(this, tc, "Throwing ResourceAllocationException...");
                Tr.debug(this, tc, "match(), Pool contents ==> " + this);
            }
            ResourceAllocationException throwMe = new ResourceAllocationException(exn1.getMessage(), exn1.getErrorCode());
            throwMe.initCause(exn1.getCause());
            pm.activeRequest.decrementAndGet();
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                Tr.exit(this, tc, "getMCWrapperFromMatch", throwMe);
            throw (throwMe);
        }

        if (mc != null) {
            mcWrapper = mcWrapperTemp;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "getMCWrapperFromMatch", mcWrapper);
        }

        return mcWrapper;
    }
191124
public static byte[] getMerkleRootHash(Queue<byte[]> hashQueue,
		@NonNull HashAlgorithm algorithm)
	{
		while (hashQueue.size() > 1)
		{
			byte[] hashValue = ArrayUtils.addAll(hashQueue.poll(), hashQueue.poll());
			switch (algorithm)
			{
				case SHA1 :
					hashQueue.add(DigestUtils.sha1(hashValue));
				case SHA256 :
					hashQueue.add(DigestUtils.sha256(hashValue));
				case SHA384 :
					hashQueue.add(DigestUtils.sha384(hashValue));
				case SHA512 :
					hashQueue.add(DigestUtils.sha512(hashValue));
				case SHA_1 :
					hashQueue.add(DigestUtils.sha1(hashValue));
				case SHA_256 :
					hashQueue.add(DigestUtils.sha256(hashValue));
				case SHA_384 :
					hashQueue.add(DigestUtils.sha384(hashValue));
				case SHA_512 :
					hashQueue.add(DigestUtils.sha512(hashValue));
				default :
					hashQueue.add(DigestUtils.sha256(hashValue));
			}
		}
		return hashQueue.poll();
	}
1286046
public String hmset(Object key, Map<Object, Object> hash) {
		Jedis jedis = getJedis();
		try {
			Map<byte[], byte[]> para = new HashMap<byte[], byte[]>();
			for (Entry<Object, Object> e : hash.entrySet())
				para.put(fieldToBytes(e.getKey()), valueToBytes(e.getValue()));
			return jedis.hmset(keyToBytes(key), para);
		}
		finally {close(jedis);}
	}
780972
public int[] hash(Key k){
      byte[] b = k.getBytes();
      if (b == null) {
        throw new NullPointerException("buffer reference is null");
      }
      if (b.length == 0) {
        throw new IllegalArgumentException("key length must be > 0");
      }
      int[] result = new int[nbHash];
      for (int i = 0, initval = 0; i < nbHash; i++) {
	  initval = hashFunction.hash(b, initval);
	  result[i] = Math.abs(initval % maxValue);
      }
      return result;
  }