private static int convertToInt(String value,int defaultValue){
  String trim=value.trim();
  if (trim.length() == 0) {
    return defaultValue;
  }
  return Integer.parseInt(trim);
}

private static int convertToInt ( String value , int defaultValue ) { String trim = value . trim ( ) ; if ( trim . length ( ) == 0 ) { return defaultValue ; } return Integer . parseInt ( trim ) ; }
convert a string to an int treating empty strings as the default value .
