if (v == null)
try { return v == null ? defaultValue : Integer.parseInt(v); } catch (NumberFormatException e) {
    public int getIntAttr(String name, int defaultValue) {        String v = getAttr(name);        if (v == null)            return defaultValue;        else {            try {                return Integer.parseInt(v);            } catch (NumberFormatException e) {                return defaultValue;            }        }    }