Skip to content

Commit 6b3be9a

Browse files
committed
Correctly handle boolean values returned via JMX.
Patch for JMX-15 by Chris Lohfink
1 parent c67f629 commit 6b3be9a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/main/clojure/clojure/java/jmx.clj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@
145145
[m]
146146
(into {} (zipmap (keys m) (map objects->data (vals m)))))
147147

148+
java.lang.Boolean
149+
(objects->data [b] (boolean b))
148150
Object
149151
(objects->data [obj] obj)
150152
nil

src/test/clojure/clojure/java/test_jmx.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@
9494
(deftest writing-attributes
9595
(let [mem "java.lang:type=Memory"]
9696
(jmx/write! mem :Verbose true)
97-
;; need boolean cast to fix Boolean object identity error
98-
(is (true? (boolean (jmx/raw-read mem :Verbose))))
99-
(jmx/write! mem :Verbose false)))
97+
(is (true? (jmx/read mem :Verbose)))
98+
(jmx/write! mem :Verbose false)
99+
(is (false? (jmx/read mem :Verbose)))))
100100

101101
(deftest test-invoke-operations
102102
(testing "without arguments"

0 commit comments

Comments
 (0)