Ugo Cei wrote: > > [EMAIL PROTECTED] wrote: > > ------- Additional Comments From [EMAIL PROTECTED] 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