try { return Integer.parseInt(elt.getAttribute("rating")); } catch (NumberFormatException e) { } return DEFAULT_RATING;
int rating = getRawRating(); if (rating < 0) return DEFAULT_RATING; else return rating;
  public int getRating() {    try {      return Integer.parseInt(elt.getAttribute("rating"));    }    catch (NumberFormatException e) {    }    return DEFAULT_RATING;  }