Source:
<code>public final String getESResultJson(final String esQueryJson, final String url) { StringBuilder stringBuilder = new StringBuilder(); try { HttpClient httpClient = new DefaultHttpClient(); String encodedJson = URLEncoder.encode(esQueryJson, UTF_8); StringBuilder esGetURL = new StringBuilder(url).append(encodedJson).append(UID); Settings currentSettings = new Settings(); HttpGet getRequest; if (!currentSettings.getOptOutCheckBoxValue()) { esGetURL = new StringBuilder(esGetURL).append(windowObjects.getBeagleId()); String versionInfo = windowObjects.getOsInfo() + " " + windowObjects.getApplicationVersion() + " " + windowObjects.getPluginVersion(); getRequest = new HttpGet(esGetURL.toString()); getRequest.setHeader(USER_AGENT, versionInfo); } else { esGetURL = new StringBuilder(esGetURL).append(OPTED_OUT); getRequest = new HttpGet(esGetURL.toString()); } HttpResponse response = httpClient.execute(getRequest); if (response.getStatusLine().getStatusCode() != HTTP_OK_STATUS) { throw new RuntimeException(FAILED_HTTP_ERROR + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase()); } BufferedReader bufferedReader = new BufferedReader( new InputStreamReader((response.getEntity().getContent()), UTF_8)); String output; while ((output = bufferedReader.readLine()) != null) { stringBuilder.append(output); } bufferedReader.close(); httpClient.getConnectionManager().shutdown(); } catch (RuntimeException e) { <START> throw e; <END> } catch (Exception e) { handleHttpException(e); } return stringBuilder.toString(); }</code><technical_language>This changes logic</technical_language>

Target:
public final String getESResultJson(final String esQueryJson, final String url) { StringBuilder stringBuilder = new StringBuilder(); try { HttpClient httpClient = new DefaultHttpClient(); String encodedJson = URLEncoder.encode(esQueryJson, StandardCharsets.UTF_8.name()); StringBuilder esGetURL = new StringBuilder(url).append(encodedJson).append(UID); Settings currentSettings = new Settings(); HttpGet getRequest; if (!currentSettings.getOptOutCheckBoxValue()) { esGetURL = new StringBuilder(esGetURL).append(windowObjects.getBeagleId()); String versionInfo = windowObjects.getOsInfo() + " " + windowObjects.getApplicationVersion() + " " + windowObjects.getPluginVersion(); getRequest = new HttpGet(esGetURL.toString()); getRequest.setHeader(USER_AGENT, versionInfo); } else { esGetURL = new StringBuilder(esGetURL).append(OPTED_OUT); getRequest = new HttpGet(esGetURL.toString()); } HttpResponse response = httpClient.execute(getRequest); if (response.getStatusLine().getStatusCode() != HTTP_OK_STATUS) { throw new RuntimeException(FAILED_HTTP_ERROR + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase()); } BufferedReader bufferedReader = new BufferedReader( new InputStreamReader((response.getEntity().getContent()), StandardCharsets.UTF_8.name())); String output; while ((output = bufferedReader.readLine()) != null) { stringBuilder.append(output); } bufferedReader.close(); httpClient.getConnectionManager().shutdown(); } catch (RuntimeException e) { throw e; } catch (Exception e) { return handleHttpException(e); } return stringBuilder.toString(); }