Dear Wiki user, You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for change notification.
The following page has been changed by JonathanEllis: http://wiki.apache.org/cassandra/CodeStyle ------------------------------------------------------------------------------ * The Cassandra project follows Sun's Java coding conventions (http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html) with an important exception: * { and } are always placed on a new line * Please make sure to use 4 spaces instead of the tab character for all your indentation + + == Exception handling == + + * Never ever write `catch (...) {}` or `catch (...) { logger.error() }` merely to satisfy Java's compile-time exception checking. Always propagate the exception up or throw RuntimeException. This makes the exceptions visible to automated tests. + * Similarly, `logger.warn()` is often a cop-out: is this an error or not? If it is don't hide it behind a warn; if it isn't, no need for the warning. + * If you genuinely know an exception indicates an expected condition, it's okay to ignore it BUT this must be explicitly explained in a comment. + + == Boilerplate == + + * Do not implement equals or hashcode methods unless they are actually needed. + * Prefer public final fields to private fields with getters. + * Prefer requiring initialization in the constructor to setters. == Multiline statements ==
