commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22333] New: - JXPathContextFactory doesn't cache most common result of search
Date Mon, 11 Aug 2003 23:29:14 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22333>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22333

JXPathContextFactory doesn't cache most common result of search

           Summary: JXPathContextFactory doesn't cache most common result of
                    search
           Product: Commons
           Version: Nightly Builds
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: JXPath
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: Eric.D.Friedman@wellsfargo.com


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.

Mime
View raw message