@Test public void testLonger() { Assert.assertTrue(MethodHash.compareHashes(hash, longerHash) < 0); }
public static int compareHashes(byte[] a, byte[] b) { int pfxlen = Math.min(a.length, b.length); for (int i = 0; i < pfxlen; ++i) { int cmp = toUnsigned(a[i]) - toUnsigned(b[i]); if (cmp != 0) { return cmp; } } return a.length - b.length; }
MethodHash implements Comparable<MethodHash> { public static int compareHashes(byte[] a, byte[] b) { int pfxlen = Math.min(a.length, b.length); for (int i = 0; i < pfxlen; ++i) { int cmp = toUnsigned(a[i]) - toUnsigned(b[i]); if (cmp != 0) { return cmp; } } return a.length - b.length; } }
MethodHash implements Comparable<MethodHash> { public static int compareHashes(byte[] a, byte[] b) { int pfxlen = Math.min(a.length, b.length); for (int i = 0; i < pfxlen; ++i) { int cmp = toUnsigned(a[i]) - toUnsigned(b[i]); if (cmp != 0) { return cmp; } } return a.length - b.length; } MethodHash();  MethodHash(String methodName, String methodSig, boolean isStatic, byte[] hash); }
MethodHash implements Comparable<MethodHash> { public static int compareHashes(byte[] a, byte[] b) { int pfxlen = Math.min(a.length, b.length); for (int i = 0; i < pfxlen; ++i) { int cmp = toUnsigned(a[i]) - toUnsigned(b[i]); if (cmp != 0) { return cmp; } } return a.length - b.length; } MethodHash();  MethodHash(String methodName, String methodSig, boolean isStatic, byte[] hash); String getMethodName(); String getMethodSig(); boolean isStatic(); byte[] getMethodHash(); MethodHash computeHash(Method method); boolean isSameHash(MethodHash other); @Override int compareTo(MethodHash other); @Override boolean equals(Object o); @Override int hashCode(); static int compareHashes(byte[] a, byte[] b); }
MethodHash implements Comparable<MethodHash> { public static int compareHashes(byte[] a, byte[] b) { int pfxlen = Math.min(a.length, b.length); for (int i = 0; i < pfxlen; ++i) { int cmp = toUnsigned(a[i]) - toUnsigned(b[i]); if (cmp != 0) { return cmp; } } return a.length - b.length; } MethodHash();  MethodHash(String methodName, String methodSig, boolean isStatic, byte[] hash); String getMethodName(); String getMethodSig(); boolean isStatic(); byte[] getMethodHash(); MethodHash computeHash(Method method); boolean isSameHash(MethodHash other); @Override int compareTo(MethodHash other); @Override boolean equals(Object o); @Override int hashCode(); static int compareHashes(byte[] a, byte[] b); static final String METHOD_HASH_ELEMENT_NAME; }