From 917a74eff592781c9ef32b152d5c45c93e5beeef Mon Sep 17 00:00:00 2001 From: Ambrose Bonnaire-Sergeant Date: Sun, 22 Dec 2024 12:02:30 -0600 Subject: [PATCH] Resolve reflective calls in profiling plugin --- CHANGELOG.md | 1 + src/kaocha/plugin/profiling.clj | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2a55f26..96aab02c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## Fixed - Fix beholder watch functionality that would cause a NullPointerException earlier. +- Resolve reflective calls in profiling plugin. ## Changed diff --git a/src/kaocha/plugin/profiling.clj b/src/kaocha/plugin/profiling.clj index ba8b3428..2c33fc6f 100644 --- a/src/kaocha/plugin/profiling.clj +++ b/src/kaocha/plugin/profiling.clj @@ -7,6 +7,8 @@ (:import java.time.Instant java.time.temporal.ChronoUnit)) +(set! *warn-on-reflection* true) + (spec/def ::start #(instance? Instant %)) (spec/def ::duration nat-int?) (spec/def ::profiling? boolean?) @@ -18,7 +20,7 @@ (defn stop [testable] (cond-> testable (::start testable) - (assoc ::duration (.until (::start testable) + (assoc ::duration (.until ^Instant (::start testable) (Instant/now) ChronoUnit/NANOS))))