Source:
<code>private Map<String, String> fetchRemoteScripts(String location, boolean isRecursive) { final Map<String, String> scripts = new HashMap<>(); final String contentTreeUrl = getContentTreeUrl(location); final JsonParser jsonParser = new JsonParser(); Reader reader = null; try { reader = new InputStreamReader(new URL(contentTreeUrl).openStream()); } catch (final IOException e) { <START> e.printStackTrace(); <END> } if (reader != null) { final JsonObject rootObject = jsonParser.parse(reader).getAsJsonObject(); final JsonArray projectTree = rootObject.getAsJsonArray(JSON_TREE_LABEL); for (final JsonElement element : projectTree) { final JsonObject object = element.getAsJsonObject(); final String scriptPath = object.get(JSON_PATH_LABEL).getAsString(); final String scriptName = (scriptPath.contains(SEPARATOR)) ? getScriptName(scriptPath) : scriptPath; final String scriptSHA = object.get(JSON_SHA_LABEL).getAsString(); final String scriptType = object.get(JSON_TYPE_LABEL).getAsString(); if (scriptType.equals(JSON_BLOB_LABEL)) { final String repositoryName = getRepositoryName(location); final String relativeScriptPath = getRelativeScriptPath(location); if (isRecursive) { if (repositoryName.equals(relativeScriptPath) || scriptPath.startsWith(relativeScriptPath)) { scripts.put(scriptSHA, scriptPath); } } else { if ((repositoryName.equals(relativeScriptPath) && !scriptPath.contains(SEPARATOR)) || (scriptPath.endsWith(relativeScriptPath + SEPARATOR + scriptName))) { scripts.put(scriptSHA, scriptPath); } } } } } return scripts; }</code><technical_language>Logger class inform user error log, printStackTrace visible in workspace log, else</technical_language>

Target:
private Map<String, String> fetchRemoteScripts(String location, boolean isRecursive) { final Map<String, String> scripts = new HashMap<>(); final String contentTreeUrl = getContentTreeUrl(location); final JsonParser jsonParser = new JsonParser(); try (Reader reader = new InputStreamReader(new URL(contentTreeUrl).openStream())) { final JsonObject rootObject = jsonParser.parse(reader).getAsJsonObject(); final JsonArray projectTree = rootObject.getAsJsonArray(JSON_TREE_LABEL); for (final JsonElement element : projectTree) { final JsonObject object = element.getAsJsonObject(); final String scriptPath = object.get(JSON_PATH_LABEL).getAsString(); final String scriptName = (scriptPath.contains(SEPARATOR)) ? getScriptName(scriptPath) : scriptPath; final String scriptSHA = object.get(JSON_SHA_LABEL).getAsString(); final String scriptType = object.get(JSON_TYPE_LABEL).getAsString(); if (scriptType.equals(JSON_BLOB_LABEL)) { final String repositoryName = getRepositoryName(location); final String relativeScriptPath = getRelativeScriptPath(location); if (isRecursive) { if (repositoryName.equals(relativeScriptPath) || scriptPath.startsWith(relativeScriptPath)) { scripts.put(scriptSHA, scriptPath); } } else if ((repositoryName.equals(relativeScriptPath) && !scriptPath.contains(SEPARATOR)) || (scriptPath.endsWith(relativeScriptPath + SEPARATOR + scriptName))) { scripts.put(scriptSHA, scriptPath); } } } } catch (final IOException e) { Logger.error(Activator.PLUGIN_ID, "Unable to fetch content: " + e.getMessage()); } return scripts; }