Here you can find the source of convertInt(String str, int defaults)
static int convertInt(String str, int defaults)
//package com.java2s; //License from project: Apache License public class Main { static int convertInt(String str, int defaults) { if (str == null) { return defaults; }// w ww . ja va 2 s . com try { return Integer.parseInt(str); } catch (Exception e) { return defaults; } } }