private static Integer toInt(String str){
  Integer num=null;
  try {
    num=Integer.parseInt(str);
  }
 catch (  NumberFormatException ex) {
    log.severe(String.format("failed to convert str: %s to integer",str));
  }
  return num;
}

private static Integer toInt ( String str ) { Integer num = null ; try { num = Integer . parseInt ( str ) ; } catch ( NumberFormatException ex ) { log . severe ( String . format ( "failed to convert str: %s to integer" , str ) ) ; } return num ; }
converts string to a number .
