nus-yam/ex-repair huggingface dataset:
Program: 115634
Project: 115634
Buggy source:
public static void main(String[] args){
  try {
    final Thread mainThread=Thread.currentThread();
    Runtime.getRuntime().addShutdownHook(new Thread(){
      public void run(){
        try {
          EventPublisherPool.close(MessagingUtil.Topics.INSTANCE_STATUS_TOPIC.getTopicName());
          mainThread.join();
        }
 catch (        Exception e) {
          log.error(e);
        }
      }
    }
);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    PropertyConfigurator.configure(System.getProperty("String_Node_Str"));
    CartridgeAgentConfiguration.getInstance();
    if (args.length >= 1) {
      String className=args[0];
      try {
        Constructor<?> c=Class.forName(className).getConstructor();
        cartridgeAgent=(CartridgeAgent)c.newInstance();
        log.info("String_Node_Str" + className);
      }
 catch (      Exception e) {
        String msg=String.format("String_Node_Str" + "String_Node_Str",className);
        log.warn(msg,e);
      }
    }
    if (cartridgeAgent == null) {
      cartridgeAgent=new CartridgeAgent();
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str");
      }
    }
    Thread thread=new Thread(cartridgeAgent);
    thread.start();
  }
 catch (  Exception e) {
    if (log.isErrorEnabled()) {
      log.error(e);
    }
    if (cartridgeAgent != null) {
      cartridgeAgent.terminate();
    }
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    final Thread mainThread=Thread.currentThread();
    Runtime.getRuntime().addShutdownHook(new Thread(){
      public void run(){
        try {
          EventPublisherPool.close(MessagingUtil.Topics.INSTANCE_STATUS_TOPIC.getTopicName());
          mainThread.join();
        }
 catch (        Exception e) {
          log.error(e);
        }
      }
    }
);
    CartridgeAgentConfiguration.getInstance();
    if (args.length >= 1) {
      String className=args[0];
      try {
        Constructor<?> c=Class.forName(className).getConstructor();
        cartridgeAgent=(CartridgeAgent)c.newInstance();
        log.info("String_Node_Str" + className);
      }
 catch (      Exception e) {
        String msg=String.format("String_Node_Str" + "String_Node_Str",className);
        log.warn(msg,e);
      }
    }
    if (cartridgeAgent == null) {
      cartridgeAgent=new CartridgeAgent();
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str");
      }
    }
    Thread thread=new Thread(cartridgeAgent);
    thread.start();
  }
 catch (  Exception e) {
    if (log.isErrorEnabled()) {
      log.error(e);
    }
    if (cartridgeAgent != null) {
      cartridgeAgent.terminate();
    }
  }
}
Program: 115636
Project: 115636
Buggy source:
@Override public boolean updateCartridge(Cartridge cartridgeConfig) throws InvalidCartridgeDefinitionException, InvalidIaasProviderException, CartridgeDefinitionNotExistsException {
  handleNullObject(cartridgeConfig,"String_Node_Str");
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + cartridgeConfig.getType());
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + cartridgeConfig.toString());
  }
  try {
    CloudControllerUtil.extractIaaSProvidersFromCartridge(cartridgeConfig);
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + cartridgeConfig.getType();
    log.error(msg,e);
    throw new InvalidCartridgeDefinitionException(msg,e);
  }
  String cartridgeType=cartridgeConfig.getType();
  if (cloudControllerContext.getCartridge(cartridgeType) != null) {
    Cartridge cartridgeToBeRemoved=cloudControllerContext.getCartridge(cartridgeType);
    try {
      removeCartridgeFromCC(cartridgeToBeRemoved.getType());
    }
 catch (    InvalidCartridgeTypeException ignore) {
    }
    copyIaasProviders(cartridgeConfig,cartridgeToBeRemoved);
  }
 else {
    throw new CartridgeDefinitionNotExistsException("String_Node_Str");
  }
  CloudControllerContext.getInstance().addCartridge(cartridgeConfig);
  CloudControllerContext.getInstance().persist();
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + cartridgeType);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean updateCartridge(Cartridge cartridge) throws InvalidCartridgeDefinitionException, InvalidIaasProviderException, CartridgeDefinitionNotExistsException {
  handleNullObject(cartridge,"String_Node_Str");
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + cartridge.getType());
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + cartridge.toString());
  }
  try {
    CloudControllerUtil.extractIaaSProvidersFromCartridge(cartridge);
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + cartridge.getType();
    log.error(msg,e);
    throw new InvalidCartridgeDefinitionException(msg,e);
  }
  String cartridgeType=cartridge.getType();
  if (cloudControllerContext.getCartridge(cartridgeType) != null) {
    Cartridge cartridgeToBeRemoved=cloudControllerContext.getCartridge(cartridgeType);
    try {
      removeCartridgeFromCC(cartridgeToBeRemoved.getType());
    }
 catch (    InvalidCartridgeTypeException ignore) {
    }
    copyIaasProviders(cartridge,cartridgeToBeRemoved);
  }
 else {
    throw new CartridgeDefinitionNotExistsException("String_Node_Str");
  }
  CloudControllerContext.getInstance().addCartridge(cartridge);
  CloudControllerContext.getInstance().persist();
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + cartridgeType);
  }
  return true;
}
Program: 115637
Project: 115637
Buggy source:
public static String getLoadBalancingIPTypeStringFromEnum(LoadBalancingIPType loadBalancingIPType){
  if (loadBalancingIPType == LoadBalancingIPType.Private) {
    return CloudControllerConstants.LOADBALANCING_IP_TYPE_PRIVATE;
  }
 else   if (loadBalancingIPType == LoadBalancingIPType.Public) {
    return CloudControllerConstants.LOADBALANCING_IP_TYPE_PUBLIE;
  }
  return null;
}

Fixed version (ground truth):
public static String getLoadBalancingIPTypeStringFromEnum(LoadBalancingIPType loadBalancingIPType){
  if (loadBalancingIPType == LoadBalancingIPType.Private) {
    return CloudControllerConstants.LOADBALANCING_IP_TYPE_PRIVATE;
  }
 else   if (loadBalancingIPType == LoadBalancingIPType.Public) {
    return CloudControllerConstants.LOADBALANCING_IP_TYPE_PUBLIC;
  }
  return null;
}
Program: 115638
Project: 115638
Buggy source:
public static LoadBalancingIPType getLoadBalancingIPTypeEnumFromString(String loadBalancingIPType){
  if (loadBalancingIPType.equals(CloudControllerConstants.LOADBALANCING_IP_TYPE_PUBLIE)) {
    return LoadBalancingIPType.Public;
  }
 else   if (loadBalancingIPType.equals(CloudControllerConstants.LOADBALANCING_IP_TYPE_PRIVATE)) {
    return LoadBalancingIPType.Private;
  }
  return null;
}

Fixed version (ground truth):
public static LoadBalancingIPType getLoadBalancingIPTypeEnumFromString(String loadBalancingIPType){
  if (CloudControllerConstants.LOADBALANCING_IP_TYPE_PUBLIC.equals(loadBalancingIPType)) {
    return LoadBalancingIPType.Public;
  }
 else {
    return LoadBalancingIPType.Private;
  }
}
Program: 115640
Project: 115640
Buggy source:
/** 
 * Deletes a cartridge definition.
 * @param cartridgeType the cartridge type
 * @return 200 if cartridge is successfully removed
 * @throws RestAPIException the rest api exception
 */
@DELETE @Path("String_Node_Str") @Produces("String_Node_Str") @Consumes("String_Node_Str") @AuthorizationAction("String_Node_Str") public Response removeCartridge(@PathParam("String_Node_Str") String cartridgeType) throws RestAPIException {
  StratosApiV41Utils.removeCartridge(cartridgeType);
  return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,String.format("String_Node_Str",cartridgeType))).build();
}

Fixed version (ground truth):
/** 
 * Deletes a cartridge definition.
 * @param cartridgeType the cartridge type
 * @return 200 if cartridge is successfully removed
 * @throws RestAPIException the rest api exception
 */
@DELETE @Path("String_Node_Str") @Produces("String_Node_Str") @Consumes("String_Node_Str") @AuthorizationAction("String_Node_Str") public Response removeCartridge(@PathParam("String_Node_Str") String cartridgeType) throws RestAPIException {
  try {
    StratosApiV41Utils.removeCartridge(cartridgeType);
    return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,String.format("String_Node_Str",cartridgeType))).build();
  }
 catch (  Exception e) {
    return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,e.getMessage())).build();
  }
}
Program: 115641
Project: 115641
Buggy source:
/** 
 * Remove Cartridge
 * @param cartridgeType Cartridge Type
 * @throws RestAPIException
 */
public static void removeCartridge(String cartridgeType) throws RestAPIException {
  try {
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",cartridgeType));
    }
    CloudControllerServiceClient cloudControllerServiceClient=getCloudControllerServiceClient();
    if (cloudControllerServiceClient.getCartridge(cartridgeType) == null) {
      throw new RuntimeException("String_Node_Str" + cartridgeType);
    }
    StratosManagerServiceClient smServiceClient=getStratosManagerServiceClient();
    if (!smServiceClient.canCartridgeBeRemoved(cartridgeType)) {
      String message="String_Node_Str" + cartridgeType + "String_Node_Str";
      log.error(message);
      throw new RestAPIException(message);
    }
    cloudControllerServiceClient.removeCartridge(cartridgeType);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",cartridgeType));
    }
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + e.getLocalizedMessage();
    log.error(msg,e);
    throw new RestAPIException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Remove Cartridge
 * @param cartridgeType Cartridge Type
 * @throws RestAPIException
 */
public static void removeCartridge(String cartridgeType) throws RestAPIException {
  try {
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",cartridgeType));
    }
    CloudControllerServiceClient cloudControllerServiceClient=getCloudControllerServiceClient();
    if (cloudControllerServiceClient.getCartridge(cartridgeType) == null) {
      throw new RuntimeException("String_Node_Str" + cartridgeType);
    }
    StratosManagerServiceClient smServiceClient=getStratosManagerServiceClient();
    if (!smServiceClient.canCartridgeBeRemoved(cartridgeType)) {
      String message="String_Node_Str" + cartridgeType + "String_Node_Str";
      log.error(message);
      throw new RestAPIException(message);
    }
    cloudControllerServiceClient.removeCartridge(cartridgeType);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",cartridgeType));
    }
  }
 catch (  RemoteException e) {
    throw new RestAPIException(e.getMessage());
  }
catch (  CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
    throw new RestAPIException(e.getFaultMessage().getInvalidCartridgeTypeException().getMessage());
  }
catch (  CloudControllerServiceCartridgeNotFoundExceptionException e) {
    throw new RestAPIException(e.getFaultMessage().getCartridgeNotFoundException().getMessage());
  }
}
Program: 115643
Project: 115643
Buggy source:
/** 
 * Deletes a cartridge definition.
 * @param cartridgeType the cartridge type
 * @return 200 if cartridge is successfully removed
 * @throws RestAPIException the rest api exception
 */
@DELETE @Path("String_Node_Str") @Produces("String_Node_Str") @Consumes("String_Node_Str") @AuthorizationAction("String_Node_Str") public Response removeCartridge(@PathParam("String_Node_Str") String cartridgeType) throws RestAPIException {
  StratosApiV41Utils.removeCartridge(cartridgeType);
  return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,String.format("String_Node_Str",cartridgeType))).build();
}

Fixed version (ground truth):
/** 
 * Deletes a cartridge definition.
 * @param cartridgeType the cartridge type
 * @return 200 if cartridge is successfully removed
 * @throws RestAPIException the rest api exception
 */
@DELETE @Path("String_Node_Str") @Produces("String_Node_Str") @Consumes("String_Node_Str") @AuthorizationAction("String_Node_Str") public Response removeCartridge(@PathParam("String_Node_Str") String cartridgeType) throws RestAPIException {
  try {
    StratosApiV41Utils.removeCartridge(cartridgeType);
    return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,String.format("String_Node_Str",cartridgeType))).build();
  }
 catch (  Exception e) {
    return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,e.getMessage())).build();
  }
}
Program: 115644
Project: 115644
Buggy source:
/** 
 * Remove Cartridge
 * @param cartridgeType Cartridge Type
 * @throws RestAPIException
 */
public static void removeCartridge(String cartridgeType) throws RestAPIException {
  try {
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",cartridgeType));
    }
    CloudControllerServiceClient cloudControllerServiceClient=getCloudControllerServiceClient();
    if (cloudControllerServiceClient.getCartridge(cartridgeType) == null) {
      throw new RuntimeException("String_Node_Str" + cartridgeType);
    }
    StratosManagerServiceClient smServiceClient=getStratosManagerServiceClient();
    if (!smServiceClient.canCartridgeBeRemoved(cartridgeType)) {
      String message="String_Node_Str" + cartridgeType + "String_Node_Str";
      log.error(message);
      throw new RestAPIException(message);
    }
    cloudControllerServiceClient.removeCartridge(cartridgeType);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",cartridgeType));
    }
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + e.getLocalizedMessage();
    log.error(msg,e);
    throw new RestAPIException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Remove Cartridge
 * @param cartridgeType Cartridge Type
 * @throws RestAPIException
 */
public static void removeCartridge(String cartridgeType) throws RestAPIException {
  try {
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",cartridgeType));
    }
    CloudControllerServiceClient cloudControllerServiceClient=getCloudControllerServiceClient();
    if (cloudControllerServiceClient.getCartridge(cartridgeType) == null) {
      throw new RuntimeException("String_Node_Str" + cartridgeType);
    }
    StratosManagerServiceClient smServiceClient=getStratosManagerServiceClient();
    if (!smServiceClient.canCartridgeBeRemoved(cartridgeType)) {
      String message="String_Node_Str" + cartridgeType + "String_Node_Str";
      log.error(message);
      throw new RestAPIException(message);
    }
    cloudControllerServiceClient.removeCartridge(cartridgeType);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",cartridgeType));
    }
  }
 catch (  RemoteException e) {
    throw new RestAPIException(e.getMessage());
  }
catch (  CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
    throw new RestAPIException(e.getFaultMessage().getInvalidCartridgeTypeException().getMessage());
  }
catch (  CloudControllerServiceCartridgeNotFoundExceptionException e) {
    throw new RestAPIException(e.getFaultMessage().getCartridgeNotFoundException().getMessage());
  }
}
Program: 115645
Project: 115645
Buggy source:
/** 
 * Deploy application
 * @param applicationId       application id
 * @param applicationPolicyId application policy id
 * @throws CommandException
 */
public void deployApplication(String applicationId,String applicationPolicyId) throws CommandException {
  DefaultHttpClient httpClient=new DefaultHttpClient();
  try {
    String url=(ENDPOINT_DEPLOY_APPLICATION.replace("String_Node_Str",applicationId)).replace("String_Node_Str",applicationPolicyId);
    HttpResponse response=restClient.doPost(httpClient,restClient.getBaseURL() + url,"String_Node_Str");
    String responseCode="String_Node_Str" + response.getStatusLine().getStatusCode();
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.create();
    if (Integer.parseInt(responseCode) < 300 && Integer.parseInt(responseCode) >= 200) {
      System.out.println("String_Node_Str" + applicationId);
    }
 else {
      String resultString=CliUtils.getHttpResponseString(response);
      ExceptionMapper exception=gson.fromJson(resultString,ExceptionMapper.class);
      System.out.println(exception);
    }
  }
 catch (  Exception e) {
    String message="String_Node_Str" + applicationId;
    printError(message,e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
}

Fixed version (ground truth):
/** 
 * Deploy application
 * @param applicationId       application id
 * @param applicationPolicyId application policy id
 * @throws CommandException
 */
public void deployApplication(String applicationId,String applicationPolicyId) throws CommandException {
  DefaultHttpClient httpClient=new DefaultHttpClient();
  try {
    String url=(ENDPOINT_DEPLOY_APPLICATION.replace("String_Node_Str",applicationId)).replace("String_Node_Str",applicationPolicyId);
    HttpResponse response=restClient.doPost(httpClient,restClient.getBaseURL() + url,"String_Node_Str");
    String result=getHttpResponseString(response);
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.create();
    System.out.println(gson.fromJson(result,ResponseMessageBean.class).getMessage());
  }
 catch (  Exception e) {
    String message="String_Node_Str" + applicationId;
    printError(message,e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
}
Program: 115647
Project: 115647
Buggy source:
/** 
 * This will give the partition-context from the group-network-partition-context based on the selected algorithm where if parent has a partition-id, then that will be returned instead of parsing the algorithm
 * @param parentLevelNetworkPartitionContext the group-network-partition-context
 * @param parentPartitionId                 parent-partition-id
 * @return the partition-context
 */
private PartitionContext getPartitionContext(ParentLevelNetworkPartitionContext parentLevelNetworkPartitionContext,String parentPartitionId){
  PartitionContext partitionContext=null;
  List<GroupLevelPartitionContext> partitionContexts=parentLevelNetworkPartitionContext.getPartitionCtxts();
  GroupLevelPartitionContext[] groupLevelPartitionContexts=new GroupLevelPartitionContext[partitionContexts.size()];
  if (parentPartitionId == null) {
    if (!partitionContexts.isEmpty()) {
      PartitionAlgorithm algorithm=this.getAutoscaleAlgorithm(parentLevelNetworkPartitionContext.getPartitionAlgorithm());
      partitionContext=algorithm.getNextScaleUpPartitionContext((partitionContexts.toArray(groupLevelPartitionContexts)));
    }
  }
 else {
    partitionContext=parentLevelNetworkPartitionContext.getPartitionContextById(parentPartitionId);
  }
  return partitionContext;
}

Fixed version (ground truth):
/** 
 * This will give the partition-context from the group-network-partition-context based on the selected algorithm where if parent has a partition-id, then that will be returned instead of parsing the algorithm
 * @param parentLevelNetworkPartitionContext the group-network-partition-context
 * @param parentPartitionId                  parent-partition-id
 * @return the partition-context
 */
private PartitionContext getPartitionContext(ParentLevelNetworkPartitionContext parentLevelNetworkPartitionContext,String parentPartitionId){
  PartitionContext partitionContext=null;
  List<GroupLevelPartitionContext> partitionContexts=parentLevelNetworkPartitionContext.getPartitionCtxts();
  GroupLevelPartitionContext[] groupLevelPartitionContexts=new GroupLevelPartitionContext[partitionContexts.size()];
  if (parentPartitionId == null) {
    if (!partitionContexts.isEmpty()) {
      PartitionAlgorithm algorithm=this.getAutoscaleAlgorithm(parentLevelNetworkPartitionContext.getPartitionAlgorithm());
      partitionContext=algorithm.getNextScaleUpPartitionContext((partitionContexts.toArray(groupLevelPartitionContexts)));
    }
  }
 else {
    partitionContext=parentLevelNetworkPartitionContext.getPartitionContextById(parentPartitionId);
  }
  return partitionContext;
}
Program: 115648
Project: 115648
Buggy source:
/** 
 * Convert Persistence To PersistenceBean
 * @param baseDir base directory
 * @param directories directories
 * @return DeploymentBean
 */
private static DeploymentBean convertDeploymentToDeploymentBean(String[] directories,String baseDir){
  if (baseDir == null || directories == null || directories[0] == null) {
    return null;
  }
  DeploymentBean deploymentBean=new DeploymentBean();
  deploymentBean.setBaseDir(baseDir);
  deploymentBean.setDir(Arrays.asList(baseDir));
  return deploymentBean;
}

Fixed version (ground truth):
/** 
 * Convert Persistence To PersistenceBean
 * @param baseDir     base directory
 * @param directories directories
 * @return DeploymentBean
 */
private static DeploymentBean convertDeploymentToDeploymentBean(String[] directories,String baseDir){
  if (baseDir == null || directories == null || directories[0] == null) {
    return null;
  }
  DeploymentBean deploymentBean=new DeploymentBean();
  deploymentBean.setBaseDir(baseDir);
  deploymentBean.setDir(Arrays.asList(baseDir));
  return deploymentBean;
}
Program: 115649
Project: 115649
Buggy source:
/** 
 * Undeploy application
 * @param applicationId application id
 * @throws CommandException
 */
public void undeployApplication(String applicationId) throws CommandException {
  DefaultHttpClient httpClient=new DefaultHttpClient();
  try {
    HttpResponse response=restClient.doPost(httpClient,restClient.getBaseURL() + ENDPOINT_UNDEPLOY_APPLICATION.replace("String_Node_Str",applicationId),"String_Node_Str");
    String responseCode="String_Node_Str" + response.getStatusLine().getStatusCode();
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.create();
    if (Integer.parseInt(responseCode) < 300 && Integer.parseInt(responseCode) >= 200) {
      System.out.println("String_Node_Str" + applicationId);
    }
 else {
      String resultString=CliUtils.getHttpResponseString(response);
      ExceptionMapper exception=gson.fromJson(resultString,ExceptionMapper.class);
      System.out.println(exception);
    }
  }
 catch (  Exception e) {
    String message="String_Node_Str" + applicationId;
    printError(message,e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
}

Fixed version (ground truth):
/** 
 * Undeploy application
 * @param applicationId application id
 * @throws CommandException
 */
public void undeployApplication(String applicationId) throws CommandException {
  DefaultHttpClient httpClient=new DefaultHttpClient();
  try {
    HttpResponse response=restClient.doPost(httpClient,restClient.getBaseURL() + ENDPOINT_UNDEPLOY_APPLICATION.replace("String_Node_Str",applicationId),"String_Node_Str");
    String result=getHttpResponseString(response);
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.create();
    System.out.println(gson.fromJson(result,ResponseMessageBean.class).getMessage());
  }
 catch (  Exception e) {
    String message="String_Node_Str" + applicationId;
    printError(message,e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
}
Program: 115650
Project: 115650
Buggy source:
/** 
 * Deploy application
 * @param applicationId       application id
 * @param applicationPolicyId application policy id
 * @throws CommandException
 */
public void deployApplication(String applicationId,String applicationPolicyId) throws CommandException {
  DefaultHttpClient httpClient=new DefaultHttpClient();
  try {
    String url=(ENDPOINT_DEPLOY_APPLICATION.replace("String_Node_Str",applicationId)).replace("String_Node_Str",applicationPolicyId);
    HttpResponse response=restClient.doPost(httpClient,restClient.getBaseURL() + url,"String_Node_Str");
    String responseCode="String_Node_Str" + response.getStatusLine().getStatusCode();
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.create();
    if (Integer.parseInt(responseCode) < 300 && Integer.parseInt(responseCode) >= 200) {
      System.out.println("String_Node_Str" + applicationId);
    }
 else {
      String resultString=CliUtils.getHttpResponseString(response);
      ExceptionMapper exception=gson.fromJson(resultString,ExceptionMapper.class);
      System.out.println(exception);
    }
  }
 catch (  Exception e) {
    String message="String_Node_Str" + applicationId;
    printError(message,e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
}

Fixed version (ground truth):
/** 
 * Deploy application
 * @param applicationId       application id
 * @param applicationPolicyId application policy id
 * @throws CommandException
 */
public void deployApplication(String applicationId,String applicationPolicyId) throws CommandException {
  DefaultHttpClient httpClient=new DefaultHttpClient();
  try {
    String url=(ENDPOINT_DEPLOY_APPLICATION.replace("String_Node_Str",applicationId)).replace("String_Node_Str",applicationPolicyId);
    HttpResponse response=restClient.doPost(httpClient,restClient.getBaseURL() + url,"String_Node_Str");
    String result=getHttpResponseString(response);
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.create();
    System.out.println(gson.fromJson(result,ResponseMessageBean.class).getMessage());
  }
 catch (  Exception e) {
    String message="String_Node_Str" + applicationId;
    printError(message,e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
}
Program: 115651
Project: 115651
Buggy source:
/** 
 * Undeploy application
 * @param applicationId application id
 * @throws CommandException
 */
public void undeployApplication(String applicationId) throws CommandException {
  DefaultHttpClient httpClient=new DefaultHttpClient();
  try {
    HttpResponse response=restClient.doPost(httpClient,restClient.getBaseURL() + ENDPOINT_UNDEPLOY_APPLICATION.replace("String_Node_Str",applicationId),"String_Node_Str");
    String responseCode="String_Node_Str" + response.getStatusLine().getStatusCode();
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.create();
    if (Integer.parseInt(responseCode) < 300 && Integer.parseInt(responseCode) >= 200) {
      System.out.println("String_Node_Str" + applicationId);
    }
 else {
      String resultString=CliUtils.getHttpResponseString(response);
      ExceptionMapper exception=gson.fromJson(resultString,ExceptionMapper.class);
      System.out.println(exception);
    }
  }
 catch (  Exception e) {
    String message="String_Node_Str" + applicationId;
    printError(message,e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
}

Fixed version (ground truth):
/** 
 * Undeploy application
 * @param applicationId application id
 * @throws CommandException
 */
public void undeployApplication(String applicationId) throws CommandException {
  DefaultHttpClient httpClient=new DefaultHttpClient();
  try {
    HttpResponse response=restClient.doPost(httpClient,restClient.getBaseURL() + ENDPOINT_UNDEPLOY_APPLICATION.replace("String_Node_Str",applicationId),"String_Node_Str");
    String result=getHttpResponseString(response);
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.create();
    System.out.println(gson.fromJson(result,ResponseMessageBean.class).getMessage());
  }
 catch (  Exception e) {
    String message="String_Node_Str" + applicationId;
    printError(message,e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
}
Program: 115653
Project: 115653
Buggy source:
public void removeApplicationPolicyInInformationModel(String applicationId) throws InvalidPolicyException {
  if (applicationPolicyListMap.containsKey(applicationId)) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + applicationId);
    }
    applicationPolicyListMap.remove(applicationId);
  }
 else {
    throw new InvalidPolicyException("String_Node_Str" + applicationId + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void removeApplicationPolicyInInformationModel(String applicationPolicyId) throws InvalidPolicyException {
  if (applicationPolicyListMap.containsKey(applicationPolicyId)) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + applicationPolicyId);
    }
    applicationPolicyListMap.remove(applicationPolicyId);
  }
 else {
    throw new InvalidPolicyException(String.format("String_Node_Str",applicationPolicyId));
  }
}
Program: 115654
Project: 115654
Buggy source:
/** 
 * Update application policy
 * @param applicationPolicy Application Policy
 * @return 200 if application policies successfully updated
 * @throws RestAPIException
 */
@PUT @Path("String_Node_Str") @Produces("String_Node_Str") @Consumes("String_Node_Str") @AuthorizationAction("String_Node_Str") public Response updateApplicationPolicy(ApplicationPolicyBean applicationPolicy) throws RestAPIException {
  try {
    StratosApiV41Utils.updateApplicationPolicy(applicationPolicy);
  }
 catch (  AutoscalerServiceInvalidApplicationPolicyExceptionException e) {
    return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,"String_Node_Str")).build();
  }
catch (  AutoscalerServiceApplicatioinPolicyNotExistsExceptionException e) {
    return Response.status(Response.Status.NOT_FOUND).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,String.format("String_Node_Str",applicationPolicy.getId()))).build();
  }
  return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,String.format("String_Node_Str",applicationPolicy.getId()))).build();
}

Fixed version (ground truth):
/** 
 * Update application policy
 * @param applicationPolicy Application Policy
 * @return 200 if application policies successfully updated
 * @throws RestAPIException
 */
@PUT @Path("String_Node_Str") @Produces("String_Node_Str") @Consumes("String_Node_Str") @AuthorizationAction("String_Node_Str") public Response updateApplicationPolicy(ApplicationPolicyBean applicationPolicy) throws RestAPIException {
  try {
    StratosApiV41Utils.updateApplicationPolicy(applicationPolicy);
  }
 catch (  AutoscalerServiceInvalidApplicationPolicyExceptionException e) {
    String backendErrorMessage=e.getFaultMessage().getInvalidApplicationPolicyException().getMessage();
    return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,backendErrorMessage)).build();
  }
catch (  AutoscalerServiceApplicatioinPolicyNotExistsExceptionException e) {
    return Response.status(Response.Status.NOT_FOUND).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,String.format("String_Node_Str",applicationPolicy.getId()))).build();
  }
  return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,String.format("String_Node_Str",applicationPolicy.getId()))).build();
}
Program: 115655
Project: 115655
Buggy source:
/** 
 * Adds an application policy
 * @param applicationPolicy Application Policy
 * @return 201 if the application policy is successfully added
 * @throws RestAPIException
 */
@POST @Path("String_Node_Str") @Produces("String_Node_Str") @Consumes("String_Node_Str") @AuthorizationAction("String_Node_Str") public Response addApplicationPolicy(ApplicationPolicyBean applicationPolicy) throws RestAPIException {
  try {
    StratosApiV41Utils.addApplicationPolicy(applicationPolicy);
    URI url=uriInfo.getAbsolutePathBuilder().path(applicationPolicy.getId()).build();
    return Response.created(url).entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,String.format("String_Node_Str",applicationPolicy.getId()))).build();
  }
 catch (  AutoscalerServiceInvalidApplicationPolicyExceptionException e) {
    return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,"String_Node_Str")).build();
  }
catch (  AutoscalerServiceApplicationPolicyAlreadyExistsExceptionException e) {
    return Response.status(Response.Status.CONFLICT).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,"String_Node_Str")).build();
  }
catch (  RestAPIException e) {
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * Adds an application policy
 * @param applicationPolicy Application Policy
 * @return 201 if the application policy is successfully added
 * @throws RestAPIException
 */
@POST @Path("String_Node_Str") @Produces("String_Node_Str") @Consumes("String_Node_Str") @AuthorizationAction("String_Node_Str") public Response addApplicationPolicy(ApplicationPolicyBean applicationPolicy) throws RestAPIException {
  try {
    StratosApiV41Utils.addApplicationPolicy(applicationPolicy);
    URI url=uriInfo.getAbsolutePathBuilder().path(applicationPolicy.getId()).build();
    return Response.created(url).entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,String.format("String_Node_Str",applicationPolicy.getId()))).build();
  }
 catch (  AutoscalerServiceInvalidApplicationPolicyExceptionException e) {
    String backendErrorMessage=e.getFaultMessage().getInvalidApplicationPolicyException().getMessage();
    return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,backendErrorMessage)).build();
  }
catch (  AutoscalerServiceApplicationPolicyAlreadyExistsExceptionException e) {
    return Response.status(Response.Status.CONFLICT).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,"String_Node_Str")).build();
  }
catch (  RestAPIException e) {
    throw e;
  }
}
Program: 115656
Project: 115656
Buggy source:
/** 
 * Remove specified application policy
 * @param applicationPolicyId Application Policy Id
 * @return 200 if application policy is successfully removed
 * @throws RestAPIException
 */
@DELETE @Path("String_Node_Str") @Produces("String_Node_Str") @Consumes("String_Node_Str") @AuthorizationAction("String_Node_Str") public Response removeApplicationPolicy(@PathParam("String_Node_Str") String applicationPolicyId) throws RestAPIException {
  try {
    StratosApiV41Utils.removeApplicationPolicy(applicationPolicyId);
    return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,String.format("String_Node_Str",applicationPolicyId))).build();
  }
 catch (  ApplicationPolicyIdIsEmptyException e) {
    return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,"String_Node_Str")).build();
  }
catch (  AutoscalerServiceInvalidPolicyExceptionException e) {
    return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,"String_Node_Str")).build();
  }
}

Fixed version (ground truth):
/** 
 * Remove specified application policy
 * @param applicationPolicyId Application Policy Id
 * @return 200 if application policy is successfully removed
 * @throws RestAPIException
 */
@DELETE @Path("String_Node_Str") @Produces("String_Node_Str") @Consumes("String_Node_Str") @AuthorizationAction("String_Node_Str") public Response removeApplicationPolicy(@PathParam("String_Node_Str") String applicationPolicyId) throws RestAPIException {
  try {
    StratosApiV41Utils.removeApplicationPolicy(applicationPolicyId);
    return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,String.format("String_Node_Str",applicationPolicyId))).build();
  }
 catch (  ApplicationPolicyIdIsEmptyException e) {
    return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,"String_Node_Str")).build();
  }
catch (  AutoscalerServiceInvalidPolicyExceptionException e) {
    String backendErrorMessage=e.getFaultMessage().getInvalidPolicyException().getMessage();
    return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,backendErrorMessage)).build();
  }
}
Program: 115657
Project: 115657
Buggy source:
/** 
 * Add user
 * @param userName    username
 * @param credential  password
 * @param role        user role
 * @param firstName   first name
 * @param lastName    last name
 * @param email       email
 * @param profileName profile name
 * @throws CommandException
 */
public void addUser(String userName,String credential,String role,String firstName,String lastName,String email,String profileName) throws CommandException {
  DefaultHttpClient httpClient=new DefaultHttpClient();
  try {
    UserInfoBean userInfoBean=new UserInfoBean();
    userInfoBean.setUserName(userName);
    userInfoBean.setCredential(credential);
    userInfoBean.setRole(role);
    userInfoBean.setFirstName(firstName);
    userInfoBean.setLastName(lastName);
    userInfoBean.setEmail(email);
    userInfoBean.setProfileName(profileName);
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.create();
    String jsonString=gson.toJson(userInfoBean,UserInfoBean.class);
    HttpResponse response=restClient.doPost(httpClient,restClient.getBaseURL() + ENDPOINT_ADD_USER,jsonString);
    int responseCode=response.getStatusLine().getStatusCode();
    if (responseCode < 200 || responseCode >= 300) {
      CliUtils.printError(response);
    }
 else {
      System.out.println("String_Node_Str" + userName);
    }
  }
 catch (  Exception e) {
    String message="String_Node_Str" + userName;
    printError(message,e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
}

Fixed version (ground truth):
/** 
 * Add user
 * @param userName    username
 * @param credential  password
 * @param role        user role
 * @param firstName   first name
 * @param lastName    last name
 * @param email       email
 * @param profileName profile name
 * @throws CommandException
 */
public void addUser(String userName,String credential,String role,String firstName,String lastName,String email,String profileName) throws CommandException {
  DefaultHttpClient httpClient=new DefaultHttpClient();
  try {
    UserInfoBean userInfoBean=new UserInfoBean();
    userInfoBean.setUserName(userName);
    userInfoBean.setCredential(credential);
    userInfoBean.setRole(role);
    userInfoBean.setFirstName(firstName);
    userInfoBean.setLastName(lastName);
    userInfoBean.setEmail(email);
    userInfoBean.setProfileName(profileName);
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.create();
    String jsonString=gson.toJson(userInfoBean,UserInfoBean.class);
    HttpResponse response=restClient.doPost(httpClient,restClient.getBaseURL() + ENDPOINT_ADD_USER,jsonString);
    String result=getHttpResponseString(response);
    System.out.println(gson.fromJson(result,ResponseMessageBean.class).getMessage());
  }
 catch (  Exception e) {
    String message="String_Node_Str" + userName;
    printError(message,e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
}
Program: 115658
Project: 115658
Buggy source:
/** 
 * Add a user to the user-store of the particular tenant
 * @param userStoreManager UserStoreManager
 * @param userInfoBean     UserInfoBean
 * @throws UserManagerException
 */
public static void addUser(UserStoreManager userStoreManager,UserInfoBean userInfoBean) throws UserManagerException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + userInfoBean.getUserName());
  }
  String[] roles=new String[1];
  roles[0]=userInfoBean.getRole();
  Map<String,String> claims=new HashMap<String,String>();
  claims.put(UserCoreConstants.ClaimTypeURIs.EMAIL_ADDRESS,userInfoBean.getEmail());
  claims.put(UserCoreConstants.ClaimTypeURIs.GIVEN_NAME,userInfoBean.getFirstName());
  claims.put(UserCoreConstants.ClaimTypeURIs.SURNAME,userInfoBean.getLastName());
  try {
    userStoreManager.addUser(userInfoBean.getUserName(),userInfoBean.getCredential(),roles,claims,userInfoBean.getProfileName());
  }
 catch (  UserStoreException e) {
    String msg="String_Node_Str" + userInfoBean.getUserName() + "String_Node_Str";
    log.error(msg,e);
    throw new UserManagerException(msg,e);
  }
}

Fixed version (ground truth):
/** 
 * Add a user to the user-store of the particular tenant
 * @param userStoreManager UserStoreManager
 * @param userInfoBean     UserInfoBean
 * @throws UserManagerException
 */
public static void addUser(UserStoreManager userStoreManager,UserInfoBean userInfoBean) throws UserManagerException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + userInfoBean.getUserName());
  }
  String[] roles=new String[1];
  roles[0]=userInfoBean.getRole();
  Map<String,String> claims=new HashMap<String,String>();
  claims.put(UserCoreConstants.ClaimTypeURIs.EMAIL_ADDRESS,userInfoBean.getEmail());
  claims.put(UserCoreConstants.ClaimTypeURIs.GIVEN_NAME,userInfoBean.getFirstName());
  claims.put(UserCoreConstants.ClaimTypeURIs.SURNAME,userInfoBean.getLastName());
  try {
    userStoreManager.addUser(userInfoBean.getUserName(),userInfoBean.getCredential(),roles,claims,userInfoBean.getProfileName());
  }
 catch (  UserStoreException e) {
    String msg="String_Node_Str" + userInfoBean.getUserName() + "String_Node_Str";
    log.error(msg,e);
    throw new UserManagerException(e.getMessage());
  }
}
Program: 115659
Project: 115659
Buggy source:
/** 
 * Adds an User
 * @param userInfoBean User Info
 * @throws RestAPIException
 */
public static void addUser(UserInfoBean userInfoBean) throws RestAPIException {
  try {
    StratosUserManagerUtils.addUser(getTenantUserStoreManager(),userInfoBean);
  }
 catch (  UserManagerException e) {
    String msg="String_Node_Str";
    log.error(msg,e);
    throw new RestAPIException(msg,e);
  }
}

Fixed version (ground truth):
/** 
 * Adds an User
 * @param userInfoBean User Info
 * @throws RestAPIException
 */
public static void addUser(UserInfoBean userInfoBean) throws RestAPIException {
  try {
    StratosUserManagerUtils.addUser(getTenantUserStoreManager(),userInfoBean);
  }
 catch (  UserManagerException e) {
    String msg="String_Node_Str";
    log.error(msg,e);
    throw new RestAPIException(e.getMessage());
  }
}
Program: 115660
Project: 115660
Buggy source:
public ApplicationLevelNetworkPartitionContext(String id){
  super(id);
}

Fixed version (ground truth):
public ApplicationLevelNetworkPartitionContext(String id){
  super(id);
  pendingInstances=new ArrayList<InstanceContext>();
  activeInstances=new ArrayList<InstanceContext>();
  terminatingPending=new ArrayList<InstanceContext>();
}
Program: 115661
Project: 115661
Buggy source:
/** 
 * Add user
 * @param userName    username
 * @param credential  password
 * @param role        user role
 * @param firstName   first name
 * @param lastName    last name
 * @param email       email
 * @param profileName profile name
 * @throws CommandException
 */
public void addUser(String userName,String credential,String role,String firstName,String lastName,String email,String profileName) throws CommandException {
  DefaultHttpClient httpClient=new DefaultHttpClient();
  try {
    UserInfoBean userInfoBean=new UserInfoBean();
    userInfoBean.setUserName(userName);
    userInfoBean.setCredential(credential);
    userInfoBean.setRole(role);
    userInfoBean.setFirstName(firstName);
    userInfoBean.setLastName(lastName);
    userInfoBean.setEmail(email);
    userInfoBean.setProfileName(profileName);
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.create();
    String jsonString=gson.toJson(userInfoBean,UserInfoBean.class);
    HttpResponse response=restClient.doPost(httpClient,restClient.getBaseURL() + ENDPOINT_ADD_USER,jsonString);
    int responseCode=response.getStatusLine().getStatusCode();
    if (responseCode < 200 || responseCode >= 300) {
      CliUtils.printError(response);
    }
 else {
      System.out.println("String_Node_Str" + userName);
    }
  }
 catch (  Exception e) {
    String message="String_Node_Str" + userName;
    printError(message,e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
}

Fixed version (ground truth):
/** 
 * Add user
 * @param userName    username
 * @param credential  password
 * @param role        user role
 * @param firstName   first name
 * @param lastName    last name
 * @param email       email
 * @param profileName profile name
 * @throws CommandException
 */
public void addUser(String userName,String credential,String role,String firstName,String lastName,String email,String profileName) throws CommandException {
  DefaultHttpClient httpClient=new DefaultHttpClient();
  try {
    UserInfoBean userInfoBean=new UserInfoBean();
    userInfoBean.setUserName(userName);
    userInfoBean.setCredential(credential);
    userInfoBean.setRole(role);
    userInfoBean.setFirstName(firstName);
    userInfoBean.setLastName(lastName);
    userInfoBean.setEmail(email);
    userInfoBean.setProfileName(profileName);
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.create();
    String jsonString=gson.toJson(userInfoBean,UserInfoBean.class);
    HttpResponse response=restClient.doPost(httpClient,restClient.getBaseURL() + ENDPOINT_ADD_USER,jsonString);
    String result=getHttpResponseString(response);
    System.out.println(gson.fromJson(result,ResponseMessageBean.class).getMessage());
  }
 catch (  Exception e) {
    String message="String_Node_Str" + userName;
    printError(message,e);
  }
 finally {
    httpClient.getConnectionManager().shutdown();
  }
}
Program: 115662
Project: 115662
Buggy source:
/** 
 * Add a user to the user-store of the particular tenant
 * @param userStoreManager UserStoreManager
 * @param userInfoBean     UserInfoBean
 * @throws UserManagerException
 */
public static void addUser(UserStoreManager userStoreManager,UserInfoBean userInfoBean) throws UserManagerException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + userInfoBean.getUserName());
  }
  String[] roles=new String[1];
  roles[0]=userInfoBean.getRole();
  Map<String,String> claims=new HashMap<String,String>();
  claims.put(UserCoreConstants.ClaimTypeURIs.EMAIL_ADDRESS,userInfoBean.getEmail());
  claims.put(UserCoreConstants.ClaimTypeURIs.GIVEN_NAME,userInfoBean.getFirstName());
  claims.put(UserCoreConstants.ClaimTypeURIs.SURNAME,userInfoBean.getLastName());
  try {
    userStoreManager.addUser(userInfoBean.getUserName(),userInfoBean.getCredential(),roles,claims,userInfoBean.getProfileName());
  }
 catch (  UserStoreException e) {
    String msg="String_Node_Str" + userInfoBean.getUserName() + "String_Node_Str";
    log.error(msg,e);
    throw new UserManagerException(msg,e);
  }
}

Fixed version (ground truth):
/** 
 * Add a user to the user-store of the particular tenant
 * @param userStoreManager UserStoreManager
 * @param userInfoBean     UserInfoBean
 * @throws UserManagerException
 */
public static void addUser(UserStoreManager userStoreManager,UserInfoBean userInfoBean) throws UserManagerException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + userInfoBean.getUserName());
  }
  String[] roles=new String[1];
  roles[0]=userInfoBean.getRole();
  Map<String,String> claims=new HashMap<String,String>();
  claims.put(UserCoreConstants.ClaimTypeURIs.EMAIL_ADDRESS,userInfoBean.getEmail());
  claims.put(UserCoreConstants.ClaimTypeURIs.GIVEN_NAME,userInfoBean.getFirstName());
  claims.put(UserCoreConstants.ClaimTypeURIs.SURNAME,userInfoBean.getLastName());
  try {
    userStoreManager.addUser(userInfoBean.getUserName(),userInfoBean.getCredential(),roles,claims,userInfoBean.getProfileName());
  }
 catch (  UserStoreException e) {
    String msg="String_Node_Str" + userInfoBean.getUserName() + "String_Node_Str";
    log.error(msg,e);
    throw new UserManagerException(e.getMessage());
  }
}
Program: 115663
Project: 115663
Buggy source:
/** 
 * Adds an User
 * @param userInfoBean User Info
 * @throws RestAPIException
 */
public static void addUser(UserInfoBean userInfoBean) throws RestAPIException {
  try {
    StratosUserManagerUtils.addUser(getTenantUserStoreManager(),userInfoBean);
  }
 catch (  UserManagerException e) {
    String msg="String_Node_Str";
    log.error(msg,e);
    throw new RestAPIException(msg,e);
  }
}

Fixed version (ground truth):
/** 
 * Adds an User
 * @param userInfoBean User Info
 * @throws RestAPIException
 */
public static void addUser(UserInfoBean userInfoBean) throws RestAPIException {
  try {
    StratosUserManagerUtils.addUser(getTenantUserStoreManager(),userInfoBean);
  }
 catch (  UserManagerException e) {
    String msg="String_Node_Str";
    log.error(msg,e);
    throw new RestAPIException(e.getMessage());
  }
}