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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to