private static int parseInt ( String s ) { try { return Integer . parseInt ( s ) ; } catch ( NumberFormatException nfe ) { log . error ( "Unable to parse integer value '" + s + "'" , nfe ) ; } return - 1 ; }
Safely parses the specified string as an integer and returns the value . If a NumberFormatException occurs while parsing the integer an error is logged and - 1 is returned .