code: public static int parseInt(String s, int i) {
  		if (s == null) {
  			return i;
  		}
  		try {
  			return Integer.parseInt(s.trim());
  		} catch (NumberFormatException e) {
  			return i;
  		}
  	}
docs: Parse an <b>int</b> with a given default value <b>i</b>
  
  @return default value if null or not parsable