-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Cameron McCormack wrote:
> Hi Bogdan.
> 
> Bogdan:
>> This small patch fixes some potential and real NullPointerExceptions.
> 
> Thanks for the patch.  Some comments:
> 
> - if (at.equals(vt)) {
> -   // No new transform
> …
> + if (at != null) {
> +   if (at.equals(vt)) {
> +     // No new transform
> 
> I can’t see how at can be null.  AFAICT, calculateViewingTransform()
> will always return an object.

 Perhaps. I'm not saying it returned null. I know I got a
NullPointerException and it was either 'myCGN' or 'at' that was null.
So I checked for both, just in case.

> - myCGN.setViewingTransform(myAT);
> + if (myCGN != null) myCGN.setViewingTransform(myAT);
> 
> For this one, yes, it seems myCGN can be null, if the GVT being
> displayed in the component were messed with so that it doesn’t look
> like:
> 
>   CompositeGraphicsNode
>     +
>     |
>     +--CanvasGraphicsNode
>          +
>          :
> 
> since getCanvasGraphicsNode() will return null in this case.

 I see. Well, I'm not messing with the internals of batik, but I'm
putting it under heavy stress, to see how my program behaves when it's
reaching the virtual machine's memory limit. This is how I got most of
the exceptions/problems I sent patches for.

> JSVGComponent.setGraphicsNode(GraphicsNode,boolean) could also throw an
> NPE if getCanvasGraphicsNode() returned null.

 Yes. I didn't notice that.

> It seems a bit strange to allow messing with the GVT from outside the
> JSVGComponent, but with the current design there’s not much we can do
> about that, I think.
> 
> I’ve put the null check for the line in your patch and in
> setGraphicsNode(GraphicsNode,boolean).

 OK, thanks!

- --
Pozdrawiam/Regards - Bogdan                     (GNU/Linux & FreeDOS)
Kurs asemblera x86 (DOS, GNU/Linux):http://rudy.mif.pg.gda.pl/~bogdro
Grupy dyskusyjne o asm:  pl.comp.lang.asm alt.pl.asm alt.pl.asm.win32
www.JabberPL.org www.TorProject.org Soft (EN): miniurl.pl/bogdro-soft
-----BEGIN PGP SIGNATURE-----

iD8DBQFJwoWsNTrTaBxW2h4RAzaRAJ9AzppKHw2vEvldoNkHT2EJ6FStWACdHNT+
H+oKUl/467Eq8xaodk76XwA=
=SaI9
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to