why? I just had a case where I didn't need the whole environment to be set up, I just needed a default Logger. Of course I could use getDefaultHierarchy() and friends, but it's easier to write getLogger() :-) Also I don't need to change my Logger getting code, if I decide that I need to have more advanced environment setup.
But if this behaviour is not really desirable, then I can fail() as well... So, to fail() or not to fail()? > -----Original Message----- > From: Berin Loritsch [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 31, 2001 10:15 AM > To: Avalon Developers List > Cc: [EMAIL PROTECTED] > Subject: Re: cvs commit: > jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/test > case ExcaliburTestCase.java > > > [EMAIL PROTECTED] wrote: > > > > neeme 01/10/31 09:56:44 > > > > Modified: src/java/org/apache/avalon/excalibur/testcase > > ExcaliburTestCase.java > > Log: > > removed possibility for NPE, in case the .xtest configuration > file was not found > > final String resourceName = > this.getClass().getName().replace( '.', '/' ) + ".xtest"; > > - getLogger().debug("ResourceName = " + resourceName); > > - prepare( > this.getClass().getClassLoader().getResource( resourceName > ).openStream() ); > > + URL resource = > this.getClass().getClassLoader().getResource( resourceName ); > > + if ( resource != null ) { > > + getLogger().debug("Loading resource " + resourceName); > > + prepare( resource.openStream() ); > > + } > > + else > > + getLogger().debug("Resource not found " + resourceName); > > } > > Be sure to fail() if the resource cannot be found! It is an > error condition. > > -- > > "Those who would trade liberty for > temporary security deserve neither" > - Benjamin Franklin > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>