Program: 163526
Project: 163526
Buggy source:
protected String doTextRequest(final String endpoint,final String requestJson) throws MalformedURLException, AIServiceException {
  HttpURLConnection connection=null;
  try {
    final URL url=new URL(endpoint);
    final String queryData=requestJson;
    Log.d(TAG,"String_Node_Str" + queryData);
    connection=(HttpURLConnection)url.openConnection();
    connection.setRequestMethod("String_Node_Str");
    connection.setDoOutput(true);
    connection.addRequestProperty("String_Node_Str","String_Node_Str" + config.getApiKey());
    connection.addRequestProperty("String_Node_Str",config.getSubscriptionKey());
    connection.addRequestProperty("String_Node_Str","String_Node_Str");
    connection.addRequestProperty("String_Node_Str","String_Node_Str");
    connection.connect();
    final BufferedOutputStream outputStream=new BufferedOutputStream(connection.getOutputStream());
    IOUtils.write(queryData,outputStream,Charsets.UTF_8);
    outputStream.close();
    final InputStream inputStream=new BufferedInputStream(connection.getInputStream());
    final String response=IOUtils.toString(inputStream,Charsets.UTF_8);
    inputStream.close();
    return response;
  }
 catch (  final IOException e) {
    if (connection != null) {
      try {
        final String errorString=IOUtils.toString(connection.getErrorStream(),Charsets.UTF_8);
        Log.d(TAG,"String_Node_Str" + errorString);
        return errorString;
      }
 catch (      final IOException ex) {
        Log.w(TAG,"String_Node_Str",ex);
      }
    }
    Log.e(TAG,"String_Node_Str",e);
    throw new AIServiceException("String_Node_Str",e);
  }
 finally {
    if (connection != null) {
      connection.disconnect();
    }
  }
}

Fixed version (ground truth):
protected String doTextRequest(final String endpoint,final String requestJson) throws MalformedURLException, AIServiceException {
  HttpURLConnection connection=null;
  try {
    final URL url=new URL(endpoint);
    final String queryData=requestJson;
    Log.d(TAG,"String_Node_Str" + queryData);
    connection=(HttpURLConnection)url.openConnection();
    connection.setRequestMethod("String_Node_Str");
    connection.setDoOutput(true);
    connection.addRequestProperty("String_Node_Str","String_Node_Str" + config.getApiKey());
    connection.addRequestProperty("String_Node_Str",config.getSubscriptionKey());
    connection.addRequestProperty("String_Node_Str","String_Node_Str");
    connection.addRequestProperty("String_Node_Str","String_Node_Str");
    connection.connect();
    final BufferedOutputStream outputStream=new BufferedOutputStream(connection.getOutputStream());
    IOUtils.write(queryData,outputStream,Charsets.UTF_8);
    outputStream.close();
    final InputStream inputStream=new BufferedInputStream(connection.getInputStream());
    final String response=IOUtils.toString(inputStream,Charsets.UTF_8);
    inputStream.close();
    return response;
  }
 catch (  final IOException e) {
    if (connection != null) {
      try {
        final InputStream errorStream=connection.getErrorStream();
        if (errorStream != null) {
          final String errorString=IOUtils.toString(errorStream,Charsets.UTF_8);
          Log.d(TAG,"String_Node_Str" + errorString);
          return errorString;
        }
 else {
          throw new AIServiceException("String_Node_Str",e);
        }
      }
 catch (      final IOException ex) {
        Log.w(TAG,"String_Node_Str",ex);
      }
    }
    Log.e(TAG,"String_Node_Str",e);
    throw new AIServiceException("String_Node_Str",e);
  }
 finally {
    if (connection != null) {
      connection.disconnect();
    }
  }
}