Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 17793 invoked from network); 20 Apr 2004 07:34:53 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 20 Apr 2004 07:34:53 -0000 Received: (qmail 58376 invoked by uid 500); 20 Apr 2004 07:34:26 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 58308 invoked by uid 500); 20 Apr 2004 07:34:25 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 58295 invoked from network); 20 Apr 2004 07:34:25 -0000 Received: from unknown (HELO exchange.sun.com) (192.18.33.10) by daedalus.apache.org with SMTP; 20 Apr 2004 07:34:25 -0000 Received: (qmail 16696 invoked by uid 50); 20 Apr 2004 07:35:24 -0000 Date: 20 Apr 2004 07:35:24 -0000 Message-ID: <20040420073524.16695.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: commons-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 28486] - [digester] ExtendedBaseRules test fails X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . 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 simon@ecnetwork.co.nz 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: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org