You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by vm...@apache.org on 2002/08/28 00:22:33 UTC
cvs commit: jakarta-cactus/documentation/docs/xdocs coding_conventions.xml
vmassol 2002/08/27 15:22:32
Modified: documentation/docs/xdocs coding_conventions.xml
Log:
Changing coding conventions for brackets to be more "standard". The code will soon be changed to reflect this.
Revision Changes Path
1.2 +17 -29 jakarta-cactus/documentation/docs/xdocs/coding_conventions.xml
Index: coding_conventions.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/documentation/docs/xdocs/coding_conventions.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- coding_conventions.xml 10 Mar 2002 14:10:25 -0000 1.1
+++ coding_conventions.xml 27 Aug 2002 22:22:32 -0000 1.2
@@ -62,8 +62,7 @@
<s2 title="1. Brackets">
<p>
- For class and method declaration, brackets should begin and end on a
- <strong>new</strong> line. Example :
+ All brackets should begin and end on a <strong>new</strong> line. Example:
</p>
<source><![CDATA[
@@ -71,26 +70,9 @@
{
public void someMethod()
{
- }
-}
-]]></source>
-
- <p>
- Brackets for blocks of code inside methods should begin and end
- on the <strong>same</strong> line (this applies to <code>if</code>,
- <code>for</code>, <code>while</code>, <code>try/catch</code>, ...).
- Example :
- </p>
-
-<source><![CDATA[
-public void someMethod()
-{
- if (expression) {
- } else if (other_expression) {
- }
-
- try {
- } catch (Exception e) {
+ if (...)
+ {
+ }
}
}
]]></source>
@@ -106,7 +88,8 @@
// some code
// Correct
-if (expression) {
+if (expression)
+{
// some code
}
]]></source>
@@ -121,7 +104,8 @@
</p>
<source><![CDATA[
-while (true) {
+while (true)
+{
// some code
}
]]></source>
@@ -135,7 +119,8 @@
a += c + d;
a = (a + b) / (c * d);
-while (d++ = s++) {
+while (d++ = s++)
+{
n++;
}
@@ -274,7 +259,7 @@
<note>
As of Cactus 1.3, LogAspect autmatically logs all method entries and
- exits.
+ exits.
</note>
</s2>
@@ -315,10 +300,13 @@
<source><![CDATA[
public void getTestClass()
{
- try {
+ try
+ {
Class responseClass =
Class.forName("some.package.MyClass");
- } catch (ClassNotFoundException cnfe) {
+ }
+ catch (ClassNotFoundException cnfe)
+ {
String message = "Cannot instantiate test class";
logger.error(message);
throw new ChainedRuntimeException(message, e);
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>