Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2596

Removing unnecessary creation of FunctionTable

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.7.2
    • None
    • XPath
    • 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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            shathaway Steven J. Hathaway
            awshi2 August Shi

            Dates

              Created:
              Updated:

              Slack

                Issue deployment