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

Cached MethodExecutor invokes wrong method [SPR-10657] #15285

Closed
spring-issuemaster opened this issue Jun 16, 2013 · 4 comments
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Jun 16, 2013

Oliver Becker opened SPR-10657 and commented

The readme.txt in module spring-expression asks whether the caching of (method) executors can do any harm.

It can. At least it may lead to the invocation of the wrong method, if there are overloaded methods of the same name with different parameter types.


Affects: 3.2.3, 4.0 M1

Reference URL: https://github.com/SpringSource/spring-framework/blob/02a4473c62d8240837bec297f0a1f3cb67ef8a7b/spring-expression/readme.txt

Attachments:

Sub-tasks:

  • #15312 Backport "Cached MethodExecutor invokes wrong method"

Issue Links:

  • #15085 SPEL and Enum variable resolution using wrong cachedExecutor
  • #15511 Race condition in org.springframework.expression.spel.ast.MethodReference
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jun 24, 2013

Phil Webb commented

Hi Oliver,

Thanks for reporting this and for the very useful test case. I have updated the cache to now also check against argument types which should fix the overloading use-case.

f9b12b8

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jun 28, 2013

Oliver Becker commented

Thanks for the fix. However, the same problem may occur when changing the target of a method call.

I will extend the test and open a pull request

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jun 28, 2013

Oliver Becker commented

Here is the pull request
#307

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jun 28, 2013

Phil Webb commented

Thanks Oliver,

I have pushed another update, if you see any other issues please re-open the JIRA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.