Anonymous | Login | Signup for a new account | 12-17-2024 11:40 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Advanced Details [ Jump to Notes ] | [ View Simple ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0003748 | [Quercus] | feature | always | 11-05-09 12:52 | 11-07-09 17:45 | ||||
Reporter | PeterJ | View Status | public | ||||||
Assigned To | nam | ||||||||
Priority | normal | Resolution | fixed | Platform | |||||
Status | closed | OS | |||||||
Projection | none | OS Version | |||||||
ETA | none | Fixed in Version | 4.0.2 | Product Version | 4.0.2 | ||||
Product Build | |||||||||
Summary | 0003748: Avoid recursive instropection of methods. | ||||||||
Description |
At the end of ...program.JavaClassDef.introspectMethods, the method calls itself recursively, first for the superclasses and then for the interfaces. This does not appear to be necessary because the line type.getMethods() already provided all of the methods from the superclasses and the interfaces. Even the code in AbstractJavaMethod.overload seems to acknowledge that the superclass and interface methods can be previously processed. Removing this recursion would provide some performance benefit because the amount of duplicate effort would be eliminated, and the extra garbage generated by overriding the entries in _functionMap would be avoided. In addition, it would benefit developers who are attempting to extend the existing capabilities. For example, I am attempting to provide support for another database, but I do not want to support as PHP functions some of the methods that are provided in JdbcConnectionResource. Unfortunately, overriding the method in my class and adding a @Hide annotation does not work because of the recursion in introspectMethods - the overridden methods get added as functions for my PHP class anyway. Finally, I also noticed that the public methods on java.lang.Object are added as functions available to the PHP class. I don't think that this was intended so the attached patch includes a test to eliminate those methods. By the way, if my logic is flawed and there is a perfectly valid reason for the recursion, then it would be nice if a comment explaining WHY THE RECURSION IS NECESSARY would appear in the code. I hate attempting to make sense of someone else's code when they have not commented on WHY they wrote the code the way they did, especially if the code in question does not make obvious sense (in the way that this recursion makes no obvious sense). |
||||||||
Steps To Reproduce | |||||||||
Additional Information | |||||||||
Attached Files | quercus_introspect_recursion.txt [^] (953 bytes) 11-05-09 12:52 | ||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
35 total queries executed. 28 unique queries executed. |