if (cachedURLValid) { return cachedURL; } else { try { String url = elt.getStringAttribute("url"); if (url == null) url = ""; cachedURLValid = true; cachedURL = new URL(url); return cachedURL; } catch (Exception e) { e.printStackTrace(); } cachedURLValid = true; cachedURL = null; return null;
try { String urlString = elt.getStringAttribute("url"); if (urlString == null) urlString = ""; return new URL(urlString);
  public URL getURL() {    if (cachedURLValid) {      return cachedURL;    } else {      try {        String url = elt.getStringAttribute("url");        if (url == null)          url = "";        cachedURLValid = true;        cachedURL = new URL(url);        return cachedURL;      }      catch (Exception e) {        e.printStackTrace();      }      cachedURLValid = true;      cachedURL = null;      return null;    }  }