Align AnnotatedMethod#equals and #hashcode

See gh-34375
This commit is contained in:
rstoyanchev 2025-02-07 13:06:18 +00:00
parent 56c4d2d4ca
commit ff49b0b683
1 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -214,8 +214,8 @@ public class AnnotatedMethod {
@Override
public boolean equals(@Nullable Object other) {
return (this == other || (other != null && getClass() == other.getClass() &&
this.method.equals(((AnnotatedMethod) other).method)));
return (this == other || (other instanceof AnnotatedMethod otherHandlerMethod &&
this.method.equals(otherHandlerMethod.method)));
}
@Override