提交 dd65689e 编写于 作者: J Juergen Hoeller

MethodParameter.equals accepts subclasses pointing to same target declaration again

Issue: SPR-14438
上级 04e9c2bf
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册