Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. In general logging is a good idea.
  2. Use Commons Logging.
  3. For debug messages, call if (log.isDebugEnabled()) prior to calling log.debug().
  4. The following code is usually bad. There is no need to log exception and re-throw it:
    Code Block
    
    try {
        
    } catch (Exception e) {
        logger.error(e.getMessage(), e);
        throw new RuntimeException(e);
    }
    
    Either log it, or re-throw.

Formatting

  1. In perfect world all people, who contribute code, use the same IDE with the same formatting preferences.
  2. It should be a good idea to attach a formatter profile for Eclipse that contributors are expected to use.
  3. Anyway for people, who don't use Eclipse, or want to keep their formatting preferences, let's define some basic rules:
    1. Do not use Tab. For indentation use only spaces. Indentation size is 4 spaces.
    2. Maximum line width: 100 characters.

...