Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369340 - unnecessary call to fieldMethodCache to obtain method in FieldUtil.callMethod implementation and possible problems when having overloaded methods
Summary: unnecessary call to fieldMethodCache to obtain method in FieldUtil.callMethod...
Status: RESOLVED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Teneo (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-22 14:41 EST by Krasimir Chobantonov CLA
Modified: 2012-01-30 06:39 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Krasimir Chobantonov CLA 2012-01-22 14:41:46 EST
Build Identifier: 1.2.0.v201112061230

the call to

Method method = (Method) fieldMethodCache.get(obj.getClass().getName() + "." + methodName);

inside FieldUtil.callMethod is not necessary because all methods are registered in filedMethodCache with their method parameters length like the following 

fieldMethodCache.put(obj.getClass().getName() + "." + methodName + "."
						+ (params == null ? 0 : params.length), method);

Also check if having only the number of parameters in the method key is enough when there are overloaded methods.

Maybe we need to pass also the method parameter types when calling this function (not only the actual parameters)

Reproducible: Always
Comment 1 Martin Taal CLA 2012-01-26 13:09:00 EST
I pushed a solution, will be in the next build. I did not make the change to also check the parameter type. This method is mainly used internally and I could not find a common reason to overload the called methods with a different one with different parameter types.
Comment 2 Martin Taal CLA 2012-01-30 06:39:32 EST
Build is done and published