commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34959] - [modeler] Overloaded operations throw "wrong number of parameters" exception
Date Thu, 09 Jun 2005 14:49:27 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34959>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34959





------- Additional Comments From whu@sybase.com  2005-06-09 16:49 -------
Created an attachment (id=15351)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=15351&action=view)
Fixed class org.apache.commons.modeler.BaseModelMBean

Cause of the problem:
Class org.apache.commons.modeler.BaseModelMBean internally stores and caches
operations in a hashmap. The key to the hashmap is the operation name.
Therefore,if an operation has multiple signatures, only one of them (the first
one loaded) is stored in the hashmap. Invoking the same method with a different
signature will cause "wrong number of parameters" exception.

Here's my fix:

Class:	Class org.apache.commons.modeler.BaseModelMBean
Method: public Object invoke(String name, Object params[], String signature[])
Line: 445
	/**
	 * whu, 2005-05-10:
	 * This is a bug. It can not handle the situation that an overloaded 
	 * operation/method has multiple signatures. The cached method map
	 * invokeAttMap's key is the method name, which is wrong. The key
	 * should be name + signature.
	 * 
	 * A simple fix is not to retrieve the method from invokeAttMap. 
	 */
	Method method = null;	     
	//Method method=(Method)invokeAttMap.get(name);

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message