You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by mo...@apache.org on 2002/09/17 18:20:04 UTC
cvs commit: jakarta-jetspeed/xdocs code-standards.xml
morciuch 2002/09/17 09:20:03
Modified: docs/site code-standards.html
xdocs code-standards.xml
Log:
Updated code standards with respect to style checking and internationalization.
Revision Changes Path
1.23 +30 -12 jakarta-jetspeed/docs/site/code-standards.html
Index: code-standards.html
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/docs/site/code-standards.html,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- code-standards.html 14 Aug 2002 03:27:18 -0000 1.22
+++ code-standards.html 17 Sep 2002 16:20:02 -0000 1.23
@@ -169,8 +169,22 @@
<blockquote>
<p>
A Java style checker, checkStyle, is part of the build process. This should aid
-in the development of readable code. For more information see
-<a href="http://checkstyle.sourceforge.net">http://checkstyle.sourceforge.net</a>
+in the development of readable code. Jetspeed currently works with version 2.3 of
+the checkStyle. For more information see <a href="http://checkstyle.sourceforge.net">http://checkstyle.sourceforge.net</a>.
+Here is a list of rules currently enforced by the style checker:
+<ul>
+<li>Unused imports should be removed</li>
+<li>'(' should be followed by whitespace</li>
+<li>')' should be preceeded by whitespace</li>
+<li>Cast needs to be followed by whitespace</li>
+<li>'{' should be on a new line</li>
+<li>'}' should be alone on a line</li>
+<li>There should be no empty catch blocks</li>
+<li>Variable must match pattern '^[a-z][a-zA-Z0-9]*$'</li>
+<li>Line should be no longer than 130 characters</li>
+<li>',' needs to be followed by whitespace</li>
+<li>'+' should be followed by whitespace</li>
+</ul>
</p>
</blockquote>
</td></tr>
@@ -185,7 +199,7 @@
<tr><td>
<blockquote>
<p>
-Please use spaces within methods, and parameters:
+Please use spaces within method parameter lists:
</p>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
@@ -204,7 +218,7 @@
please use:
- this.test( true, true, "test", true );
+ this.test(true, true, "test", true);
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
@@ -231,13 +245,13 @@
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
- if ( true ) {
+ if (true) {
//body
}
or
- if ( true )
+ if (true)
{
//body
}
@@ -275,13 +289,13 @@
Instead of having a long list of parameters on one one line, break your parameter
list across several lines:
- private final PortletSet getPortlets( Portlets portlets, RunData rundata, boolean application, boolean applicationsOnly ) {
+ private final PortletSet getPortlets(Portlets portlets, RunData rundata, boolean application, boolean applicationsOnly) {
}
- private final PortletSet getPortlets( Portlets portlets,
- RunData rundata,
- boolean application,
- boolean applicationsOnly ) {
+ private final PortletSet getPortlets(Portlets portlets,
+ RunData rundata,
+ boolean application,
+ boolean applicationsOnly) {
}
</pre></td>
@@ -563,7 +577,11 @@
<code>org.apache.jetspeed.modules.localization.JetspeedProperty_</code>
<i>language</i><code>.properties</code>. All properties should be
placed in the english, <code>en</code>, property file and any other
- language property files.
+ language property files. When adding/changing properties, these
+ properties should be added/changed in files for ALL languages. For example,
+ if a property is added or updated, the property should be
+ copied to all language property files with the English value. This will
+ serve as a reminder to the maintainer that the property file needs to updated.
</p>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
1.8 +32 -14 jakarta-jetspeed/xdocs/code-standards.xml
Index: code-standards.xml
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/xdocs/code-standards.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- code-standards.xml 14 Aug 2002 03:27:18 -0000 1.7
+++ code-standards.xml 17 Sep 2002 16:20:03 -0000 1.8
@@ -14,6 +14,7 @@
<authors>
<person name="Kevin A. Burton" email="burton@apache.org"/>
<person name="Paul Spencer" email="paulsp@apache.org"/>
+ <person name="Mark Orciuch" email="morciuch@apache.org"/>
</authors>
</properties>
@@ -61,13 +62,27 @@
<subsection name="Style Checker">
<p>
A Java style checker, checkStyle, is part of the build process. This should aid
-in the development of readable code. For more information see
-<a href="http://checkstyle.sourceforge.net">http://checkstyle.sourceforge.net</a>
+in the development of readable code. Jetspeed currently works with version 2.3 of
+the checkStyle. For more information see <a href="http://checkstyle.sourceforge.net">http://checkstyle.sourceforge.net</a>.
+Here is a list of rules currently enforced by the style checker:
+<ul>
+<li>Unused imports should be removed</li>
+<li>'(' should be followed by whitespace</li>
+<li>')' should be preceeded by whitespace</li>
+<li>Cast needs to be followed by whitespace</li>
+<li>'{' should be on a new line</li>
+<li>'}' should be alone on a line</li>
+<li>There should be no empty catch blocks</li>
+<li>Variable must match pattern '^[a-z][a-zA-Z0-9]*$'</li>
+<li>Line should be no longer than 130 characters</li>
+<li>',' needs to be followed by whitespace</li>
+<li>'+' should be followed by whitespace</li>
+</ul>
</p>
</subsection>
<subsection name="Syntax and Style Guide">
<p>
-Please use spaces within methods, and parameters:
+Please use spaces within method parameter lists:
</p>
<source test=""><![CDATA[
@@ -77,11 +92,10 @@
please use:
- this.test( true, true, "test", true );
+ this.test(true, true, "test", true);
]]></source>
-
<p>
Use of brackets. Some developers have personal a preference to
how they place brackets within their source code:
@@ -89,13 +103,13 @@
<source test=""><![CDATA[
- if ( true ) {
+ if (true) {
//body
}
or
- if ( true )
+ if (true)
{
//body
}
@@ -118,13 +132,13 @@
Instead of having a long list of parameters on one one line, break your parameter
list across several lines:
- private final PortletSet getPortlets( Portlets portlets, RunData rundata, boolean application, boolean applicationsOnly ) {
+ private final PortletSet getPortlets(Portlets portlets, RunData rundata, boolean application, boolean applicationsOnly) {
}
- private final PortletSet getPortlets( Portlets portlets,
- RunData rundata,
- boolean application,
- boolean applicationsOnly ) {
+ private final PortletSet getPortlets(Portlets portlets,
+ RunData rundata,
+ boolean application,
+ boolean applicationsOnly) {
}
]]></source>
@@ -267,7 +281,11 @@
<code>org.apache.jetspeed.modules.localization.JetspeedProperty_</code>
<i>language</i><code>.properties</code>. All properties should be
placed in the english, <code>en</code>, property file and any other
- language property files.
+ language property files. When adding/changing properties, these
+ properties should be added/changed in files for ALL languages. For example,
+ if a property is added or updated, the property should be
+ copied to all language property files with the English value. This will
+ serve as a reminder to the maintainer that the property file needs to updated.
</p>
<source><![CDATA[
CUSTOMIZER_REF_DEFAULTTITLE=Reference
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>