Yep. It's in the sun coding standards. Brackets for everything. even one liners.
Cheers, Nick -----Original Message----- From: Erik Hatcher [mailto:[EMAIL PROTECTED]] Sent: Friday, December 28, 2001 7:06 AM To: Jakarta Commons Developers List Subject: Re: cvs commit: jakarta-commons/beanutils/src/java/org/apache/commons/beanutils BasicDynaBean.java BasicDynaClass.java DynaProperty.java DynaBean.java DynaClass.java A question about coding standards... ----- Original Message ----- From: <[EMAIL PROTECTED]> > if (!values.containsKey(name)) > throw new IllegalArgumentException > ("No property " + name + " exists"); I'm in the camp that believes curly brackets should surround even single statement code blocks. Is this mentioned in the Sun coding standards? Granted, Struts works very well, but ActionServlet drives me crazy to read through! :) (no offense, Craig) But more importantly, why the inconsistency? > try { > return ((DynaBean) constructor.newInstance(constructorValues)); > } catch (InvocationTargetException e) { > throw new InstantiationException > (e.getTargetException().getMessage()); > } Curly brackets are used for try/catch, but not for if. I'd like to push for always using curly brackets, but those might be fighting words for some.... so ignore little ol' me if its a big deal as I don't want to get a long thread started about such things, I just wanted to bring it up and see if this particular issue is specified in the Jakarta (aka Sun) coding standards. I'm a follower (as best I humanly can) of the guidelines in the book The Elements of Java Style. Erik -- 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]>