RE: Coding Stds
"Christian Cryder" <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
> Sorry, I always use tabs for indentation and was too lazy to alter the IDE > configuration only for this. Please please please - as much as I want to _encourage_ community contributions, please take the time to follow the Barracuda coding guidelines as described here: http://barracudamvc.org/Barracuda/docs/coding_standards.html If you can take the time to submit your code in this format, it makes it much more likely that a committer will actually apply your patch; while things like "spaces vs. tabbing" may seem trivial, it actually is a major pain in the butt when you have people who use the framework and viewing the code on Unix vs. Windows (you wouldn't believe how contentious some of those early discussions were as we tried to hammer out standards that worked for everyone). So once again, PLEASE take the time to make your code conform to Barracuda standards before you submit your patch! THanks, Christian (P.S. Thorsten - please don't take this as personally directed towards you; you're comments just served as the trigger to remind me to mention this, since its been a while since we've discussed it) ---------------------------------------------- Christian Cryder Internet Architect, ATMReports.com Project Chair, BarracudaMVC - http://barracudamvc.org ---------------------------------------------- "Coffee? I could quit anytime, just not today" > -----Original Message----- > From: [email protected] > [mailto:[email protected]]On Behalf Of Thorsten Möller > Sent: Tuesday, September 16, 2003 1:19 PM > To: [email protected] > Subject: [Barracuda] Re: Re: enhancement request for Ant event builder > task > > > Jacob Kjome <[email protected]> wrote: > > > I've never actually bothered to use the "template" attribute of the > > <build-events> tag. > And I even think you didn't used another template at all, because of your > Barracuda leadership ;-) > > > What have you used as a sample value for the "template" > > attribute? Is it a fully qualified path to the file from the root of > > the classloader such as?... > On my tests I used a relative path, ergo not starting with "/" and it > worked. If you view the implementation of > Class.getResourceAsStream() method > (Java 1.4.1): > > public InputStream getResourceAsStream(String name) { > name = resolveName(name); > ClassLoader cl = getClassLoader0(); > if (cl==null) { > // A system class. > return ClassLoader.getSystemResourceAsStream(name); > } > return cl.getResourceAsStream(name); > } > > ... as you see, there is a simple delegation to the classloader. > Additionally the Java doc says: > * <p> This method delegates the call to its class loader, after making > * these changes to the resource name: if the resource name starts with > * "/", it is unchanged; otherwise, the package name is prepended to the > * resource name after converting "." to "/". If this object was loaded by > * the bootstrap loader, the call is delegated to > * <code>ClassLoader.getSystemResourceAsStream</code>. > > So: > > getClass().getResourceAsStream(cs.template) > getClass().getClassLoader().getResourceAsStream(cs.template) > > ... is pretty the same. > > > > Oh, and try to make sure you use spaces instead of tabs with > > a 4 spaces indentation. > Sorry, I always use tabs for indentation and was too lazy to alter the IDE > configuration only for this. > > > Thorsten > > _______________________________________________ > Barracuda mailing list > [email protected] > http://barracudamvc.org/lists/listinfo/barracuda