Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid ambiguous property warning for setter methods with multiple parameters [SPR-13349] #17933

Closed
spring-projects-issues opened this issue Aug 13, 2015 · 3 comments
Assignees
Labels
status: backported type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Aug 13, 2015

Tristan Hill opened SPR-13349 and commented

I'm getting this warning on application initialization:

WARN  org.springframework.beans.GenericTypeAwarePropertyDescriptor  - Invalid JavaBean property 'endpoint' being accessed! Ambiguous write methods found next to actually used [public void com.amazonaws.AmazonWebServiceClient.setEndpoint(java.lang.String) throws java.lang.IllegalArgumentException]: [public void com.amazonaws.AmazonWebServiceClient.setEndpoint(java.lang.String,java.lang.String,java.lang.String)]

The bean configuration is:

<bean class="com.amazonaws.services.s3.AmazonS3Client" id="s3Client">
    <constructor-arg index="0" ref="awsDefaultCredentialsProviderChain"/>
    <constructor-arg index="1" ref="awsClientConfiguration"/>
    <property name="endpoint" value="value"/>
</bean>

Is the method really ambiguous since only a single string parameter is provided as argument?


Affects: 3.2.14

Issue Links:

  • #9606 Spring inconsistently resolves an overloaded setter method

Referenced from: commits eb5b147, 42d5780, 05a16a1

Backported to: 4.1.8, 3.2.15

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 13, 2015

Tristan Hill commented

some relation to #11065

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 13, 2015

Juergen Hoeller commented

Strictly speaking, such an overloaded method is not a valid JavaBean property even in case of a different number of parameters. However, point taken that it is not an issue in practice, since we'll always pick the single-arg method anyway.

I'll try to reduce that warning check to single-arg methods for 4.2.1.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 21, 2015

Juergen Hoeller commented

Resolved for 4.2.1 now, and also scheduled for a backport to 4.1.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: backported type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants