Skip to content

Commit 19f5d4c

Browse files
committed
Cleanup
1 parent 7d7e504 commit 19f5d4c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/assertions/AttributeMatcher.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public boolean equals(Object o) {
5656

5757
@Override
5858
public int hashCode() {
59-
// Do not use value matcher here to support value wildcards
6059
return Objects.hash(attributeName);
6160
}
6261

@@ -69,15 +68,12 @@ public String toString() {
6968

7069
/**
7170
* Verify if this matcher is matching provided attribute value. If this matcher holds null value
72-
* then it is matching any attribute value
71+
* then it is matching any attribute value.
7372
*
7473
* @param value a value to be matched
7574
* @return true if this matcher is matching provided value, false otherwise.
7675
*/
7776
boolean matchesValue(String value) {
78-
if (attributeValue == null) {
79-
return true;
80-
}
81-
return Objects.equals(attributeValue, value);
77+
return (attributeValue == null) || Objects.equals(attributeValue, value);
8278
}
8379
}

0 commit comments

Comments
 (0)