> -----Original Message----- > From: J. B. Rainsberger [mailto:[EMAIL PROTECTED] > Sent: 29 November 2003 11:55 > To: Cactus Users List > Subject: Re: Code Review (Re: "You must either set location or path on > <pathelement>" Exception Message) > > Vincent Massol wrote: > > > > >>-----Original Message----- > >>From: J. B. Rainsberger [mailto:[EMAIL PROTECTED] > >>Sent: 28 November 2003 23:55 > >>To: Cactus Users List > >>Subject: Code Review (Re: "You must either set location or path on > >><pathelement>" Exception Message) > >> > >>Vincent Massol wrote: > >> > >> > >>> File toolsJar = new File(javaHome + "/../lib/tools.jar"); > >> > >>I think this could and /should/ be > >> > >> new File(javaHome, "../lib/tools.jar"); > > > > > > Are you confident javaHome will always contain a trailing "/"? > > No. That's the point of using 'new File(directory, relativePath)'. The > nice Java folks have already worried about trailing slash or not > trailing slash. Why should /we/ worry about it?
Cool. I didn't know that :-) BTW, I've had a look at the JDK 1.4 javadoc for File and I couldn't see this mentioned anywhere. Are you sure this is an exposed feature or simply an implementation detail of the Sun's JDK? Thanks -Vincent > > > In any case, I think this whole section should be rewritten as it does > > not support MAC OS and we could verify whether tools.jar is already in > > the executing classloaders and take it from there if it is (not sure how > > easy it is). > > Fair enough. I just saw a simple improvement. :) > -- > J. B. Rainsberger, > Diaspar Software Services > http://www.diasparsoftware.com :: +1 416 791-8603 > Let's write software that people understand > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
