POV-Ray : Newsgroups : povray.off-topic : Any Java experts? : Re: Any Java experts? Server Time
10 Oct 2024 23:18:53 EDT (-0400)
  Re: Any Java experts?  
From: Gail Shaw
Date: 18 Jan 2008 11:37:14
Message: <4790d5ba@news.povray.org>
"Orchid XP v7" <voi### [at] devnull> wrote in message
news:478fc569$1@news.povray.org...
> Gail Shaw wrote:
>
> > boolean hasShip() {
> > if (localShip!=null)
> > return true;
> > else
> > return false;
> > }
>
> This cannot possibly throw a null pointer exception.

Yeah, that's what I thought. Eclipse keeps giving me a null pointer excption
and pointing at that line.
Really odd thing is that the exception isn't halting execution.

>  > Node currentNode = Universe.space[i][j]; // Have checked and this is
> never
>  > null.
>  > if (currentNode.hasShip()) { // <-- This line sometimes throws a
>  > NullPointerException
>
> The only way for a null pointer exception to occur is if currentNode is
> null.

Which it's not. I have print statements checking that. Removed them from the
post for clarity


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.