cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Re: cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap
Date Tue, 29 Jul 2003 20:36:12 GMT

>Carsten Ziegeler wrote:

>>Sylvain Wallez wrote:
>>>I couldn't find Volker's report, but I think it's the selector's
>>>responsibility to handle the case when it returns a null context object
>>>and that the sitemap should not enforce a failure in that case.
>>>Furthermore, this modification prevents execution of the statements in
>>><map:otherwise> when the context object is null.
>>>What do you think ?
>>Ok, Volker wrote it to me privately :) and I haven't thought about it
>>when committing.
>Volker, please report bugs on the list. More eyes on a problem never
>cause harm ;-)

You are right, I did this, because we spoke before about our changes in the
new portal engine.... and it was late as it is now ;-)
Anyway, I think I found the real bug and it is in the ExceptionSelector
line 185:

public boolean select(String expression, Object selectorContext) {
    // Just compare the expression with the previously found name
    boolean result = expression.equals
(((FindResult)selectorContext).getName()); // line 185

As you described above it is the responsibility of the Selector and the
ExceptionSelector throws a NullPointerException if the selectorContext is
null. So I think we need to add a
if (selectorContext == null)
      return false;

Sorry for the noise ;-)

Carsten, do you remember, what the difference is between
"JXPathExceptionSelector" and "XPathExceptionSelector". I think
JXPathExceptionSelector is an old version of XPathExceptionSelector and can
not work because of line 132:
String exceptionName =
      (String) super.getSelectorContext(objectModel, parameters);
getSelectorContext() returns an FindResult Object not a String, so I think
it can't work. I think we can remove it.

>>After thinking, I don't have an idea why the context of a selector could
>>be null, so I think this is the error.
>>As I'm currently in the release process I will revert the change and
>>the version with the old behaviour.
>>We can then discuss what's the correct approach.

>Ok. Preparing the champagne ;-)


View raw message