public static long calculateHash(Method method) { Map methodHashes = (Map) hashMap.get(method.getDeclaringClass()); if (methodHashes == null) { // Add the method hashes for the class if( useFullHashMode == true ) methodHashes = getFullInterfaceHashes(method.getDeclaringClass()); else methodHashes = getInterfaceHashes(method.getDeclaringClass()); synchronized (hashMap) { hashMap.put(method.getDeclaringClass(), methodHashes); } } Long hash = (Long) methodHashes.get(method.toString()); return hash.longValue(); }