Skip to content

Commit e789dad

Browse files
authored
Merge pull request #450 from frenchy64/profile-reflection
Resolve reflective calls in profiling plugin
2 parents 15c7d7b + 917a74e commit e789dad

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
## Fixed
66

77
- Fix beholder watch functionality that would cause a NullPointerException earlier.
8+
- Resolve reflective calls in profiling plugin.
89

910
## Changed
1011

src/kaocha/plugin/profiling.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
(:import java.time.Instant
88
java.time.temporal.ChronoUnit))
99

10+
(set! *warn-on-reflection* true)
11+
1012
(spec/def ::start #(instance? Instant %))
1113
(spec/def ::duration nat-int?)
1214
(spec/def ::profiling? boolean?)
@@ -18,7 +20,7 @@
1820
(defn stop [testable]
1921
(cond-> testable
2022
(::start testable)
21-
(assoc ::duration (.until (::start testable)
23+
(assoc ::duration (.until ^Instant (::start testable)
2224
(Instant/now)
2325
ChronoUnit/NANOS))))
2426

0 commit comments

Comments
 (0)