The Sun Code Conventions are followed.
Every class that is neither static nor abstract should have a
toString()
method, implemented using the
ToStringBuilder
from the
Jakarta Commons Lang
project. For printing the superclass (if required),
appendSuper(super.toString())
is called prior to printing the
fields.
When required, equals()
, hashCode()
, and
compareTo()
are also implemented via Commons Lang. The next,
currently unused prime for HashCodeBuilder is 37.
final
is your friends and should be used whenever possible.
When using the Eclipse Platform for
development, you will need to defined a MAVEN_REPO
Java Classpath
variable. This is done by selecting the "Window" menu, then "Preferences".
In the dialog box, select the "Java" node and then "Build Path / Classpath
Variables".
Create a new variable named "MAVEN_REPO" that points to your local
Maven repository (usually
$HOME/.maven/repository
or $MAVEN_HOME/repository
).
Additionally, some configuration changes ("Window / Preferences" menu) are recommended:
ans, aug, cfg, css, desc, js,
org, prefs, vm.
Modified patterns on the "Java / Code Style / Code Templates" page:
/** * Returns the ${bare_field_name} of this instance. * @return the value of the attribute */
/** * Modifies the ${bare_field_name} of this instance. * @param ${param} the new value of the attribute */
/** * Creates a new instance. * ${tags} */
/** */
/* * Copyright (C) ${year} Christian Siefkes <christian@siefkes.net>. * Development of this software is supported by the German Research Society, * Berlin-Brandenburg Graduate School in Distributed Information Systems * (DFG grant no. GRK 316). * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, visit * http://www.gnu.org/licenses/gpl.html or write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ ${package_declaration} /** * * * @author Christian Siefkes * @version $$Revision: 1.56 $$, $$Date: 2006/10/21 16:26:45 $$, $$Author: siefkes $$ */ ${type_declaration}
checkstyle.xml
file in
the main project directory. Open the "ties" project context menu on the
"Checkstyle" node and ensure that the imported "checkstyle.xml"
configuration is enabled for the file pattern ^src/.*.java$
(i.e., all java files in the src/ folder). To make the Checkstyle warnings
visible, click on the "Filters" button in the "Problems" view button and
enable "Checkstyle Marker". ignore
. For the "Coding Problems / Illegal Instantiation"
rule, "classes" are set to java.lang.Boolean,java.lang.String
.
For the "Coding Problems / Redundant Throws" rule, "allowUnchecked" and
"allowSubclasses" are set to true
. The severity of "Class
Design / Design For Extension" and "Hide Utility Class Constructor" is set
to ignore
. The "format" property of "Miscellaneous / Generic
Illegal Regexp" is set to "\s\s+$" -- this allows a single trailing space
(which is typical for Javadoc comments) and only complains if there are
multiple trailing spaces at the end of lines.