public Definition getDefinition(String url) throws WSDLException { synchronized (definitionsMap) { if (definitionsMap.containsKey(url)) { return definitionsMap.get(url); } } return loadDefinition(url); }
public Definition getDefinition(String url) throws WSDLException { synchronized (definitionsMap) { if (definitionsMap.containsKey(url)) { return definitionsMap.get(url); } } return loadDefinition(url); }
public Definition getDefinition(String url) throws WSDLException { synchronized (definitionsMap) { if (definitionsMap.containsKey(url)) { return definitionsMap.get(url); } } Definition def = loadDefinition(url); synchronized (definitionsMap) { definitionsMap.put(url, def); } return def; }
public Definition getDefinition(URL url) throws WSDLException { String urlString = url.toString(); synchronized (definitionsMap) { //This needs to use the exact URL object for the cache //as the urlString object is not held onto strongly //and thus, could cause the definition to be garbage //collected. if (definitionsMap.containsKey(url)) { return definitionsMap.get(url); } if (definitionsMap.containsKey(urlString)) { return definitionsMap.get(urlString); } } Definition def = loadDefinition(urlString); synchronized (definitionsMap) { //see note about about the url //The loadDefinition call will add it with the //string form, we just need to add it with the //url form (which Sonar will complain about, //but we need to do it) definitionsMap.put(url, def); } return def; }
public Definition getDefinition(URL url) throws WSDLException { String urlString = url.toString(); synchronized (definitionsMap) { //This needs to use the exact URL object for the cache //as the urlString object is not held onto strongly //and thus, could cause the definition to be garbage //collected. if (definitionsMap.containsKey(url)) { return definitionsMap.get(url); } if (definitionsMap.containsKey(urlString)) { return definitionsMap.get(urlString); } } Definition def = loadDefinition(urlString); synchronized (definitionsMap) { //see note about about the url //The loadDefinition call will add it with the //string form, we just need to add it with the //url form (which Sonar will complain about, //but we need to do it) definitionsMap.put(url, def); } return def; }