Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.7.2
-
None
-
Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
-
None
-
Patch
Description
I found some inefficiencies in creation of org.apache.xpath.FunctionTable instances in the code base. Most of the time, a FunctionTable instance is created and used only to get at the default Functions stored in its static m_functions field. The only time an instance of the FunctionTable is necessary is when custom Functions are being installed (so the places where installFunction() is called), but in the code base there are very few points where this occurs.
To avoid creation of FunctionTable instances that are of very little use, I introduce a singleton (defined in FunctionTable) that represents the default FunctionTable. In all places that instantiate a new instance of FunctionTable without installing custom Functions, I remove the instantiation and instead use this singleton.
I will attach a patch file concerning my changes.