Closed Bug 202872 Opened 22 years ago Closed 22 years ago

Removal of FunctionObject.findMethods?

Categories

(Rhino Graveyard :: Core, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: igor, Assigned: norrisboyd)

Details

Attachments

(1 file)

Currently FunctionObject.findMethods is used to search for all methods with the same name in the given class and returns them as an array. But all places where this method is used in Rhino expects explicitly or implicitly that there is only one such method. So the idea is to replace static Method[] findMethods(Class clazz, String name) by static Method findSingleMethod(Class clazz, String name) which will throw an exception if the method is overloaded. But then findMethods uses a static cache for a method list for the given class since in few places findMethods is called many times on the same class but that is also overkill since in all such places FunctionObject.getMethodList can be used to get the list and caching with all potential memory leaks can be removed completely. So the following patch replaces findMethods by static Method findSingleMethod(Class clazz, String name) ... The patch removes FunctionObject.findMethods but since it contains comments // TODO: Make not public perhaps somebody used the method outside Rhino? If this is an issue the method can be restored with explicit deprecation but I would prefer to remove it explicitly if possible.
I commited the patch as is, if somebody uses findMethods, then cvs diff -r 1.52 -r 1.53 FunctionObject.java can be used to put it back as a deprecated method.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Checkin verified -
Status: RESOLVED → VERIFIED
Targeting as resolved against 1.5R5
Target Milestone: --- → 1.5R5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: