Program: 114763
Project: 114763
Buggy source:
/** 
 * Retrieve meta information of the API to export URL template information are stored in swagger.json definition while rest of the required data are in api.json
 * @param apiToReturn API to be exported
 * @param registry    Current tenant registry
 * @throws APIExportException If an error occurs while exporting meta information
 */
private static void exportMetaInformation(API apiToReturn,Registry registry) throws APIExportException {
  APIDefinition definitionFromSwagger20=new APIDefinitionFromSwagger20();
  String archivePath=archiveBasePath.concat(File.separator + apiToReturn.getId().getApiName() + "String_Node_Str"+ apiToReturn.getId().getVersion());
  createDirectory(archivePath + File.separator + "String_Node_Str");
  cleanApiDataToExport(apiToReturn);
  Gson gson=new GsonBuilder().setPrettyPrinting().create();
  String apiInJson=gson.toJson(apiToReturn);
  writeFile(archivePath + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str",apiInJson);
  try {
    String swaggerDefinition=definitionFromSwagger20.getAPIDefinition(apiToReturn.getId(),registry);
    JsonParser parser=new JsonParser();
    JsonObject json=parser.parse(swaggerDefinition).getAsJsonObject();
    String formattedSwaggerJson=gson.toJson(json);
    writeFile(archivePath + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str",formattedSwaggerJson);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
  }
 catch (  APIManagementException e) {
    String errorMessage="String_Node_Str";
    log.error(errorMessage,e);
    throw new APIExportException(errorMessage,e);
  }
}

Fixed version (ground truth):
/** 
 * Retrieve meta information of the API to export URL template information are stored in swagger.json definition while rest of the required data are in api.json
 * @param apiToReturn API to be exported
 * @param registry    Current tenant registry
 * @throws APIExportException If an error occurs while exporting meta information
 */
private static void exportMetaInformation(API apiToReturn,Registry registry) throws APIExportException {
  APIDefinition definitionFromSwagger20=new APIDefinitionFromSwagger20();
  String archivePath=archiveBasePath.concat(File.separator + apiToReturn.getId().getApiName() + "String_Node_Str"+ apiToReturn.getId().getVersion());
  createDirectory(archivePath + File.separator + "String_Node_Str");
  cleanApiDataToExport(apiToReturn);
  Gson gson=new GsonBuilder().setPrettyPrinting().create();
  String apiInJson=gson.toJson(apiToReturn);
  writeFile(archivePath + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str",apiInJson);
  try {
    if (!APIConstants.APIType.WS.toString().equalsIgnoreCase(apiToReturn.getType())) {
      String swaggerDefinition=definitionFromSwagger20.getAPIDefinition(apiToReturn.getId(),registry);
      JsonParser parser=new JsonParser();
      JsonObject json=parser.parse(swaggerDefinition).getAsJsonObject();
      String formattedSwaggerJson=gson.toJson(json);
      writeFile(archivePath + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str",formattedSwaggerJson);
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str");
      }
    }
  }
 catch (  APIManagementException e) {
    String errorMessage="String_Node_Str";
    log.error(errorMessage,e);
    throw new APIExportException(errorMessage,e);
  }
}