code: protected int parseInt (String val)
      {
          try {
              return (val == null) ? -1 : Integer.parseInt(val);
          } catch (NumberFormatException nfe) {
              log.warning("Malformed integer value", "val", val);
              return -1;
          }
      }
docs: Parse the given string as an integer and return the integer
  value, or -1 if the string is malformed.