rhuss/jmx4perl — pull request #33 by fries (2014-02-25 19:41:20+00:00)
Title: Fix printing of booleans for 'data' format.

When using the default 'data' format all boolean values
are reported as '[false]'. When using 'json' format
boolean values are correctly reported as 'false' or 'true'.

The problem is in lib/JMX/Jmx4Perl/Util.pm:
JSON::is_bool is used to determin if a value is a boolean.
If so the value is compared against the string 'true' and
formated to either '[false]' or '[true]'. This comparison
failes and returns always '[false]'.

Changing the comparison to '$value eq JSON::true' produces
the correct result.

Testing against constant JSON::true should be safe, as
JSON::is_bool only returns true if the value represents
either JSON::true or JSON::false (see perldoc JSON, is_bool).