public static int getNonNativeMods(int mod) {
return mod & ~Modifier.NATIVE;
}
public static void main(String[] args) {
ClassInfo model = new ModelClassProvider().loadClassInfo("java.lang.System");
ClassInfo peer = new NativePeerProvider().loadNativePeerClass(model);
MethodInfo modelMethod = model.getMethod("currentTimeMillis", "()J", false);
System.out.println(modelMethod);
MethodInfo peerMethod = peer.getMethod(
"currentTimeMillis____J", "(Lgov/nasa/jpf/jvm/MJIEnv;I)J", false);
System.out.println(peerMethod);
MangledMethodInfoComparator comp1 = new MangledMethodInfoComparator(true);
System.out.println(comp1.compare(modelMethod, peerMethod));
MangledMethodInfoComparator comp2 = new MangledMethodInfoComparator(false);
System.out.println(comp2.compare(peerMethod, modelMethod));
MethodInfo[] methods = peer.getDeclaredMethodInfos();
Arrays.sort(methods, new MethodInfoComparator());
System.out.println(Arrays.binarySearch(methods, modelMethod, comp2));
}