code: public static int parseInt(String value, String errorMsgOnParseFailure) {
        if (value == null) {
           throw new SearchException(errorMsgOnParseFailure);
        } else {
           try {
              return Integer.parseInt(value.trim());
           } catch (NumberFormatException nfe) {
              throw log.getInvalidIntegerValueException(errorMsgOnParseFailure, nfe);
           }
        }
     }
docs: Parses a string into an integer value.
  
  @param value                  a string containing an int value to parse
  @param errorMsgOnParseFailure message being wrapped in a SearchException if value is {@code null} or not an
  integer
  @return the parsed integer value
  @throws SearchException both for null values and for Strings not containing a valid int.