Uploaded image for project: 'Commons JXPath'
  1. Commons JXPath
  2. JXPATH-15

JXPathContextFactory doesn't cache most common result of search

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Nightly Builds
    • None
    • None
    • Operating System: All
      Platform: All

    • 22333

    Description

      JXPathContextFactory's search for a factory class name caches all values
      returned in the search except the default value. This means that in the
      default case (which is the most common, obviously), the search is performed
      every time, which is quite expensive.

      this is the problem method:
      private static String findFactory(String property, String defaultFactory)

      note that it does not cache the value of defaultFactory in the foundFactory
      class variable when that is the value returned.

      suggest adding
      foundFactory = defaultFactory;
      return foundFactory;

      in place of
      return defaultFactory;

      at the end of this method.

      Attachments

        Activity

          People

            Unassigned Unassigned
            eric.d.friedman@wellsfargo.com Eric Friedman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: