private String anonymizePassword(String password){
  if (password == null) {
    return "null";
  }
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < password.length(); i++) {
    sb.append('*');
  }
  return sb.toString();
}

private String anonymizePassword ( String password ) { if ( password == null ) { return "null" ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < password . length ( ) ; i ++ ) { sb . append ( '*' ) ; } return sb . toString ( ) ; }
make a password into asterisks of the right length , for logging .
