Skip to content

Commit 05a16a1

Browse files
committed
Avoid ambiguous property warning for methods with multiple parameters
Issue: SPR-13349
1 parent 27899ab commit 05a16a1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-beans/src/main/java/org/springframework/beans/GenericTypeAwarePropertyDescriptor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -90,7 +90,8 @@ public GenericTypeAwarePropertyDescriptor(Class<?> beanClass, String propertyNam
9090
Set<Method> ambiguousCandidates = new HashSet<Method>();
9191
for (Method method : beanClass.getMethods()) {
9292
if (method.getName().equals(writeMethodToUse.getName()) &&
93-
!method.equals(writeMethodToUse) && !method.isBridge()) {
93+
!method.equals(writeMethodToUse) && !method.isBridge() &&
94+
method.getParameterTypes().length == writeMethodToUse.getParameterTypes().length) {
9495
ambiguousCandidates.add(method);
9596
}
9697
}

0 commit comments

Comments
 (0)