nus-yam/ex-repair huggingface dataset:
Program: 114750
Project: 114750
Buggy source:
private void initialize(final int layoutId){
  setContentView(layoutId);
  offset=0;
  final AbsListView listView=(AbsListView)findViewById(R.id.listView);
  topTextView=(TextView)findViewById(R.id.quickReturnTopTarget);
  bottomTextView=(TextView)findViewById(R.id.quickReturnBottomTarget);
  adapter=new ArrayAdapter<>(this,R.layout.list_item);
  addMoreItems(100);
  int numColumns=(listView instanceof GridView) ? 3 : 1;
  listView.setAdapter(new QuickReturnAdapter(adapter,numColumns));
  final QuickReturnAttacher quickReturnAttacher=new QuickReturnAttacher(listView);
  topTargetView=quickReturnAttacher.addTargetView(topTextView,QuickReturnTargetView.POSITION_TOP,dpToPx(this,50));
  quickReturnAttacher.addTargetView(bottomTextView,QuickReturnTargetView.POSITION_BOTTOM);
  quickReturnAttacher.addOnScrollListener(this);
}

Fixed version (ground truth):
private void initialize(final int layoutId){
  setContentView(layoutId);
  offset=0;
  final AbsListView listView=(AbsListView)findViewById(R.id.listView);
  topTextView=(TextView)findViewById(R.id.quickReturnTopTarget);
  bottomTextView=(TextView)findViewById(R.id.quickReturnBottomTarget);
  adapter=new ArrayAdapter<>(this,R.layout.list_item);
  addMoreItems(100);
  int numColumns=(listView instanceof GridView) ? 3 : 1;
  listView.setAdapter(new QuickReturnAdapter(adapter,numColumns));
  final QuickReturnAttacher quickReturnAttacher=new QuickReturnAttacher(listView);
  topTargetView=quickReturnAttacher.addTargetView(topTextView,QuickReturnTargetView.POSITION_TOP,dpToPx(this,50));
  quickReturnAttacher.addTargetView(bottomTextView,QuickReturnTargetView.POSITION_BOTTOM);
  quickReturnAttacher.addOnScrollListener(this);
  listView.setOnItemClickListener(this);
}
Program: 114751
Project: 114751
Buggy source:
@Override public int getViewTypeCount(){
  return wrappedAdapter.getViewTypeCount() + numColumns;
}

Fixed version (ground truth):
@Override public int getViewTypeCount(){
  return wrappedAdapter.getViewTypeCount() + 1;
}
Program: 114752
Project: 114752
Buggy source:
@Override public int getItemViewType(final int position){
  if (position < numColumns)   return VIEW_TYPE_PLACEHOLDER;
  return wrappedAdapter.getItemViewType(position);
}

Fixed version (ground truth):
@Override public int getItemViewType(final int position){
  if (position < numColumns)   return wrappedAdapter.getViewTypeCount();
  return wrappedAdapter.getItemViewType(position);
}
Program: 114753
Project: 114753
Buggy source:
private static String getAccessToken(String scopeList){
  if (consumerKey == null) {
    makeDCRRequest();
  }
  URL url;
  HttpURLConnection urlConn=null;
  try {
    createSSLConnection();
    url=new URL("String_Node_Str");
    urlConn=(HttpURLConnection)url.openConnection();
    urlConn.setDoOutput(true);
    urlConn.setRequestMethod("String_Node_Str");
    urlConn.setRequestProperty("String_Node_Str","String_Node_Str");
    String clientEncoded=Base64.getEncoder().encodeToString((consumerKey + ':' + consumerSecret).getBytes(StandardCharsets.UTF_8));
    urlConn.setRequestProperty("String_Node_Str","String_Node_Str" + clientEncoded);
    String postParams="String_Node_Str";
    if (!scopeList.isEmpty()) {
      postParams+="String_Node_Str" + scopeList;
    }
    urlConn.getOutputStream().write((postParams).getBytes("String_Node_Str"));
    int responseCode=urlConn.getResponseCode();
    if (responseCode == 200) {
      String responseStr=getResponseString(urlConn.getInputStream());
      JsonParser parser=new JsonParser();
      JsonObject obj=parser.parse(responseStr).getAsJsonObject();
      return obj.get("String_Node_Str").getAsString();
    }
 else {
      throw new RuntimeException("String_Node_Str" + responseCode);
    }
  }
 catch (  IOException e) {
    String msg="String_Node_Str";
    throw new RuntimeException(msg,e);
  }
 finally {
    if (urlConn != null) {
      urlConn.disconnect();
    }
  }
}

Fixed version (ground truth):
private String getAccessToken(String scopeList){
  if (consumerKey == null) {
    makeDCRRequest();
  }
  URL url;
  HttpsURLConnection urlConn=null;
  try {
    url=new URL("String_Node_Str");
    urlConn=(HttpsURLConnection)url.openConnection();
    urlConn.setDoOutput(true);
    urlConn.setRequestMethod("String_Node_Str");
    urlConn.setRequestProperty("String_Node_Str","String_Node_Str");
    String clientEncoded=Base64.getEncoder().encodeToString((consumerKey + ':' + consumerSecret).getBytes(StandardCharsets.UTF_8));
    urlConn.setRequestProperty("String_Node_Str","String_Node_Str" + clientEncoded);
    String postParams="String_Node_Str";
    if (!scopeList.isEmpty()) {
      postParams+="String_Node_Str" + scopeList;
    }
    urlConn.setHostnameVerifier((s,sslSession) -> true);
    SSLContext sslContext=SSLContext.getInstance("String_Node_Str");
    sslContext.init(null,new TrustManager[]{trustAll},new SecureRandom());
    urlConn.setSSLSocketFactory(sslContext.getSocketFactory());
    urlConn.getOutputStream().write((postParams).getBytes("String_Node_Str"));
    int responseCode=urlConn.getResponseCode();
    if (responseCode == 200) {
      String responseStr=getResponseString(urlConn.getInputStream());
      JsonParser parser=new JsonParser();
      JsonObject obj=parser.parse(responseStr).getAsJsonObject();
      return obj.get("String_Node_Str").getAsString();
    }
 else {
      throw new RuntimeException("String_Node_Str" + responseCode);
    }
  }
 catch (  Exception e) {
    String msg="String_Node_Str";
    throw new RuntimeException(msg,e);
  }
 finally {
    if (urlConn != null) {
      urlConn.disconnect();
    }
  }
}
Program: 114754
Project: 114754
Buggy source:
private static String getAccessTokenForPublisher(){
  return getAccessToken("String_Node_Str" + "String_Node_Str");
}

Fixed version (ground truth):
private String getAccessTokenForPublisher(){
  return getAccessToken("String_Node_Str" + "String_Node_Str");
}
Program: 114755
Project: 114755
Buggy source:
public void checkClientTrusted(java.security.cert.X509Certificate[] certs,String authType){
}

Fixed version (ground truth):
@Override public void checkClientTrusted(X509Certificate[] chain,String authType) throws CertificateException {
}
Program: 114756
Project: 114756
Buggy source:
public java.security.cert.X509Certificate[] getAcceptedIssuers(){
  return new java.security.cert.X509Certificate[0];
}

Fixed version (ground truth):
@Override public X509Certificate[] getAcceptedIssuers(){
  return null;
}
Program: 114757
Project: 114757
Buggy source:
private static String getAccessTokenForStore(){
  return getAccessToken("String_Node_Str");
}

Fixed version (ground truth):
private String getAccessTokenForStore(){
  return getAccessToken("String_Node_Str");
}
Program: 114758
Project: 114758
Buggy source:
public void checkServerTrusted(java.security.cert.X509Certificate[] certs,String authType){
}

Fixed version (ground truth):
@Override public void checkServerTrusted(X509Certificate[] chain,String authType) throws CertificateException {
}
Program: 114761
Project: 114761
Buggy source:
public static String getResponseString(InputStream input) throws IOException {
  try (BufferedReader buffer=new BufferedReader(new InputStreamReader(input))){
    return buffer.lines().collect(Collectors.joining("String_Node_Str"));
  }
 }

Fixed version (ground truth):
private static String getResponseString(InputStream input) throws IOException {
  try (BufferedReader buffer=new BufferedReader(new InputStreamReader(input,StandardCharsets.UTF_8))){
    return buffer.lines().collect(Collectors.joining("String_Node_Str"));
  }
 }
Program: 114762
Project: 114762
Buggy source:
/** 
 * Clean api by removing unnecessary details
 * @param api api to be exported
 */
private static void cleanApiDataToExport(API api){
  api.setThumbnailUrl(null);
  api.setScopes(new TreeSet<Scope>());
}

Fixed version (ground truth):
/** 
 * Clean api by removing unnecessary details
 * @param api api to be exported
 */
private static void cleanApiDataToExport(API api){
  api.setThumbnailUrl(null);
  api.setWsdlUrl(null);
  api.setScopes(new TreeSet<Scope>());
}
Program: 114765
Project: 114765
Buggy source:
/** 
 * This method adds the WSDL to the registry, if there is a WSDL associated with the API
 * @param pathToArchive location of the extracted folder of the API
 * @param importedApi   the imported API object
 */
private static void addAPIWsdl(String pathToArchive,API importedApi){
  String wsdlFileName=importedApi.getId().getApiName() + "String_Node_Str" + importedApi.getId().getVersion()+ APIImportExportConstants.WSDL_EXTENSION;
  String wsdlPath=pathToArchive + APIImportExportConstants.WSDL_LOCATION + wsdlFileName;
  if (checkFileExistence(wsdlPath)) {
    try {
      URL wsdlFileUrl=new File(wsdlPath).toURI().toURL();
      importedApi.setWsdlUrl(wsdlFileUrl.toString());
      Registry registry=APIExportUtil.getRegistry();
      APIUtil.createWSDL((org.wso2.carbon.registry.core.Registry)registry,importedApi);
    }
 catch (    MalformedURLException e) {
      log.error("String_Node_Str",e);
    }
catch (    org.wso2.carbon.registry.core.exceptions.RegistryException e) {
      log.error("String_Node_Str",e);
    }
catch (    APIManagementException e) {
      log.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * This method adds the WSDL to the registry, if there is a WSDL associated with the API
 * @param pathToArchive location of the extracted folder of the API
 * @param importedApi   the imported API object
 */
private static void addAPIWsdl(String pathToArchive,API importedApi){
  String wsdlFileName=importedApi.getId().getApiName() + "String_Node_Str" + importedApi.getId().getVersion()+ APIImportExportConstants.WSDL_EXTENSION;
  String wsdlPath=pathToArchive + APIImportExportConstants.WSDL_LOCATION + wsdlFileName;
  if (checkFileExistence(wsdlPath)) {
    try {
      URL wsdlFileUrl=new File(wsdlPath).toURI().toURL();
      importedApi.setWsdlUrl(wsdlFileUrl.toString());
      Registry registry=APIExportUtil.getRegistry();
      APIUtil.createWSDL((org.wso2.carbon.registry.core.Registry)registry,importedApi);
      provider.updateAPI(importedApi);
    }
 catch (    MalformedURLException e) {
      log.error("String_Node_Str",e);
    }
catch (    org.wso2.carbon.registry.core.exceptions.RegistryException e) {
      log.error("String_Node_Str",e);
    }
catch (    APIManagementException e) {
      log.error("String_Node_Str",e);
    }
catch (    FaultGatewaysException e) {
      log.error("String_Node_Str",e);
    }
  }
}
Program: 114766
Project: 114766
Buggy source:
/** 
 * Test throttling by invoking API
 * @param accessToken API accessToken
 */
private void testThrottling(String accessToken) throws Exception {
  int limit=4;
  int numberOfIterations=6;
  WebSocketClient client=new WebSocketClient();
  WebSocketClientImpl socket=new WebSocketClientImpl();
  client.start();
  URI echoUri=new URI(apiEndPoint);
  ClientUpgradeRequest request=new ClientUpgradeRequest();
  request.setHeader("String_Node_Str","String_Node_Str" + accessToken);
  client.connect(socket,echoUri,request);
  socket.getLatch().await(3,TimeUnit.SECONDS);
  try {
    for (int count=1; count <= numberOfIterations; count++) {
      socket.sendMessage(testMessage);
      waitForReply(socket);
      log.info("String_Node_Str" + count + "String_Node_Str"+ socket.getResponseMessage());
      if (count >= limit) {
        assertEquals(socket.getResponseMessage(),"String_Node_Str","String_Node_Str");
      }
 else {
        assertEquals(socket.getResponseMessage(),testMessage.toUpperCase(),"String_Node_Str");
      }
      socket.setResponseMessage(null);
    }
  }
 catch (  Exception ex) {
    log.error("String_Node_Str" + ex);
    assertTrue(false,"String_Node_Str");
  }
 finally {
    client.stop();
  }
}

Fixed version (ground truth):
/** 
 * Test throttling by invoking API
 * @param accessToken API accessToken
 */
private void testThrottling(String accessToken) throws Exception {
  int limit=4;
  int numberOfIterations=6;
  WebSocketClient client=new WebSocketClient();
  WebSocketClientImpl socket=new WebSocketClientImpl();
  client.start();
  URI echoUri=new URI(apiEndPoint);
  ClientUpgradeRequest request=new ClientUpgradeRequest();
  request.setHeader("String_Node_Str","String_Node_Str" + accessToken);
  client.connect(socket,echoUri,request);
  socket.getLatch().await(3,TimeUnit.SECONDS);
  try {
    for (int count=1; count <= numberOfIterations; count++) {
      socket.sendMessage(testMessage);
      waitForReply(socket);
      log.info("String_Node_Str" + count + "String_Node_Str"+ socket.getResponseMessage());
      if (count > limit) {
        assertEquals(socket.getResponseMessage(),"String_Node_Str","String_Node_Str");
      }
 else {
        assertEquals(socket.getResponseMessage(),testMessage.toUpperCase(),"String_Node_Str");
      }
      socket.setResponseMessage(null);
    }
  }
 catch (  Exception ex) {
    log.error("String_Node_Str" + ex);
    assertTrue(false,"String_Node_Str");
  }
 finally {
    client.stop();
  }
}
Program: 114767
Project: 114767
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  startWebSocketServer(webSocketServerPort);
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  webSocketServerHost=InetAddress.getLocalHost().getHostName();
  int lowerPortLimit=9950;
  int upperPortLimit=9999;
  webSocketServerPort=getAvailablePort(lowerPortLimit,upperPortLimit);
  if (webSocketServerPort == -1) {
    throw new APIManagerIntegrationTestException("String_Node_Str" + lowerPortLimit + "String_Node_Str"+ upperPortLimit+ "String_Node_Str");
  }
  log.info("String_Node_Str" + webSocketServerPort + "String_Node_Str");
  startWebSocketServer(webSocketServerPort);
}
Program: 114769
Project: 114769
Buggy source:
/** 
 * Test throttling by invoking API
 * @param accessToken API accessToken
 */
private void testThrottling(String accessToken) throws Exception {
  int limit=4;
  int numberOfIterations=6;
  WebSocketClient client=new WebSocketClient();
  WebSocketClientImpl socket=new WebSocketClientImpl();
  client.start();
  URI echoUri=new URI(apiEndPoint);
  ClientUpgradeRequest request=new ClientUpgradeRequest();
  request.setHeader("String_Node_Str","String_Node_Str" + accessToken);
  client.connect(socket,echoUri,request);
  socket.getLatch().await(3,TimeUnit.SECONDS);
  try {
    for (int count=1; count <= numberOfIterations; count++) {
      socket.sendMessage(testMessage);
      waitForReply(socket);
      log.info("String_Node_Str" + count + "String_Node_Str"+ socket.getResponseMessage());
      if (count >= limit) {
        assertEquals(socket.getResponseMessage(),"String_Node_Str","String_Node_Str");
      }
 else {
        assertEquals(socket.getResponseMessage(),testMessage.toUpperCase(),"String_Node_Str");
      }
      socket.setResponseMessage(null);
    }
  }
 catch (  Exception ex) {
    log.error("String_Node_Str" + ex);
    assertTrue(false,"String_Node_Str");
  }
 finally {
    client.stop();
  }
}

Fixed version (ground truth):
/** 
 * Test throttling by invoking API
 * @param accessToken API accessToken
 */
private void testThrottling(String accessToken) throws Exception {
  int limit=4;
  int numberOfIterations=6;
  WebSocketClient client=new WebSocketClient();
  WebSocketClientImpl socket=new WebSocketClientImpl();
  client.start();
  URI echoUri=new URI(apiEndPoint);
  ClientUpgradeRequest request=new ClientUpgradeRequest();
  request.setHeader("String_Node_Str","String_Node_Str" + accessToken);
  client.connect(socket,echoUri,request);
  socket.getLatch().await(3,TimeUnit.SECONDS);
  try {
    for (int count=1; count <= numberOfIterations; count++) {
      socket.sendMessage(testMessage);
      waitForReply(socket);
      log.info("String_Node_Str" + count + "String_Node_Str"+ socket.getResponseMessage());
      if (count > limit) {
        assertEquals(socket.getResponseMessage(),"String_Node_Str","String_Node_Str");
      }
 else {
        assertEquals(socket.getResponseMessage(),testMessage.toUpperCase(),"String_Node_Str");
      }
      socket.setResponseMessage(null);
    }
  }
 catch (  Exception ex) {
    log.error("String_Node_Str" + ex);
    assertTrue(false,"String_Node_Str");
  }
 finally {
    client.stop();
  }
}
Program: 114770
Project: 114770
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  startWebSocketServer(webSocketServerPort);
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  webSocketServerHost=InetAddress.getLocalHost().getHostName();
  int lowerPortLimit=9950;
  int upperPortLimit=9999;
  webSocketServerPort=getAvailablePort(lowerPortLimit,upperPortLimit);
  if (webSocketServerPort == -1) {
    throw new APIManagerIntegrationTestException("String_Node_Str" + lowerPortLimit + "String_Node_Str"+ upperPortLimit+ "String_Node_Str");
  }
  log.info("String_Node_Str" + webSocketServerPort + "String_Node_Str");
  startWebSocketServer(webSocketServerPort);
}
Program: 114780
Project: 114780
Buggy source:
public void initialize() throws Exception {
  if (!isInitialised) {
    super.init();
    apiEndPointUrl=getGatewayURLHttp() + API_END_POINT_POSTFIX_URL;
    providerName=user.getUserName();
    String publisherURLHttp=getPublisherURLHttp();
    String storeURLHttp=getStoreURLHttp();
    apiPublisherClientUser1=new APIPublisherRestClient(publisherURLHttp);
    apiStoreClientUser1=new APIStoreRestClient(storeURLHttp);
    apiPublisherClientUser1.login(user.getUserName(),user.getPassword());
    apiStoreClientUser1.login(user.getUserName(),user.getPassword());
    apiIdentifier=new APIIdentifier(providerName,API_NAME,API_VERSION_1_0_0);
    isInitialised=true;
  }
}

Fixed version (ground truth):
public void initialize() throws Exception {
  if (!isInitialised) {
    new AdvancedThrottlingConfig().disableAdvancedThrottling();
    super.init();
    apiEndPointUrl=getGatewayURLHttp() + API_END_POINT_POSTFIX_URL;
    providerName=user.getUserName();
    String publisherURLHttp=getPublisherURLHttp();
    String storeURLHttp=getStoreURLHttp();
    apiPublisherClientUser1=new APIPublisherRestClient(publisherURLHttp);
    apiStoreClientUser1=new APIStoreRestClient(storeURLHttp);
    apiPublisherClientUser1.login(user.getUserName(),user.getPassword());
    apiStoreClientUser1.login(user.getUserName(),user.getPassword());
    apiIdentifier=new APIIdentifier(providerName,API_NAME,API_VERSION_1_0_0);
    isInitialised=true;
  }
}
Program: 114782
Project: 114782
Buggy source:
/** 
 * This method is used to migrate database tables This executes the database queries according to the user's db type and alters the tables
 * @throws SQLException
 */
@Override public void databaseMigration() throws SQLException {
  final String productHome=CarbonUtils.getCarbonHome();
  String scriptPath=productHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
  updateAPIManagerDatabase(scriptPath);
  String constraintsScriptPath=productHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
}

Fixed version (ground truth):
/** 
 * This method is used to migrate database tables This executes the database queries according to the user's db type and alters the tables
 * @throws SQLException
 */
@Override public void databaseMigration() throws SQLException {
  final String productHome=CarbonUtils.getCarbonHome();
  String scriptPath=productHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
  updateAPIManagerDatabase(scriptPath);
  String constraintsScriptPath=productHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
  dropFKConstraint(constraintsScriptPath);
}
Program: 114784
Project: 114784
Buggy source:
/** 
 * This method is used to migrate swagger v1.2 resources to swagger v2.0 resource This reads the swagger v1.2 doc from the registry and creates swagger v2.0 doc
 * @throws APIMigrationException
 */
void swaggerResourceMigration() throws APIMigrationException {
  log.info("String_Node_Str" + Constants.VERSION_1_9 + "String_Node_Str");
  for (  Tenant tenant : getTenantsArray()) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
    }
    try {
      registryService.startTenantFlow(tenant);
      GenericArtifact[] artifacts=registryService.getGenericAPIArtifacts();
      updateSwaggerResources(artifacts,tenant);
    }
  finally {
      registryService.endTenantFlow();
    }
    log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
  }
  log.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * This method is used to migrate swagger v1.2 resources to swagger v2.0 resource This reads the swagger v1.2 doc from the registry and creates swagger v2.0 doc
 * @throws APIMigrationException
 */
void swaggerResourceMigration() throws APIMigrationException {
  log.info("String_Node_Str" + Constants.VERSION_1_10 + "String_Node_Str");
  for (  Tenant tenant : getTenantsArray()) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
    }
    try {
      registryService.startTenantFlow(tenant);
      GenericArtifact[] artifacts=registryService.getGenericAPIArtifacts();
      updateSwaggerResources(artifacts,tenant);
    }
  finally {
      registryService.endTenantFlow();
    }
    log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
  }
  log.info("String_Node_Str");
}
Program: 114785
Project: 114785
Buggy source:
/** 
 * This method is used to migrate database tables This executes the database queries according to the user's db type and alters the tables
 * @throws SQLException
 */
@Override public void databaseMigration() throws SQLException {
  final String productHome=CarbonUtils.getCarbonHome();
  String scriptPath=productHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
  updateAPIManagerDatabase(scriptPath);
  String constraintsScriptPath=productHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
  dropFKConstraint(constraintsScriptPath);
}

Fixed version (ground truth):
/** 
 * This method is used to migrate database tables This executes the database queries according to the user's db type and alters the tables
 * @throws SQLException
 */
@Override public void databaseMigration() throws SQLException {
  final String productHome=CarbonUtils.getCarbonHome();
  String scriptPath=productHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
  updateAPIManagerDatabase(scriptPath);
  String constraintsScriptPath=productHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
}
Program: 114790
Project: 114790
Buggy source:
/** 
 * adding address_endpoint to endpoints if not available
 * @param endpointElement endpoint element
 * @param doc             xml document
 */
public static void addingAddressPropertyToEndpoint(Element endpointElement,Document doc){
  NodeList addressProp=endpointElement.getElementsByTagName(Constants.SYNAPSE_API_ELEMENT_PROPERTY);
  Element propertyElement, propertyElementExist;
  boolean exist=false;
  for (int i=0; i < addressProp.getLength(); i++) {
    propertyElement=(Element)addressProp.item(i);
    if (propertyElement.hasAttribute(Constants.SYNAPSE_API_ATTRIBUTE_NAME)) {
      if (Constants.SYNAPSE_ENDPOINT_ADDRESS_XML_ELEMENT.equalsIgnoreCase(propertyElement.getAttribute(Constants.SYNAPSE_API_ATTRIBUTE_NAME))) {
        exist=true;
        break;
      }
    }
  }
  if (!exist) {
    Element uriElement=(Element)endpointElement.getElementsByTagName(Constants.SYNAPSE_HTTP_XML_ELEMENT).item(0);
    String val=uriElement.getAttribute(Constants.SYNAPSE_URI_TEMPLATE_ATTRIBUTE_NAME);
    propertyElementExist=doc.createElementNS(Constants.SYNAPSE_API_XMLNS,Constants.SYNAPSE_API_ELEMENT_PROPERTY);
    propertyElementExist.setAttribute(Constants.SYNAPSE_API_ATTRIBUTE_VALUE,val);
    propertyElementExist.setAttribute(Constants.SYNAPSE_API_ATTRIBUTE_NAME,Constants.SYNAPSE_ENDPOINT_ADDRESS_XML_ELEMENT);
    endpointElement.appendChild(propertyElementExist);
  }
}

Fixed version (ground truth):
/** 
 * adding address_endpoint to endpoints if not available
 * @param endpointElement endpoint element
 * @param doc             xml document
 */
public static void addingAddressPropertyToEndpoint(Element endpointElement,Document doc){
  NodeList addressProp=endpointElement.getElementsByTagName(Constants.SYNAPSE_API_ELEMENT_PROPERTY);
  Element propertyElement, propertyElementExist;
  boolean exist=false;
  for (int i=0; i < addressProp.getLength(); i++) {
    propertyElement=(Element)addressProp.item(i);
    if (propertyElement.hasAttribute(Constants.SYNAPSE_API_ATTRIBUTE_NAME)) {
      if (Constants.SYNAPSE_ENDPOINT_ADDRESS_XML_ELEMENT.equalsIgnoreCase(propertyElement.getAttribute(Constants.SYNAPSE_API_ATTRIBUTE_NAME))) {
        exist=true;
        break;
      }
    }
  }
  if (!exist) {
    Element uriElement=(Element)endpointElement.getElementsByTagName(Constants.SYNAPSE_HTTP_XML_ELEMENT).item(0);
    Element addressElement=(Element)endpointElement.getElementsByTagName("String_Node_Str").item(0);
    String val;
    if (uriElement != null) {
      val=uriElement.getAttribute(Constants.SYNAPSE_URI_TEMPLATE_ATTRIBUTE_NAME);
    }
 else     if (addressElement != null) {
      val=addressElement.getAttribute("String_Node_Str");
    }
 else {
      return;
    }
    propertyElementExist=doc.createElementNS(Constants.SYNAPSE_API_XMLNS,Constants.SYNAPSE_API_ELEMENT_PROPERTY);
    propertyElementExist.setAttribute(Constants.SYNAPSE_API_ATTRIBUTE_VALUE,val);
    propertyElementExist.setAttribute(Constants.SYNAPSE_API_ATTRIBUTE_NAME,Constants.SYNAPSE_ENDPOINT_ADDRESS_XML_ELEMENT);
    endpointElement.appendChild(propertyElementExist);
  }
}
Program: 114797
Project: 114797
Buggy source:
private static void updateOutSequence(Element resourceElement,Document doc){
  Element outSequenceElement=(Element)resourceElement.getElementsByTagNameNS(Constants.SYNAPSE_API_XMLNS,Constants.SYNAPSE_API_ELEMENT_OUTSEQUENCE).item(0);
  NodeList classNodes=outSequenceElement.getElementsByTagName(Constants.SYNAPSE_API_ELEMENT_CLASS);
  boolean isResponseHandlerSet=false;
  for (int i=0; i < classNodes.getLength(); ++i) {
    Element classElement=(Element)classNodes.item(i);
    if (Constants.SYNAPSE_API_VALUE_RESPONSE_HANDLER.equals(classElement.getAttribute(Constants.SYNAPSE_API_ATTRIBUTE_NAME))) {
      isResponseHandlerSet=true;
      break;
    }
  }
  if (!isResponseHandlerSet) {
    Element sendElement=(Element)outSequenceElement.getElementsByTagName(Constants.SYNAPSE_API_ELEMENT_SEND).item(0);
    Element classElement=doc.createElementNS(Constants.SYNAPSE_API_XMLNS,Constants.SYNAPSE_API_ELEMENT_CLASS);
    classElement.setAttribute(Constants.SYNAPSE_API_ATTRIBUTE_NAME,Constants.SYNAPSE_API_VALUE_RESPONSE_HANDLER);
    classElement.removeAttribute(Constants.SYNAPSE_API_ATTRIBUTE_XMLNS);
    outSequenceElement.insertBefore(classElement,sendElement);
  }
}

Fixed version (ground truth):
private static void updateOutSequence(Element resourceElement,Document doc){
  Element outSequenceElement=(Element)resourceElement.getElementsByTagNameNS(Constants.SYNAPSE_API_XMLNS,Constants.SYNAPSE_API_ELEMENT_OUTSEQUENCE).item(0);
  if (outSequenceElement == null) {
    return;
  }
  NodeList classNodes=outSequenceElement.getElementsByTagName(Constants.SYNAPSE_API_ELEMENT_CLASS);
  boolean isResponseHandlerSet=false;
  for (int i=0; i < classNodes.getLength(); ++i) {
    Element classElement=(Element)classNodes.item(i);
    if (Constants.SYNAPSE_API_VALUE_RESPONSE_HANDLER.equals(classElement.getAttribute(Constants.SYNAPSE_API_ATTRIBUTE_NAME))) {
      isResponseHandlerSet=true;
      break;
    }
  }
  if (!isResponseHandlerSet) {
    Element sendElement=(Element)outSequenceElement.getElementsByTagName(Constants.SYNAPSE_API_ELEMENT_SEND).item(0);
    Element classElement=doc.createElementNS(Constants.SYNAPSE_API_XMLNS,Constants.SYNAPSE_API_ELEMENT_CLASS);
    classElement.setAttribute(Constants.SYNAPSE_API_ATTRIBUTE_NAME,Constants.SYNAPSE_API_VALUE_RESPONSE_HANDLER);
    classElement.removeAttribute(Constants.SYNAPSE_API_ATTRIBUTE_XMLNS);
    outSequenceElement.insertBefore(classElement,sendElement);
  }
}
Program: 114803
Project: 114803
Buggy source:
/** 
 * Upload a file to the given URL
 * @param importUrl URL to be file upload
 * @param fileName  Name of the file to be upload
 * @throws IOException throws if connection issues occurred
 */
private void importAPI(String importUrl,File fileName,String user,char[] pass) throws IOException {
  URL url=new URL(importUrl);
  HttpURLConnection connection=(HttpURLConnection)url.openConnection();
  connection.setDoOutput(true);
  connection.setRequestMethod("String_Node_Str");
  FileBody fileBody=new FileBody(fileName);
  MultipartEntity multipartEntity=new MultipartEntity(HttpMultipartMode.STRICT);
  multipartEntity.addPart("String_Node_Str",fileBody);
  connection.setRequestProperty("String_Node_Str",multipartEntity.getContentType().getValue());
  connection.setRequestProperty(APIMIntegrationConstants.AUTHORIZATION_HEADER,"String_Node_Str" + encodeCredentials(user,pass));
  OutputStream out=connection.getOutputStream();
  try {
    multipartEntity.writeTo(out);
  }
  finally {
    out.close();
  }
  int status=connection.getResponseCode();
  BufferedReader read=new BufferedReader(new InputStreamReader(connection.getInputStream()));
  String temp;
  StringBuilder response=new StringBuilder();
  while ((temp=read.readLine()) != null) {
    response.append(temp);
  }
  Assert.assertEquals(status,HttpStatus.SC_CREATED,"String_Node_Str" + response);
}

Fixed version (ground truth):
/** 
 * Upload a file to the given URL
 * @param importUrl URL to be file upload
 * @param fileName  Name of the file to be upload
 * @throws IOException throws if connection issues occurred
 */
private void importAPI(String importUrl,File fileName,String user,char[] pass) throws IOException {
  URL url=new URL(importUrl);
  HttpsURLConnection connection=(HttpsURLConnection)url.openConnection();
  connection.setHostnameVerifier(new HostnameVerifier(){
    @Override public boolean verify(    String s,    SSLSession sslSession){
      return true;
    }
  }
);
  connection.setDoOutput(true);
  connection.setRequestMethod("String_Node_Str");
  FileBody fileBody=new FileBody(fileName);
  MultipartEntity multipartEntity=new MultipartEntity(HttpMultipartMode.STRICT);
  multipartEntity.addPart("String_Node_Str",fileBody);
  connection.setRequestProperty("String_Node_Str",multipartEntity.getContentType().getValue());
  connection.setRequestProperty(APIMIntegrationConstants.AUTHORIZATION_HEADER,"String_Node_Str" + encodeCredentials(user,pass));
  OutputStream out=connection.getOutputStream();
  try {
    multipartEntity.writeTo(out);
  }
  finally {
    out.close();
  }
  int status=connection.getResponseCode();
  BufferedReader read=new BufferedReader(new InputStreamReader(connection.getInputStream()));
  String temp;
  StringBuilder response=new StringBuilder();
  while ((temp=read.readLine()) != null) {
    response.append(temp);
  }
  Assert.assertEquals(status,HttpStatus.SC_CREATED,"String_Node_Str" + response);
}
Program: 114804
Project: 114804
Buggy source:
/** 
 * Save file from a given URL
 * @param exportRequest URL of the file location
 * @param fileName      expected File to be saved
 * @throws URISyntaxException throws if URL is malformed
 * @throws IOException        throws if connection issues occurred
 */
private void exportAPI(URL exportRequest,File fileName) throws URISyntaxException, IOException {
  requestHeaders.put(APIMIntegrationConstants.AUTHORIZATION_HEADER,"String_Node_Str" + encodeCredentials(user.getUserName(),user.getPassword().toCharArray()));
  HttpResponse response=HTTPSClientUtils.doGet(exportRequest.toString(),requestHeaders);
  String data=response.getData();
  if (data != null) {
    FileOutputStream outStream=new FileOutputStream(fileName);
    try {
      outStream.write(data.getBytes());
    }
  finally {
      outStream.close();
    }
  }
  Assert.assertEquals(response.getResponseCode(),HttpStatus.SC_OK,"String_Node_Str");
  Assert.assertTrue(fileName.exists(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Save file from a given URL
 * @param exportRequest URL of the file location
 * @param fileName      expected File to be saved
 * @throws URISyntaxException throws if URL is malformed
 * @throws IOException        throws if connection issues occurred
 */
private void exportAPI(URL exportRequest,File fileName) throws URISyntaxException, IOException {
  CloseableHttpClient client=HTTPSClientUtils.getHttpsClient();
  HttpGet get=new HttpGet(exportRequest.toURI());
  get.addHeader(APIMIntegrationConstants.AUTHORIZATION_HEADER,"String_Node_Str" + encodeCredentials(user.getUserName(),user.getPassword().toCharArray()));
  CloseableHttpResponse response=client.execute(get);
  HttpEntity entity=response.getEntity();
  if (entity != null) {
    FileOutputStream outStream=new FileOutputStream(fileName);
    try {
      entity.writeTo(outStream);
    }
  finally {
      outStream.close();
    }
  }
  Assert.assertEquals(response.getStatusLine().getStatusCode(),HttpStatus.SC_OK,"String_Node_Str");
  Assert.assertTrue(fileName.exists(),"String_Node_Str");
}
Program: 114809
Project: 114809
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testSubscriptionAfterApplicationNameUpdate() throws Exception {
  Map<String,String> headers=new HashMap<String,String>();
  headers.put("String_Node_Str",apiStore.getSession());
  HttpResponse response=HttpRequestUtil.doGet(storeURLHttp + "String_Node_Str",headers);
  Assert.assertEquals(response.getResponseCode(),HttpStatus.SC_OK,"String_Node_Str");
  response=apiStore.getAllSubscriptionsOfApplication(APP_NAME_TO_UPDATE);
  verifyResponse(response);
  Assert.assertTrue(response.getData().contains(API_NAME),"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testSubscriptionAfterApplicationNameUpdate() throws Exception {
  Map<String,String> headers=new HashMap<String,String>();
  headers.put("String_Node_Str",apiStore.getSession());
  HttpResponse response=HTTPSClientUtils.doGet(storeURLHttp + "String_Node_Str",headers);
  Assert.assertEquals(response.getResponseCode(),HttpStatus.SC_OK,"String_Node_Str");
  response=apiStore.getAllSubscriptionsOfApplication(APP_NAME_TO_UPDATE);
  verifyResponse(response);
  Assert.assertTrue(response.getData().contains(API_NAME),"String_Node_Str");
}
Program: 114814
Project: 114814
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testCallUserInfoApiWithOpenIdAccessToken() throws Exception {
  Map<String,String> requestHeaders=new HashMap<String,String>();
  requestHeaders.put("String_Node_Str","String_Node_Str" + userAccessToken);
  HttpResponse userInfoResponse=HttpRequestUtil.doGet(gatewayUrlsMgt.getWebAppURLNhttp() + "String_Node_Str",requestHeaders);
  Assert.assertEquals(userInfoResponse.getResponseCode(),200,"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testCallUserInfoApiWithOpenIdAccessToken() throws Exception {
  Map<String,String> requestHeaders=new HashMap<String,String>();
  requestHeaders.put("String_Node_Str","String_Node_Str" + userAccessToken);
  HttpResponse userInfoResponse=HTTPSClientUtils.doGet(gatewayUrlsMgt.getWebAppURLNhttp() + "String_Node_Str",requestHeaders);
  Assert.assertEquals(userInfoResponse.getResponseCode(),200,"String_Node_Str");
}
Program: 114816
Project: 114816
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str") public void testGenerateAccessTokenWithOpenIdScope() throws Exception {
  String requestBody="String_Node_Str" + user.getUserName() + "String_Node_Str"+ user.getPassword()+ "String_Node_Str";
  URL tokenEndpointURL=new URL(gatewayUrlsWrk.getWebAppURLNhttps() + "String_Node_Str");
  JSONObject accessTokenGenerationResponse=new JSONObject(apiStore.generateUserAccessKey(consumerKey,consumerSecret,requestBody,tokenEndpointURL).getData());
  userAccessToken=accessTokenGenerationResponse.getString("String_Node_Str");
  String scope=accessTokenGenerationResponse.getString("String_Node_Str");
  Assert.assertTrue(scope.contains("String_Node_Str"),"String_Node_Str" + "String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str") public void testGenerateAccessTokenWithOpenIdScope() throws Exception {
  String requestBody="String_Node_Str" + user.getUserName() + "String_Node_Str"+ user.getPassword()+ "String_Node_Str";
  URL tokenEndpointURL=new URL(gatewayUrlsWrk.getWebAppURLNhttps() + "String_Node_Str" + user.getUserDomain());
  JSONObject accessTokenGenerationResponse=new JSONObject(apiStore.generateUserAccessKey(consumerKey,consumerSecret,requestBody,tokenEndpointURL).getData());
  userAccessToken=accessTokenGenerationResponse.getString("String_Node_Str");
  String scope=accessTokenGenerationResponse.getString("String_Node_Str");
  Assert.assertTrue(scope.contains("String_Node_Str"),"String_Node_Str" + "String_Node_Str");
}
Program: 114818
Project: 114818
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  apiStore.removeApplication("String_Node_Str");
  super.cleanUp();
  if (TestUserMode.SUPER_TENANT_ADMIN == userMode) {
    serverConfigurationManager.restoreToLastConfiguration();
  }
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  apiStore.removeApplication("String_Node_Str");
  super.cleanUp();
}
Program: 114820
Project: 114820
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  if (TestUserMode.SUPER_TENANT_ADMIN == userMode) {
    serverConfigurationManager=new ServerConfigurationManager(gatewayContextWrk);
    serverConfigurationManager.applyConfigurationWithoutRestart(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"));
    serverConfigurationManager.restartGracefully();
    super.init();
  }
  apiPublisher=new APIPublisherRestClient(getPublisherURLHttp());
  apiStore=new APIStoreRestClient(getStoreURLHttp());
  apiPublisher.login(user.getUserName(),user.getPassword());
  apiStore.login(user.getUserName(),user.getPassword());
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  apiPublisher=new APIPublisherRestClient(getPublisherURLHttp());
  apiStore=new APIStoreRestClient(getStoreURLHttp());
  apiPublisher.login(user.getUserName(),user.getPassword());
  apiStore.login(user.getUserName(),user.getPassword());
}
Program: 114826
Project: 114826
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  subscriberUserWithTenantDomain=subscriberUsername + "String_Node_Str" + user.getUserDomain();
  publisherURLHttp=getPublisherURLHttp();
  storeURLHttp=getStoreURLHttp();
  if (TestUserMode.SUPER_TENANT_ADMIN == userMode) {
    serverConfigurationManager=new ServerConfigurationManager(gatewayContextWrk);
    serverConfigurationManager.applyConfigurationWithoutRestart(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"));
    serverConfigurationManager.applyConfiguration(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"));
    subscriberUserWithTenantDomain=subscriberUsername;
    String gatewaySessionCookie=createSession(gatewayContextMgt);
    loadSynapseConfigurationFromClasspath("String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str",gatewayContextMgt,gatewaySessionCookie);
  }
  backendURL=getSuperTenantAPIInvocationURLHttp("String_Node_Str","String_Node_Str");
  providerName=user.getUserName();
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  subscriberUserWithTenantDomain=subscriberUsername + "String_Node_Str" + user.getUserDomain();
  publisherURLHttp=getPublisherURLHttp();
  storeURLHttp=getStoreURLHttp();
  if (TestUserMode.SUPER_TENANT_ADMIN == userMode) {
    serverConfigurationManager=new ServerConfigurationManager(gatewayContextWrk);
    serverConfigurationManager.applyConfigurationWithoutRestart(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"));
    serverConfigurationManager.applyConfiguration(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"));
    subscriberUserWithTenantDomain=subscriberUsername;
  }
  providerName=user.getUserName();
}
Program: 114831
Project: 114831
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str" + "String_Node_Str",dependsOnMethods="String_Node_Str") public void testInvokeAPIAfterChangeAPIEndPointURLWithNewEndPointURL() throws Exception {
  waitForAPIDeployment();
  HttpResponse oldVersionInvokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(API_CONTEXT,API_VERSION_1_0_0),requestHeaders);
  assertEquals(oldVersionInvokeResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str");
  assertTrue(oldVersionInvokeResponse.getData().contains(API2_RESPONSE_DATA),"String_Node_Str" + "String_Node_Str" + oldVersionInvokeResponse.getData() + "String_Node_Str"+ API2_RESPONSE_DATA);
  assertFalse(oldVersionInvokeResponse.getData().contains(API1_RESPONSE_DATA),"String_Node_Str" + "String_Node_Str" + oldVersionInvokeResponse.getData() + "String_Node_Str"+ API2_RESPONSE_DATA);
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str" + "String_Node_Str",dependsOnMethods="String_Node_Str") public void testInvokeAPIAfterChangeAPIEndPointURLWithNewEndPointURL() throws Exception {
  HttpResponse oldVersionInvokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(API_CONTEXT,API_VERSION_1_0_0),requestHeaders);
  assertEquals(oldVersionInvokeResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str");
  assertTrue(oldVersionInvokeResponse.getData().contains(API2_RESPONSE_DATA),"String_Node_Str" + "String_Node_Str" + oldVersionInvokeResponse.getData() + "String_Node_Str"+ API2_RESPONSE_DATA);
  assertFalse(oldVersionInvokeResponse.getData().contains(API1_RESPONSE_DATA),"String_Node_Str" + "String_Node_Str" + oldVersionInvokeResponse.getData() + "String_Node_Str"+ API2_RESPONSE_DATA);
}
Program: 114832
Project: 114832
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testEditEndPointURL() throws APIManagerIntegrationTestException, MalformedURLException {
  APICreationRequestBean apiCreationRequestBeanUpdate=new APICreationRequestBean(API_NAME,API_CONTEXT,API_VERSION_1_0_0,providerName,new URL(API2_END_POINT_URL));
  apiCreationRequestBeanUpdate.setTags(API_TAGS);
  apiCreationRequestBeanUpdate.setDescription(API_DESCRIPTION);
  HttpResponse updateAPIHTTPResponse=apiPublisherClientUser1.updateAPI(apiCreationRequestBeanUpdate);
  assertEquals(updateAPIHTTPResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str" + getAPIIdentifierString(apiIdentifier));
  assertEquals(getValueFromJSON(updateAPIHTTPResponse,"String_Node_Str"),"String_Node_Str","String_Node_Str" + getAPIIdentifierString(apiIdentifier) + "String_Node_Str"+ updateAPIHTTPResponse.getData());
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testEditEndPointURL() throws APIManagerIntegrationTestException, MalformedURLException {
  api2EndPointUrl=getGatewayURLHttp() + API2_END_POINT_POSTFIX_URL;
  APICreationRequestBean apiCreationRequestBeanUpdate=new APICreationRequestBean(API_NAME,API_CONTEXT,API_VERSION_1_0_0,providerName,new URL(api2EndPointUrl));
  apiCreationRequestBeanUpdate.setTags(API_TAGS);
  apiCreationRequestBeanUpdate.setDescription(API_DESCRIPTION);
  HttpResponse updateAPIHTTPResponse=apiPublisherClientUser1.updateAPI(apiCreationRequestBeanUpdate);
  assertEquals(updateAPIHTTPResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str" + getAPIIdentifierString(apiIdentifier));
  assertEquals(getValueFromJSON(updateAPIHTTPResponse,"String_Node_Str"),"String_Node_Str","String_Node_Str" + getAPIIdentifierString(apiIdentifier) + "String_Node_Str"+ updateAPIHTTPResponse.getData());
  waitForAPIDeployment();
}
Program: 114833
Project: 114833
Buggy source:
@AfterClass(alwaysRun=true) public void cleanUpArtifacts() throws APIManagerIntegrationTestException {
  apiStoreClientUser1.removeApplication(APPLICATION_NAME);
  deleteAPI(apiIdentifier,apiPublisherClientUser1);
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void cleanUpArtifacts() throws Exception {
  apiStoreClientUser1.removeApplication(APPLICATION_NAME);
  deleteAPI(apiIdentifier,apiPublisherClientUser1);
  super.cleanUp();
}
Program: 114835
Project: 114835
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str" + "String_Node_Str",dependsOnMethods="String_Node_Str") public void testInvokeAPIAfterChangeAPIEndPointURLWithNewEndPointURL() throws Exception {
  waitForAPIDeployment();
  HttpResponse oldVersionInvokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(API_CONTEXT,API_VERSION_1_0_0),requestHeaders);
  assertEquals(oldVersionInvokeResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str");
  assertTrue(oldVersionInvokeResponse.getData().contains(API2_RESPONSE_DATA),"String_Node_Str" + "String_Node_Str" + oldVersionInvokeResponse.getData() + "String_Node_Str"+ API2_RESPONSE_DATA);
  assertFalse(oldVersionInvokeResponse.getData().contains(API1_RESPONSE_DATA),"String_Node_Str" + "String_Node_Str" + oldVersionInvokeResponse.getData() + "String_Node_Str"+ API2_RESPONSE_DATA);
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str" + "String_Node_Str",dependsOnMethods="String_Node_Str") public void testInvokeAPIAfterChangeAPIEndPointURLWithNewEndPointURL() throws Exception {
  HttpResponse oldVersionInvokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(API_CONTEXT,API_VERSION_1_0_0),requestHeaders);
  assertEquals(oldVersionInvokeResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str");
  assertTrue(oldVersionInvokeResponse.getData().contains(API2_RESPONSE_DATA),"String_Node_Str" + "String_Node_Str" + oldVersionInvokeResponse.getData() + "String_Node_Str"+ API2_RESPONSE_DATA);
  assertFalse(oldVersionInvokeResponse.getData().contains(API1_RESPONSE_DATA),"String_Node_Str" + "String_Node_Str" + oldVersionInvokeResponse.getData() + "String_Node_Str"+ API2_RESPONSE_DATA);
}