private void countLines(String message){
  char[] chars=message.toCharArray();
  for (int i=0; i < chars.length; i++) {
    if (chars[i] == '\n')     lineCount++;
  }
}

private void countLines ( String message ) { char [ ] chars = message . toCharArray ( ) ; for ( int i = 0 ; i < chars . length ; i ++ ) { if ( chars [ i ] == '\n' ) lineCount ++ ; } }
counts the line number so that the debug log can be correlated to the message trace .
