Re: Exception in java3d

Hi Russell,

On Fri, 11 Jul 2003, Russell Steicke wrote:

> Hi Bill,
>
> The second one of your suggested changes (the one I've quoted below)
> stopped the exception from occurring.  I assumed that you meant to only
> use one of those changes, and the change to clearBranch() is not needed
> if the change to getBranch() works.  Is that correct?

Thanks for this. I will commit the change that you determined
works, and I will also commit the change in clearBranch() just
because its cleaner.

Cheers,
Bill

> On Thu, Jul 10, 2003 at 08:45:28AM -0500, Bill Hibbard wrote:
>
> >   public BranchGroup getBranch() {
> >     synchronized (this) {
> >       if (branches != null && branchNonEmpty[currentIndex] &&
> >           branches[currentIndex].numChildren() > 0) {
> >         return (BranchGroup) branches[currentIndex].getChild(0);
> >       }
> >       else {
> >         return null;
> >       }
> >     }
> >   }
>
>
> > > java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
> > >         at java.util.Vector.elementAt(Vector.java:427)
> > >         at javax.media.j3d.GroupRetained.getChild(GroupRetained.java:410)
> > >         at javax.media.j3d.Group.getChild(Group.java:219)
> > >         at visad.java3d.RendererJ3D.getBranch(RendererJ3D.java:264)
> > >         at 
> > > visad.bom.ImageRendererJ3D.doTransform(ImageRendererJ3D.java:363)
> > >         at visad.java3d.RendererJ3D.doAction(RendererJ3D.java:181)
> > >         at visad.DisplayImpl.doAction(DisplayImpl.java:1559)
> > >         at visad.ActionImpl.run(ActionImpl.java:353)
> > >         at visad.util.ThreadPool$ThreadMinnow.run(ThreadPool.java:95)
>
>
> --
> Russell Steicke
>
> -- Fortune says:
> "The C Programming Language -- A language which combines the flexibility of
> assembly language with the power of assembly language."
>