client_java icon indicating copy to clipboard operation
client_java copied to clipboard

Label does not implement .equals() and .hashCode()

Open dhoard opened this issue 1 year ago • 0 comments

Issue

Label implements Comparable but it doesn't implement .equals(Object o) and .hashCode().

Code

https://github.com/prometheus/client_java/blob/main/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Label.java

Test

Label label1 = new Label("foo", "bar");
Label label2 = new Label("foo", "bar");
assertTrue(label1.equals(label2));

dhoard avatar Nov 03 '23 11:11 dhoard