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]>

Reply via email to