It seems you were right about compile(). Here's a little test case that adds some null children and looks at the number of children for two cases: with and without a call to compile(). setChild() is called after to bring up the exception when compile() is used.
Sean > -----Original Message----- > From: Chien Yang [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 12, 2002 12:19 PM > To: [EMAIL PROTECTED] > Subject: Re: [JAVA3D] BranchGroups > > > Sean, > Please send us the trace or a test program. > > - Chien Yang > Java 3D Team. > > > > > Date: Fri, 12 Jul 2002 11:57:39 -0700 > > From: Sean Sylvis <[EMAIL PROTECTED]> > > Subject: Re: [JAVA3D] BranchGroups > > To: [EMAIL PROTECTED] > > MIME-version: 1.0 > > X-MIMEOLE: Produced By Microsoft Exchange V6.0.5762.3 > > Content-transfer-encoding: quoted-printable > > Content-class: urn:content-classes:message > > Delivered-to: [EMAIL PROTECTED] > > Thread-topic: [JAVA3D] BranchGroups > > Thread-index: AcIpz1eyZ6BpcV6HRRCqOF78Jj2Y4gABfpPw > > X-MS-Has-Attach: > > X-MS-TNEF-Correlator: > > Comments: To: Chien Yang <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > > > > When I then call Group.setChild(), a null pointer exception > is thrown because > there are no children in the Group. > > So, I'm pretty sure it is the same "bug" Justin was > referring to. (See > Justin's response to previous email) > > > > Sean > > > > > > > -----Original Message----- > > > From: Chien Yang [mailto:[EMAIL PROTECTED]] > > > Sent: Friday, July 12, 2002 11:09 AM > > > To: Sean Sylvis; [EMAIL PROTECTED]; [EMAIL PROTECTED] > > > Subject: Re: [JAVA3D] BranchGroups > > > > > > > > > Justin, > > > I reread Sean's email and it seems to be a totally > > > different problem. > > > Sean's question is on Group.numChildren() : > > > > > > *********** Sean's email ********** > > > > > > What happens when BranchGroup.addChild(null) is called? > > > > > > I was hoping to use the 'null' as a placeholder that I could > > > replace later with > > > a call to setChild(), but the addition of 'null' to the > > > BranchGroup child list > > > seems transient. Immediately after adding the right number of > > > 'null's to a > > > BranchGroup (to get the number of children correct for > > > replacement later), the > > > method numChildren() reports the correct number of children. > > > However, when > > > numChildren() is later (in another method) called on this > > > same BranchGroup, the > > > value returned is zero. > > > > > > Any ideas? > > > > > > *********************************** > > > > > > and yours is on NPE with setChild(). I've just tried > > > addChild(null) and > > > it went thro. with no NPE. Can you please verify it ? > > > > > > thanks, > > > > > > - Chien Yang. > > > Java 3D Team. > > > > > > > > > > > > > Date: Fri, 12 Jul 2002 10:27:25 -0700 > > > > From: Justin Couch <[EMAIL PROTECTED]> > > > > Subject: Re: [JAVA3D] BranchGroups > > > > To: [EMAIL PROTECTED] > > > > MIME-version: 1.0 > > > > Content-transfer-encoding: 7bit > > > > X-Accept-Language: en-us, en > > > > Delivered-to: [EMAIL PROTECTED] > > > > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; > > > rv:1.0.0) > > > Gecko/20020530 > > > > > > > > Chien Yang wrote: > > > > > Sean and Justin, > > > > > > > > > > I'm a little confuse on whether the NPE is on > > > addChild() or > > > > > setChild(). We did fix a bug reported by Justin in > j3d1.3beta2 : > > > > > > > > > > BugId 4633672 : Group.setChild() may throw > NullPointerException. > > > > > > > > Hmmm.. That's interesting because I thought I reported it on the > > > > addChild() not setChild(). Oh well, I could be wrong on > > > that. :( I had > > > > to remove the addChild() calls at the same time because it > > > is pointless > > > > having those when I can't setChild() as well so I may > have missed a > > > > secondary bug there. > > > > > > > > Anyway, the basic process is that during the scene graph > > > the process is > > > > to addChild(null) as a placeholder for nodes that you want > > > to add later. > > > > Then, later on, you just do setChild(new_node_pointer, > 0); The idea > > > > behind this is that it is one less capability bit to need > > > to switch on. > > > > Instead of needing both write and extend, you just need > > > write capabilities. > > > > > > > > -- > > > > Justin Couch http://www.vlc.com.au/~justin/ > > > Java Architect & Bit Twiddler http://www.yumetech.com/ > > > Author, Java 3D FAQ Maintainer http://www.j3d.org/ > > > ------------------------------------------------------------------- > > > "Humanism is dead. Animals think, feel; so do machines now. > > > Neither man nor woman is the measure of all things. Every organism > > > processes data according to its domain, its environment; you, with > > > all your brains, would be useless in a mouse's universe..." > > > - Greg Bear, Slant > > > ------------------------------------------------------------------- > > > > > > > > ============================================================== > > ============= > > > To unsubscribe, send email to [EMAIL PROTECTED] and > > include in the body > > > of the message "signoff JAVA3D-INTEREST". For general > > help, send email to > > > [EMAIL PROTECTED] and include in the body of the message "help". > > > > > > ==========================================================================To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff JAVA3D-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
TestCase.java
Description: TestCase.java
