Hi Carsten,

I think we fixed a bug but got another. That is good, because by introducing a new test case for the new bug and fixing it, our code get better.

Anyhow, here is how to see the new bug in the WildcardMatcher:

1- Open: http://cocoon.zones.apache.org/demos/21branch/
2- Click on link "samples" and we get the same page as response.
3-Repeat 2 and you will see the uri is growing and growing to something like:
   http://cocoon.zones.apache.org/demos/21branch/samples/samples/samples/

and the result page is the same all the time.

Best Regards,

Antonio Gallardo


Carsten Ziegeler escribió:
Hi,

I just fixed the bug in our wildcard helper. The problem was the
following: if a pattern ends with a constant string (like ".xml")
and the uri in question contained this constant twice (like
("hello.xml.xml") the pattern did not match.

I added a junit test case for this and now the tests all succeed.
BUT, while looking at the wildcard helper code, I found several smelling
code place, like unreachable code etc. which I cleaned up.
In addition the fix for the bug "seems" to work, but I'm not 100% sure
if it breaks something else.
So, it would be great if others can review the code.

I'm not sure if the code of the wildcard helper is correct at all; I
guess there are still other cases where the pattern does not match
although it should. So I think we have to rewrite the code anyway. One
idea I had is to transform the pattern into a regexp and then use
one of the regexp libraries for matching.

WDYT
Carsten


Reply via email to