ok2c commented on a change in pull request #172: Normalize TimeUnit in
TimeValue's equals() and hashCode()
URL:
https://github.com/apache/httpcomponents-core/pull/172#discussion_r361410189
##########
File path: httpcore5/src/main/java/org/apache/hc/core5/util/TimeValue.java
##########
@@ -274,8 +276,8 @@ public TimeUnit getTimeUnit() {
@Override
public int hashCode() {
int hash = LangUtils.HASH_SEED;
- hash = LangUtils.hashCode(hash, duration);
- hash = LangUtils.hashCode(hash, timeUnit);
+ hash = LangUtils.hashCode(hash, this.convert(TimeUnit.NANOSECONDS));
+ hash = LangUtils.hashCode(hash, TimeUnit.NANOSECONDS);
Review comment:
@michael-o `hash = LangUtils.hashCode(hash, TimeUnit.NANOSECONDS)` can be
dropped as unnecessary.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]