DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=28486>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=28486 [digester] ExtendedBaseRules test fails ------- Additional Comments From [EMAIL PROTECTED] 2004-04-20 07:35 ------- Ok, I think I've got it pinned down. The test itself was a very good one. It asked: given the pattern "a/b/c/d" is the preferred match: */b/c/d or */b/c/* The specs for the ExtendedBaseRules class say that: [quote] */a/b/*" matches any elements whose parentage path contains an element 'a' followed by an element 'b'. The longest matching still applies but the length excludes the '*' at the end. [/quote] The code currently tries to handle this by subtracting 1 from *new candidate keys* when the length if (parentMatched || ancestorMatched). However: (a) it should subtract 2(?) for patterns that both begin and end with wildcards, and (b) it doesn't apply any corrections to the "previously longest key" it is comparing against. And when 2 patterns of the same "length" exist in the cache, and they both match, only the first matching pattern is kept. So the current code passes the test only if the cache returns the "correct" match first. Which it appears to do with jvm 1.4 but not 1.2! I will attach a patch soon. I would appreciate review of this, as it has the potential to break a lot of stuff if it is wrong. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
