MethodParameter.equals accepts subclasses pointing to same target declaration again
Issue: SPR-14438
This commit is contained in:
@@ -579,7 +579,7 @@ public class MethodParameter {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (other == null || getClass() != other.getClass()) {
|
||||
if (!(other instanceof MethodParameter)) {
|
||||
return false;
|
||||
}
|
||||
MethodParameter otherParam = (MethodParameter) other;
|
||||
|
||||
@@ -27,6 +27,7 @@ import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
* @since 5.0
|
||||
*/
|
||||
public class SynthesizingMethodParameterTests {
|
||||
|
||||
@@ -69,8 +70,8 @@ public class SynthesizingMethodParameterTests {
|
||||
assertNotEquals(methodParameter, longParameter);
|
||||
|
||||
methodParameter = new MethodParameter(method, 0);
|
||||
assertNotEquals(stringParameter, methodParameter);
|
||||
assertNotEquals(methodParameter, stringParameter);
|
||||
assertEquals(stringParameter, methodParameter);
|
||||
assertEquals(methodParameter, stringParameter);
|
||||
assertNotEquals(longParameter, methodParameter);
|
||||
assertNotEquals(methodParameter, longParameter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user