cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: DO NOT REPLY [Bug 17673] - sendPage function in Flow causes an NPE.
Date Mon, 10 Mar 2003 09:41:23 GMT

Ugo Cei wrote:
>
> bugzilla@apache.org wrote:
> > ------- Additional Comments From u.cei@cbim.it  2003-03-10 09:30 -------
> > I have a patch (attached) that hopefully fixes this bug. What
> it does is to wrap
> > the call to this.rootNode.invoke in
> o.a.c.components.treeprocessor.TreeProcessor
> > with a call to CocoonComponentManager.startProcessing (before) and to
> > CocoonComponentManager.endProcessing (after), mimicking the behavior of
> > o.a.c.Cocoon.
>
> Looks like this morning I enjoy talking to myself ;-).
>
> One brief note: in order to fix that bug, I had to make two more
> changes, adding defensive null checks in AbstractEnvironment.release:
>
>          if ( null != source && null != sourceResolver)
>              this.sourceResolver.release( source );
>
> and CocoonComponentManager.leaveEnvironment:
>
>          if (desc != null) {
>              desc.removeLastSitemapConfiguration();
>          }
>
> Is this a case of not enough defensive programming or do the NPEs that
> occur when the checks are not in place a symptom of a problem somewhere
> else that the checks merely hide from view?
>

Yes, this should be the case, the problem should lie somewhere else. That's
exactly why I removed the null checks from the code above. Because *if*
everything is working properly, an NPE can never occur.

Carsten


Mime
View raw message