Skip to content

[Backport] Fix two improper casts in HavingSpecMetricComparator.#5357

Merged
jon-wei merged 1 commit intoapache:0.12.0from
gianm:backport-5352-to-0.12.0
Feb 7, 2018
Merged

[Backport] Fix two improper casts in HavingSpecMetricComparator.#5357
jon-wei merged 1 commit intoapache:0.12.0from
gianm:backport-5352-to-0.12.0

Conversation

@gianm
Copy link
Copy Markdown
Contributor

@gianm gianm commented Feb 6, 2018

Backport of #5352 to 0.12.0.

* Fix two improper casts in HavingSpecMetricComparator.

Fixes two things:

1. An improper double-to-long cast when comparing double metrics to any
   kind of value, which was a regression from apache#4883.
2. An improper double-to-long cast when comparing a long/int metric to a
   double/float value: the value was cast to long/int, drawing strange
   conclusions like int 100 matching a havingSpec of equalTo(100.5).

* Add comments.

* Remove extraneous comment.

* Simplify code a bit.
@gianm gianm added the Backport label Feb 6, 2018
@gianm gianm added this to the 0.12.0 milestone Feb 6, 2018
@jon-wei jon-wei merged commit 7f28090 into apache:0.12.0 Feb 7, 2018
@gianm gianm deleted the backport-5352-to-0.12.0 branch September 23, 2022 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants