forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject RE: svn commit: r695423 - /forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java
Date Mon, 15 Sep 2008 22:14:21 GMT
On Mon, 2008-09-15 at 16:46 +0200, Thorsten Scherler wrote:
> On Mon, 2008-09-15 at 21:31 +1000, Gavin wrote:
> ...
> > > New Revision: 695423
> > > 
> > > URL: http://svn.apache.org/viewvc?rev=695423&view=rev
> > > Log:
> > > Fixing possible NPE.
> > > 
> > > Modified:
> > > ...
> > > -    xslStream.close();
> > > +    if(xslStream!=null){
> > > +      xslStream.close();
> > > +    }
> > >      /*
> > >       * HACK END
> > >       */
> > > @@ -203,7 +205,9 @@
> > >          elementName = reader.getLocalName();
> > >          if (elementName.equals(CONTRACT_ELEMENT)) {
> > >            InputStream resultStream = contract.execute(dataStream, param);
> > > -          dataStream.close();
> > 
> > > +          if (null!=dataStream){
> > 
> > Should that not be the other way around ?
> 
> Hmm, no, because if the dataStream is null, one cannot close it. That
> would throw a NPE.

Rereading your and mine answer:

null!=dataStream is the same as dataStream!=null

salu2

> 
> Cheers for checking.
> 
> salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


Mime
View raw message