From eb5b147364b591763cf5385fc3139c337416f116 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 14 Oct 2015 13:58:00 +0200 Subject: [PATCH] Avoid ambiguous property warning for methods with multiple parameters Issue: SPR-13349 (cherry picked from commit 42d5780) --- .../beans/GenericTypeAwarePropertyDescriptor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/GenericTypeAwarePropertyDescriptor.java b/spring-beans/src/main/java/org/springframework/beans/GenericTypeAwarePropertyDescriptor.java index 7edc86dc0d1..8200d6f8cef 100644 --- a/spring-beans/src/main/java/org/springframework/beans/GenericTypeAwarePropertyDescriptor.java +++ b/spring-beans/src/main/java/org/springframework/beans/GenericTypeAwarePropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 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. @@ -88,7 +88,8 @@ class GenericTypeAwarePropertyDescriptor extends PropertyDescriptor { Set ambiguousCandidates = new HashSet(); for (Method method : beanClass.getMethods()) { if (method.getName().equals(writeMethodToUse.getName()) && - !method.equals(writeMethodToUse) && !method.isBridge()) { + !method.equals(writeMethodToUse) && !method.isBridge() && + method.getParameterTypes().length == writeMethodToUse.getParameterTypes().length) { ambiguousCandidates.add(method); } }