Skip to content

Commit

Permalink
hooks: Add equals-hook for Clojure (clojure.lang.Util.equiv)
Browse files Browse the repository at this point in the history
  • Loading branch information
zgtm committed Jun 12, 2023
1 parent 1d6c29c commit 7b76467
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ final public class TraceCmpHooks {
}
}

@MethodHook(type = HookType.AFTER, targetClassName = "clojure.lang.Util", targetMethod = "equiv")
public static void
genericStaticEquals(
MethodHandle method, Object thisObject, Object[] arguments, int hookId, Boolean areEqual) {
if (!areEqual && arguments.length == 2 && arguments[0] != null && arguments[1] != null
&& arguments[1].getClass() == arguments[0].getClass()) {
TraceDataFlowNativeCallbacks.traceGenericCmp(arguments[0], arguments[1], hookId);
}
}

@MethodHook(
type = HookType.AFTER, targetClassName = "java.lang.String", targetMethod = "compareTo")
@MethodHook(type = HookType.AFTER, targetClassName = "java.lang.String",
Expand Down

0 comments on commit 7b76467

Please sign in to comment.