nus-yam/ex-repair huggingface dataset:
Program: 105249
Project: 105249
Buggy source:
private String sendRequestPrim(PrintWriter sendStream,BufferedReader recvStream,String xmlRequest) throws ExecutionException {
  if (!xmlRequest.contains("String_Node_Str")) {
    s_logger.debug("String_Node_Str" + xmlRequest);
  }
 else {
    s_logger.debug("String_Node_Str");
  }
  boolean timedOut=false;
  StringBuffer xmlResponseBuffer=new StringBuffer("String_Node_Str");
  try {
    sendStream.write(xmlRequest);
    sendStream.flush();
    String line="String_Node_Str";
    while ((line=recvStream.readLine()) != null) {
      xmlResponseBuffer.append(line);
      if (line.contains("String_Node_Str")) {
        break;
      }
    }
  }
 catch (  SocketTimeoutException e) {
    s_logger.debug(e);
    timedOut=true;
  }
catch (  IOException e) {
    s_logger.debug(e);
    return null;
  }
  String xmlResponse=xmlResponseBuffer.toString();
  String errorMsg=null;
  if (timedOut) {
    errorMsg="String_Node_Str" + xmlRequest;
  }
 else   if (xmlResponse.isEmpty()) {
    errorMsg="String_Node_Str";
  }
 else   if (xmlResponse.contains("String_Node_Str")) {
    errorMsg="String_Node_Str";
  }
 else   if (!xmlResponse.contains("String_Node_Str")) {
    errorMsg="String_Node_Str";
  }
  if (errorMsg == null) {
    return xmlResponse;
  }
 else {
    s_logger.error(errorMsg);
    throw new ExecutionException(errorMsg);
  }
}

Fixed version (ground truth):
private String sendRequestPrim(BufferedWriter sendStream,BufferedReader recvStream,String xmlRequest) throws ExecutionException {
  if (!xmlRequest.contains("String_Node_Str")) {
    s_logger.debug("String_Node_Str" + xmlRequest);
  }
 else {
    s_logger.debug("String_Node_Str");
  }
  boolean timedOut=false;
  StringBuffer xmlResponseBuffer=new StringBuffer("String_Node_Str");
  try {
    sendStream.write(xmlRequest);
    sendStream.flush();
    String line="String_Node_Str";
    while ((line=recvStream.readLine()) != null) {
      xmlResponseBuffer.append(line);
      if (line.contains("String_Node_Str")) {
        break;
      }
    }
  }
 catch (  SocketTimeoutException e) {
    s_logger.debug(e);
    timedOut=true;
  }
catch (  IOException e) {
    s_logger.debug(e);
    return null;
  }
  String xmlResponse=xmlResponseBuffer.toString();
  String errorMsg=null;
  if (timedOut) {
    errorMsg="String_Node_Str" + xmlRequest;
  }
 else   if (xmlResponse.isEmpty()) {
    errorMsg="String_Node_Str";
  }
 else   if (xmlResponse.contains("String_Node_Str")) {
    errorMsg="String_Node_Str";
  }
 else   if (!xmlResponse.contains("String_Node_Str")) {
    errorMsg="String_Node_Str";
  }
  if (errorMsg == null) {
    return xmlResponse;
  }
 else {
    s_logger.error(errorMsg);
    throw new ExecutionException(errorMsg);
  }
}
Program: 105250
Project: 105250
Buggy source:
private boolean openUsageSocket() throws ExecutionException {
  try {
    Socket s=new Socket(_ip,3221);
    s.setKeepAlive(true);
    s.setSoTimeout(_timeoutInSeconds * 1000);
    _UsagetoSrx=new PrintWriter(s.getOutputStream(),true);
    _UsagefromSrx=new BufferedReader(new InputStreamReader(s.getInputStream()));
    return usageLogin();
  }
 catch (  IOException e) {
    s_logger.error(e);
    return false;
  }
}

Fixed version (ground truth):
private boolean openUsageSocket() throws ExecutionException {
  try {
    Socket s=new Socket(_ip,3221);
    s.setKeepAlive(true);
    s.setSoTimeout(_timeoutInSeconds * 1000);
    _UsagetoSrx=new BufferedWriter(new OutputStreamWriter(s.getOutputStream(),"String_Node_Str"));
    _UsagefromSrx=new BufferedReader(new InputStreamReader(s.getInputStream(),"String_Node_Str"));
    return usageLogin();
  }
 catch (  IOException e) {
    s_logger.error(e);
    return false;
  }
}
Program: 105252
Project: 105252
Buggy source:
@Override public boolean initialize(){
  assert(_transportProvider != null);
  if (_transportProvider == null)   return false;
  TransportEndpointSite endpointSite=_transportProvider.attach(_transportEndpoint,"String_Node_Str");
  endpointSite.registerMultiplexier(RPC_MULTIPLEXIER,this);
  return true;
}

Fixed version (ground truth):
@Override public boolean initialize(){
  if (_transportProvider == null)   return false;
  TransportEndpointSite endpointSite=_transportProvider.attach(_transportEndpoint,"String_Node_Str");
  endpointSite.registerMultiplexier(RPC_MULTIPLEXIER,this);
  return true;
}
Program: 105253
Project: 105253
Buggy source:
private long[] getNetworkStats(String privateIP){
  String result=networkUsage(privateIP,"String_Node_Str",null);
  long[] stats=new long[2];
  if (result != null) {
    try {
      String[] splitResult=result.split("String_Node_Str");
      int i=0;
      while (i < splitResult.length - 1) {
        stats[0]+=(new Long(splitResult[i++])).longValue();
        stats[1]+=(new Long(splitResult[i++])).longValue();
      }
    }
 catch (    Throwable e) {
      s_logger.warn("String_Node_Str" + e.toString(),e);
    }
  }
  return stats;
}

Fixed version (ground truth):
private long[] getNetworkStats(String privateIP){
  String result=networkUsage(privateIP,"String_Node_Str",null);
  long[] stats=new long[2];
  if (result != null) {
    try {
      String[] splitResult=result.split("String_Node_Str");
      int i=0;
      while (i < splitResult.length - 1) {
        stats[0]+=Long.parseLong(splitResult[i++]);
        stats[1]+=Long.parseLong(splitResult[i++]);
      }
    }
 catch (    Throwable e) {
      s_logger.warn("String_Node_Str" + e.toString(),e);
    }
  }
  return stats;
}
Program: 105254
Project: 105254
Buggy source:
public String getDetail(String name){
}

Fixed version (ground truth):
public String getDetail(String name){
  return details != null ? details.get(name) : null;
}
Program: 105255
Project: 105255
Buggy source:
public static String getDhcpRange(final String cidr){
  final String[] splitResult=cidr.split("String_Node_Str");
  final long size=Long.valueOf(splitResult[1]);
  return NetUtils.getIpRangeStartIpFromCidr(splitResult[0],size);
}

Fixed version (ground truth):
public static String getDhcpRange(final String cidr){
  final String[] splitResult=cidr.split("String_Node_Str");
  final long size=Long.parseLong(splitResult[1]);
  return NetUtils.getIpRangeStartIpFromCidr(splitResult[0],size);
}
Program: 105256
Project: 105256
Buggy source:
public static UpdateTsmStorageCmdResponse updateElastistorTsmStorage(String capacityBytes,String uuid) throws Throwable {
  Long size=(Long.valueOf(capacityBytes) / (1024 * 1024 * 1024));
  String quotasize=null;
  if (size > 1024) {
    quotasize=(String.valueOf(Long.valueOf(capacityBytes) / (1024)) + "String_Node_Str");
  }
 else {
    quotasize=String.valueOf(quotasize) + "String_Node_Str";
  }
  s_logger.info("String_Node_Str" + quotasize);
  UpdateTsmStorageCmd updateTsmStorageCmd=new UpdateTsmStorageCmd();
  updateTsmStorageCmd.putCommandParameter("String_Node_Str",uuid);
  updateTsmStorageCmd.putCommandParameter("String_Node_Str",quotasize);
  UpdateTsmStorageCmdResponse updateTsmStorageCmdResponse=(UpdateTsmStorageCmdResponse)getElastistorRestClient().executeCommand(updateTsmStorageCmd);
  return updateTsmStorageCmdResponse;
}

Fixed version (ground truth):
public static UpdateTsmStorageCmdResponse updateElastistorTsmStorage(String capacityBytes,String uuid) throws Throwable {
  Long size=(Long.parseLong(capacityBytes) / (1024 * 1024 * 1024));
  String quotasize=null;
  if (size > 1024) {
    quotasize=(String.valueOf(Long.valueOf(capacityBytes) / (1024)) + "String_Node_Str");
  }
 else {
    quotasize=String.valueOf(quotasize) + "String_Node_Str";
  }
  s_logger.info("String_Node_Str" + quotasize);
  UpdateTsmStorageCmd updateTsmStorageCmd=new UpdateTsmStorageCmd();
  updateTsmStorageCmd.putCommandParameter("String_Node_Str",uuid);
  updateTsmStorageCmd.putCommandParameter("String_Node_Str",quotasize);
  UpdateTsmStorageCmdResponse updateTsmStorageCmdResponse=(UpdateTsmStorageCmdResponse)getElastistorRestClient().executeCommand(updateTsmStorageCmd);
  return updateTsmStorageCmdResponse;
}
Program: 105257
Project: 105257
Buggy source:
public static UpdateTsmCmdResponse updateElastistorTsmIOPS(String capacityIOPs,String uuid) throws Throwable {
  s_logger.info("String_Node_Str" + capacityIOPs);
  UpdateTsmCmd updateTsmCmd=new UpdateTsmCmd();
  String throughput=String.valueOf(Long.valueOf(capacityIOPs) * 4);
  updateTsmCmd.putCommandParameter("String_Node_Str",uuid);
  updateTsmCmd.putCommandParameter("String_Node_Str",capacityIOPs);
  updateTsmCmd.putCommandParameter("String_Node_Str",throughput);
  UpdateTsmCmdResponse updateTsmStorageCmdResponse=(UpdateTsmCmdResponse)getElastistorRestClient().executeCommand(updateTsmCmd);
  return updateTsmStorageCmdResponse;
}

Fixed version (ground truth):
public static UpdateTsmCmdResponse updateElastistorTsmIOPS(String capacityIOPs,String uuid) throws Throwable {
  s_logger.info("String_Node_Str" + capacityIOPs);
  UpdateTsmCmd updateTsmCmd=new UpdateTsmCmd();
  String throughput=String.valueOf(Long.parseLong(capacityIOPs) * 4);
  updateTsmCmd.putCommandParameter("String_Node_Str",uuid);
  updateTsmCmd.putCommandParameter("String_Node_Str",capacityIOPs);
  updateTsmCmd.putCommandParameter("String_Node_Str",throughput);
  UpdateTsmCmdResponse updateTsmStorageCmdResponse=(UpdateTsmCmdResponse)getElastistorRestClient().executeCommand(updateTsmCmd);
  return updateTsmStorageCmdResponse;
}
Program: 105259
Project: 105259
Buggy source:
public String getDetail(String name){
}

Fixed version (ground truth):
public String getDetail(String name){
  return details != null ? details.get(name) : null;
}
Program: 105262
Project: 105262
Buggy source:
private String getPrivateSubnet(String vlan) throws ExecutionException {
  String _interfaceName=genPrivateInterfaceName(Long.valueOf(vlan).longValue());
  Map<String,String> params=new HashMap<String,String>();
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str" + _privateInterfaceType + "String_Node_Str"+ _privateInterface+ "String_Node_Str"+ _interfaceName+ "String_Node_Str");
  String response=request(PaloAltoMethod.GET,params);
  if (validResponse(response) && responseNotEmpty(response)) {
    NodeList response_body;
    Document doc=getDocument(response);
    XPath xpath=XPathFactory.newInstance().newXPath();
    try {
      XPathExpression expr=xpath.compile("String_Node_Str");
      response_body=(NodeList)expr.evaluate(doc,XPathConstants.NODESET);
    }
 catch (    XPathExpressionException e) {
      throw new ExecutionException(e.getCause().getMessage());
    }
    if (response_body.getLength() > 0) {
      return response_body.item(0).getAttributes().getNamedItem("String_Node_Str").getTextContent();
    }
  }
  return null;
}

Fixed version (ground truth):
private String getPrivateSubnet(String vlan) throws ExecutionException {
  String _interfaceName=genPrivateInterfaceName(Long.parseLong(vlan));
  Map<String,String> params=new HashMap<String,String>();
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str" + _privateInterfaceType + "String_Node_Str"+ _privateInterface+ "String_Node_Str"+ _interfaceName+ "String_Node_Str");
  String response=request(PaloAltoMethod.GET,params);
  if (validResponse(response) && responseNotEmpty(response)) {
    NodeList response_body;
    Document doc=getDocument(response);
    XPath xpath=XPathFactory.newInstance().newXPath();
    try {
      XPathExpression expr=xpath.compile("String_Node_Str");
      response_body=(NodeList)expr.evaluate(doc,XPathConstants.NODESET);
    }
 catch (    XPathExpressionException e) {
      throw new ExecutionException(e.getCause().getMessage());
    }
    if (response_body.getLength() > 0) {
      return response_body.item(0).getAttributes().getNamedItem("String_Node_Str").getTextContent();
    }
  }
  return null;
}
Program: 105263
Project: 105263
Buggy source:
public String getDetail(String name){
}

Fixed version (ground truth):
public String getDetail(String name){
  return details != null ? details.get(name) : null;
}
Program: 105264
Project: 105264
Buggy source:
protected String getNetworkLabelFromConfig(Connection conn,String name){
  String sql="String_Node_Str" + name + "String_Node_Str";
  String networkLabel=null;
  PreparedStatement pstmt=null;
  ResultSet rs=null;
  try {
    pstmt=conn.prepareStatement(sql);
    rs=pstmt.executeQuery();
    if (rs.next()) {
      networkLabel=rs.getString(1);
    }
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str",e);
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException e) {
      }
    }
    if (pstmt != null) {
      try {
        pstmt.close();
      }
 catch (      SQLException e) {
      }
    }
  }
  return networkLabel;
}

Fixed version (ground truth):
protected String getNetworkLabelFromConfig(Connection conn,String name){
  String sql="String_Node_Str";
  String networkLabel=null;
  PreparedStatement pstmt=null;
  ResultSet rs=null;
  try {
    pstmt=conn.prepareStatement(sql);
    pstmt.setString(1,name);
    rs=pstmt.executeQuery();
    if (rs.next()) {
      networkLabel=rs.getString(1);
    }
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str",e);
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException e) {
      }
    }
    if (pstmt != null) {
      try {
        pstmt.close();
      }
 catch (      SQLException e) {
      }
    }
  }
  return networkLabel;
}
Program: 105266
Project: 105266
Buggy source:
@Override public boolean configure(final String name,final Map<String,Object> params) throws ConfigurationException {
  Map<String,String> configs=_configDao.getConfiguration(params);
  _invitationRequired=Boolean.valueOf(configs.get(Config.ProjectInviteRequired.key()));
  String value=configs.get(Config.ProjectInvitationExpirationTime.key());
  _invitationTimeOut=Long.valueOf(value != null ? value : "String_Node_Str") * 1000;
  _allowUserToCreateProject=Boolean.valueOf(configs.get(Config.AllowUserToCreateProject.key()));
  String smtpHost=configs.get("String_Node_Str");
  int smtpPort=NumbersUtil.parseInt(configs.get("String_Node_Str"),25);
  String useAuthStr=configs.get("String_Node_Str");
  boolean useAuth=((useAuthStr == null) ? false : Boolean.parseBoolean(useAuthStr));
  String smtpUsername=configs.get("String_Node_Str");
  String smtpPassword=configs.get("String_Node_Str");
  String emailSender=configs.get("String_Node_Str");
  String smtpDebugStr=configs.get("String_Node_Str");
  boolean smtpDebug=false;
  if (smtpDebugStr != null) {
    smtpDebug=Boolean.parseBoolean(smtpDebugStr);
  }
  _emailInvite=new EmailInvite(smtpHost,smtpPort,useAuth,smtpUsername,smtpPassword,emailSender,smtpDebug);
  _executor=Executors.newScheduledThreadPool(1,new NamedThreadFactory("String_Node_Str"));
  return true;
}

Fixed version (ground truth):
@Override public boolean configure(final String name,final Map<String,Object> params) throws ConfigurationException {
  Map<String,String> configs=_configDao.getConfiguration(params);
  _invitationRequired=Boolean.valueOf(configs.get(Config.ProjectInviteRequired.key()));
  String value=configs.get(Config.ProjectInvitationExpirationTime.key());
  _invitationTimeOut=Long.parseLong(value != null ? value : "String_Node_Str") * 1000;
  _allowUserToCreateProject=Boolean.valueOf(configs.get(Config.AllowUserToCreateProject.key()));
  String smtpHost=configs.get("String_Node_Str");
  int smtpPort=NumbersUtil.parseInt(configs.get("String_Node_Str"),25);
  String useAuthStr=configs.get("String_Node_Str");
  boolean useAuth=((useAuthStr == null) ? false : Boolean.parseBoolean(useAuthStr));
  String smtpUsername=configs.get("String_Node_Str");
  String smtpPassword=configs.get("String_Node_Str");
  String emailSender=configs.get("String_Node_Str");
  String smtpDebugStr=configs.get("String_Node_Str");
  boolean smtpDebug=false;
  if (smtpDebugStr != null) {
    smtpDebug=Boolean.parseBoolean(smtpDebugStr);
  }
  _emailInvite=new EmailInvite(smtpHost,smtpPort,useAuth,smtpUsername,smtpPassword,emailSender,smtpDebug);
  _executor=Executors.newScheduledThreadPool(1,new NamedThreadFactory("String_Node_Str"));
  return true;
}
Program: 105269
Project: 105269
Buggy source:
public String generateVnetString(List<String> vnetList){
  Collections.sort(vnetList,new Comparator<String>(){
    @Override public int compare(    String s1,    String s2){
      return Integer.valueOf(s1).compareTo(Integer.valueOf(s2));
    }
  }
);
  int i;
  String vnetRange="String_Node_Str";
  String startvnet=vnetList.get(0);
  String endvnet="String_Node_Str";
  for (i=0; i < vnetList.size() - 1; i++) {
    if (Integer.valueOf(vnetList.get(i + 1)) - Integer.valueOf(vnetList.get(i)) > 1) {
      endvnet=vnetList.get(i);
      vnetRange=vnetRange + startvnet + "String_Node_Str"+ endvnet+ "String_Node_Str";
      startvnet=vnetList.get(i + 1);
    }
  }
  endvnet=vnetList.get(vnetList.size() - 1);
  vnetRange=vnetRange + startvnet + "String_Node_Str"+ endvnet+ "String_Node_Str";
  vnetRange=vnetRange.substring(0,vnetRange.length() - 1);
  return vnetRange;
}

Fixed version (ground truth):
public String generateVnetString(List<String> vnetList){
  Collections.sort(vnetList,new Comparator<String>(){
    @Override public int compare(    String s1,    String s2){
      return Integer.valueOf(s1).compareTo(Integer.valueOf(s2));
    }
  }
);
  int i;
  String vnetRange="String_Node_Str";
  String startvnet=vnetList.get(0);
  String endvnet="String_Node_Str";
  for (i=0; i < vnetList.size() - 1; i++) {
    if (Integer.parseInt(vnetList.get(i + 1)) - Integer.parseInt(vnetList.get(i)) > 1) {
      endvnet=vnetList.get(i);
      vnetRange=vnetRange + startvnet + "String_Node_Str"+ endvnet+ "String_Node_Str";
      startvnet=vnetList.get(i + 1);
    }
  }
  endvnet=vnetList.get(vnetList.size() - 1);
  vnetRange=vnetRange + startvnet + "String_Node_Str"+ endvnet+ "String_Node_Str";
  vnetRange=vnetRange.substring(0,vnetRange.length() - 1);
  return vnetRange;
}
Program: 105271
Project: 105271
Buggy source:
public static int runSimpleBashScriptForExitValue(String command,int timeout){
  Script s=new Script("String_Node_Str",timeout);
  s.add("String_Node_Str");
  s.add(command);
  String result=s.execute(null);
  if (result == null || result.trim().isEmpty())   return -1;
 else {
    try {
      return Integer.valueOf(result.trim());
    }
 catch (    NumberFormatException e) {
      return -1;
    }
  }
}

Fixed version (ground truth):
public static int runSimpleBashScriptForExitValue(String command,int timeout){
  Script s=new Script("String_Node_Str",timeout);
  s.add("String_Node_Str");
  s.add(command);
  String result=s.execute(null);
  if (result == null || result.trim().isEmpty())   return -1;
 else {
    try {
      return Integer.parseInt(result.trim());
    }
 catch (    NumberFormatException e) {
      return -1;
    }
  }
}
Program: 105275
Project: 105275
Buggy source:
@Override public ResourceLimitResponse createResourceLimitResponse(ResourceLimit limit){
  ResourceLimitResponse resourceLimitResponse=new ResourceLimitResponse();
  if (limit.getResourceOwnerType() == ResourceOwnerType.Domain) {
    populateDomain(resourceLimitResponse,limit.getOwnerId());
  }
 else   if (limit.getResourceOwnerType() == ResourceOwnerType.Account) {
    Account accountTemp=ApiDBUtils.findAccountById(limit.getOwnerId());
    populateAccount(resourceLimitResponse,limit.getOwnerId());
    populateDomain(resourceLimitResponse,accountTemp.getDomainId());
  }
  resourceLimitResponse.setResourceType(Integer.valueOf(limit.getType().getOrdinal()).toString());
  if ((limit.getType() == ResourceType.primary_storage || limit.getType() == ResourceType.secondary_storage) && limit.getMax() >= 0) {
    resourceLimitResponse.setMax((long)Math.ceil((double)limit.getMax() / ResourceType.bytesToGiB));
  }
 else {
    resourceLimitResponse.setMax(limit.getMax());
  }
  resourceLimitResponse.setObjectName("String_Node_Str");
  return resourceLimitResponse;
}

Fixed version (ground truth):
@Override public ResourceLimitResponse createResourceLimitResponse(ResourceLimit limit){
  ResourceLimitResponse resourceLimitResponse=new ResourceLimitResponse();
  if (limit.getResourceOwnerType() == ResourceOwnerType.Domain) {
    populateDomain(resourceLimitResponse,limit.getOwnerId());
  }
 else   if (limit.getResourceOwnerType() == ResourceOwnerType.Account) {
    Account accountTemp=ApiDBUtils.findAccountById(limit.getOwnerId());
    populateAccount(resourceLimitResponse,limit.getOwnerId());
    populateDomain(resourceLimitResponse,accountTemp.getDomainId());
  }
  resourceLimitResponse.setResourceType(Integer.toString(limit.getType().getOrdinal()));
  if ((limit.getType() == ResourceType.primary_storage || limit.getType() == ResourceType.secondary_storage) && limit.getMax() >= 0) {
    resourceLimitResponse.setMax((long)Math.ceil((double)limit.getMax() / ResourceType.bytesToGiB));
  }
 else {
    resourceLimitResponse.setMax(limit.getMax());
  }
  resourceLimitResponse.setObjectName("String_Node_Str");
  return resourceLimitResponse;
}
Program: 105276
Project: 105276
Buggy source:
@Override public ResourceCountResponse createResourceCountResponse(ResourceCount resourceCount){
  ResourceCountResponse resourceCountResponse=new ResourceCountResponse();
  if (resourceCount.getResourceOwnerType() == ResourceOwnerType.Account) {
    Account accountTemp=ApiDBUtils.findAccountById(resourceCount.getOwnerId());
    if (accountTemp != null) {
      populateAccount(resourceCountResponse,accountTemp.getId());
      populateDomain(resourceCountResponse,accountTemp.getDomainId());
    }
  }
 else   if (resourceCount.getResourceOwnerType() == ResourceOwnerType.Domain) {
    populateDomain(resourceCountResponse,resourceCount.getOwnerId());
  }
  resourceCountResponse.setResourceType(Integer.valueOf(resourceCount.getType().getOrdinal()).toString());
  resourceCountResponse.setResourceCount(resourceCount.getCount());
  resourceCountResponse.setObjectName("String_Node_Str");
  return resourceCountResponse;
}

Fixed version (ground truth):
@Override public ResourceCountResponse createResourceCountResponse(ResourceCount resourceCount){
  ResourceCountResponse resourceCountResponse=new ResourceCountResponse();
  if (resourceCount.getResourceOwnerType() == ResourceOwnerType.Account) {
    Account accountTemp=ApiDBUtils.findAccountById(resourceCount.getOwnerId());
    if (accountTemp != null) {
      populateAccount(resourceCountResponse,accountTemp.getId());
      populateDomain(resourceCountResponse,accountTemp.getDomainId());
    }
  }
 else   if (resourceCount.getResourceOwnerType() == ResourceOwnerType.Domain) {
    populateDomain(resourceCountResponse,resourceCount.getOwnerId());
  }
  resourceCountResponse.setResourceType(Integer.toString(resourceCount.getType().getOrdinal()));
  resourceCountResponse.setResourceCount(resourceCount.getCount());
  resourceCountResponse.setObjectName("String_Node_Str");
  return resourceCountResponse;
}
Program: 105279
Project: 105279
Buggy source:
public void dispatch(final BaseCmd cmd,final Map<String,String> params,final boolean execute) throws Exception {
  standardDispatchChain.dispatch(new DispatchTask(cmd,params));
  final CallContext ctx=CallContext.current();
  ctx.setEventDisplayEnabled(cmd.isDisplay());
  if (cmd instanceof BaseAsyncCmd) {
    final BaseAsyncCmd asyncCmd=(BaseAsyncCmd)cmd;
    final String startEventId=params.get(ApiConstants.CTX_START_EVENT_ID);
    ctx.setStartEventId(Long.valueOf(startEventId));
    if (asyncCmd.getJob() != null && asyncCmd.getSyncObjId() != null && asyncCmd.getSyncObjType() != null) {
      Long queueSizeLimit=null;
      if (asyncCmd.getSyncObjType() != null && asyncCmd.getSyncObjType().equalsIgnoreCase(BaseAsyncCmd.snapshotHostSyncObject)) {
        queueSizeLimit=_createSnapshotQueueSizeLimit;
      }
 else {
        queueSizeLimit=1L;
      }
      if (queueSizeLimit != null) {
        if (!execute) {
          _asyncMgr.syncAsyncJobExecution((AsyncJob)asyncCmd.getJob(),asyncCmd.getSyncObjType(),asyncCmd.getSyncObjId().longValue(),queueSizeLimit);
          return;
        }
      }
 else {
        s_logger.trace("String_Node_Str");
      }
    }
  }
  if (cmd instanceof BaseAsyncCustomIdCmd) {
    ((BaseAsyncCustomIdCmd)cmd).checkUuid();
  }
 else   if (cmd instanceof BaseCustomIdCmd) {
    ((BaseCustomIdCmd)cmd).checkUuid();
  }
  cmd.execute();
}

Fixed version (ground truth):
public void dispatch(final BaseCmd cmd,final Map<String,String> params,final boolean execute) throws Exception {
  standardDispatchChain.dispatch(new DispatchTask(cmd,params));
  final CallContext ctx=CallContext.current();
  ctx.setEventDisplayEnabled(cmd.isDisplay());
  if (cmd instanceof BaseAsyncCmd) {
    final BaseAsyncCmd asyncCmd=(BaseAsyncCmd)cmd;
    final String startEventId=params.get(ApiConstants.CTX_START_EVENT_ID);
    ctx.setStartEventId(Long.parseLong(startEventId));
    if (asyncCmd.getJob() != null && asyncCmd.getSyncObjId() != null && asyncCmd.getSyncObjType() != null) {
      Long queueSizeLimit=null;
      if (asyncCmd.getSyncObjType() != null && asyncCmd.getSyncObjType().equalsIgnoreCase(BaseAsyncCmd.snapshotHostSyncObject)) {
        queueSizeLimit=_createSnapshotQueueSizeLimit;
      }
 else {
        queueSizeLimit=1L;
      }
      if (queueSizeLimit != null) {
        if (!execute) {
          _asyncMgr.syncAsyncJobExecution((AsyncJob)asyncCmd.getJob(),asyncCmd.getSyncObjType(),asyncCmd.getSyncObjId().longValue(),queueSizeLimit);
          return;
        }
      }
 else {
        s_logger.trace("String_Node_Str");
      }
    }
  }
  if (cmd instanceof BaseAsyncCustomIdCmd) {
    ((BaseAsyncCustomIdCmd)cmd).checkUuid();
  }
 else   if (cmd instanceof BaseCustomIdCmd) {
    ((BaseCustomIdCmd)cmd).checkUuid();
  }
  cmd.execute();
}
Program: 105280
Project: 105280
Buggy source:
protected AgentAttache getAttache(final Long hostId) throws AgentUnavailableException {
}

Fixed version (ground truth):
protected AgentAttache getAttache(final Long hostId) throws AgentUnavailableException {
  if (hostId == null) {
    return null;
  }
  AgentAttache agent=findAttache(hostId);
  if (agent == null) {
    s_logger.debug("String_Node_Str" + hostId);
    throw new AgentUnavailableException("String_Node_Str",hostId);
  }
  return agent;
}
Program: 105281
Project: 105281
Buggy source:
public long[] getNetworkStats(final Connection conn,final String privateIP){
  final String result=networkUsage(conn,privateIP,"String_Node_Str",null);
  final long[] stats=new long[2];
  if (result != null) {
    final String[] splitResult=result.split("String_Node_Str");
    int i=0;
    while (i < splitResult.length - 1) {
      stats[0]+=new Long(splitResult[i++]).longValue();
      stats[1]+=new Long(splitResult[i++]).longValue();
    }
  }
  return stats;
}

Fixed version (ground truth):
public long[] getNetworkStats(final Connection conn,final String privateIP){
  final String result=networkUsage(conn,privateIP,"String_Node_Str",null);
  final long[] stats=new long[2];
  if (result != null) {
    final String[] splitResult=result.split("String_Node_Str");
    int i=0;
    while (i < splitResult.length - 1) {
      stats[0]+=Long.parseLong(splitResult[i++]);
      stats[1]+=Long.parseLong(splitResult[i++]);
    }
  }
  return stats;
}
Program: 105282
Project: 105282
Buggy source:
/** 
 * @param cmd
 * @return
 */
private ExecutionResult prepareNetworkElementCommand(final SetupGuestNetworkCommand cmd){
  final Connection conn=getConnection();
  final NicTO nic=cmd.getNic();
  final String domrName=cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
  try {
    final Set<VM> vms=VM.getByNameLabel(conn,domrName);
    if (vms == null || vms.isEmpty()) {
      return new ExecutionResult(false,"String_Node_Str" + domrName);
    }
    final VM vm=vms.iterator().next();
    final String mac=nic.getMac();
    VIF domrVif=null;
    for (    final VIF vif : vm.getVIFs(conn)) {
      final String lmac=vif.getMAC(conn);
      if (lmac.equals(mac)) {
        domrVif=vif;
      }
    }
    if (domrVif == null) {
      return new ExecutionResult(false,"String_Node_Str" + mac + "String_Node_Str"+ domrName);
    }
    nic.setDeviceId(Integer.valueOf(domrVif.getDevice(conn)));
  }
 catch (  final Exception e) {
    final String msg="String_Node_Str" + e.toString();
    s_logger.warn(msg,e);
    return new ExecutionResult(false,msg);
  }
  return new ExecutionResult(true,null);
}

Fixed version (ground truth):
/** 
 * @param cmd
 * @return
 */
private ExecutionResult prepareNetworkElementCommand(final SetupGuestNetworkCommand cmd){
  final Connection conn=getConnection();
  final NicTO nic=cmd.getNic();
  final String domrName=cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
  try {
    final Set<VM> vms=VM.getByNameLabel(conn,domrName);
    if (vms == null || vms.isEmpty()) {
      return new ExecutionResult(false,"String_Node_Str" + domrName);
    }
    final VM vm=vms.iterator().next();
    final String mac=nic.getMac();
    VIF domrVif=null;
    for (    final VIF vif : vm.getVIFs(conn)) {
      final String lmac=vif.getMAC(conn);
      if (lmac.equals(mac)) {
        domrVif=vif;
      }
    }
    if (domrVif == null) {
      return new ExecutionResult(false,"String_Node_Str" + mac + "String_Node_Str"+ domrName);
    }
    nic.setDeviceId(Integer.parseInt(domrVif.getDevice(conn)));
  }
 catch (  final Exception e) {
    final String msg="String_Node_Str" + e.toString();
    s_logger.warn(msg,e);
    return new ExecutionResult(false,msg);
  }
  return new ExecutionResult(true,null);
}
Program: 105283
Project: 105283
Buggy source:
@Override public ManagementServerHostVO getPeer(String mgmtServerId){
  return _mshostDao.findByMsid(Long.valueOf(mgmtServerId));
}

Fixed version (ground truth):
@Override public ManagementServerHostVO getPeer(String mgmtServerId){
  return _mshostDao.findByMsid(Long.parseLong(mgmtServerId));
}
Program: 105285
Project: 105285
Buggy source:
@Override public boolean start(){
  try {
    syncBladeInterval=Integer.valueOf(configDao.getValue(Config.UCSSyncBladeInterval.key()));
  }
 catch (  NumberFormatException e) {
    syncBladeInterval=600;
  }
  syncBladesExecutor=Executors.newScheduledThreadPool(1,new NamedThreadFactory("String_Node_Str"));
  syncBladesExecutor.scheduleAtFixedRate(new SyncBladesThread(),syncBladeInterval,syncBladeInterval,TimeUnit.SECONDS);
  return true;
}

Fixed version (ground truth):
@Override public boolean start(){
  try {
    syncBladeInterval=Integer.parseInt(configDao.getValue(Config.UCSSyncBladeInterval.key()));
  }
 catch (  NumberFormatException e) {
    syncBladeInterval=600;
  }
  syncBladesExecutor=Executors.newScheduledThreadPool(1,new NamedThreadFactory("String_Node_Str"));
  syncBladesExecutor.scheduleAtFixedRate(new SyncBladesThread(),syncBladeInterval,syncBladeInterval,TimeUnit.SECONDS);
  return true;
}
Program: 105286
Project: 105286
Buggy source:
private String getConfigurationParameter(Connection conn,String category,String paramName){
  try (PreparedStatement pstmt=conn.prepareStatement("String_Node_Str" + category + "String_Node_Str"+ paramName+ "String_Node_Str")){
    try (ResultSet rs=pstmt.executeQuery()){
      while (rs.next()) {
        return rs.getString("String_Node_Str");
      }
    }
 catch (    SQLException e) {
      throw new CloudRuntimeException("String_Node_Str" + paramName + "String_Node_Str",e);
    }
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + paramName + "String_Node_Str",e);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private String getConfigurationParameter(Connection conn,String category,String paramName){
  try (PreparedStatement pstmt=conn.prepareStatement("String_Node_Str")){
    pstmt.setString(1,category);
    pstmt.setString(2,paramName);
    try (ResultSet rs=pstmt.executeQuery()){
      while (rs.next()) {
        return rs.getString("String_Node_Str");
      }
    }
 catch (    SQLException e) {
      throw new CloudRuntimeException("String_Node_Str" + paramName + "String_Node_Str",e);
    }
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + paramName + "String_Node_Str",e);
  }
  return "String_Node_Str";
}
Program: 105287
Project: 105287
Buggy source:
private void setConfigurationParameter(Connection conn,String category,String paramName,String paramVal){
  try (PreparedStatement pstmt=conn.prepareStatement("String_Node_Str" + paramVal + "String_Node_Str"+ paramName+ "String_Node_Str")){
    s_logger.debug("String_Node_Str" + paramName + "String_Node_Str"+ paramVal+ "String_Node_Str"+ pstmt);
    pstmt.executeUpdate();
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + paramName + "String_Node_Str"+ paramVal+ "String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void setConfigurationParameter(Connection conn,String category,String paramName,String paramVal){
  try (PreparedStatement pstmt=conn.prepareStatement("String_Node_Str")){
    pstmt.setString(1,paramVal);
    pstmt.setString(2,paramName);
    s_logger.debug("String_Node_Str" + paramName + "String_Node_Str"+ paramVal+ "String_Node_Str"+ pstmt);
    pstmt.executeUpdate();
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + paramName + "String_Node_Str"+ paramVal+ "String_Node_Str",e);
  }
}
Program: 105289
Project: 105289
Buggy source:
public Map<String,String> getDetails(){
  Map<String,String> customparameterMap=new HashMap<String,String>();
  if (details != null && details.size() != 0) {
    Collection parameterCollection=details.values();
    Iterator iter=parameterCollection.iterator();
    while (iter.hasNext()) {
      HashMap<String,String> value=(HashMap<String,String>)iter.next();
      for (      Map.Entry<String,String> entry : value.entrySet()) {
        customparameterMap.put(entry.getKey(),entry.getValue());
      }
    }
  }
  return customparameterMap;
}

Fixed version (ground truth):
public Map<String,String> getDetails(){
  return details;
}
Program: 105290
Project: 105290
Buggy source:
private void postCreatePrivateTemplate(String installFullPath,long templateId,String templateName,long size,long virtualSize) throws Exception {
  BufferedWriter out=null;
  try {
    out=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(installFullPath + "String_Node_Str")));
    out.write("String_Node_Str" + templateName + "String_Node_Str");
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str" + size);
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str" + templateId);
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str" + templateName + "String_Node_Str");
    out.newLine();
    out.write("String_Node_Str" + templateName);
    out.newLine();
    out.write("String_Node_Str" + virtualSize);
    out.newLine();
    out.write("String_Node_Str" + virtualSize);
    out.newLine();
    out.write("String_Node_Str" + size);
    out.newLine();
  }
  finally {
    if (out != null) {
      out.close();
    }
  }
}

Fixed version (ground truth):
private void postCreatePrivateTemplate(String installFullPath,long templateId,String templateName,long size,long virtualSize) throws Exception {
  BufferedWriter out=null;
  try {
    out=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(installFullPath + "String_Node_Str"),"String_Node_Str"));
    out.write("String_Node_Str" + templateName + "String_Node_Str");
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str" + size);
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str" + templateId);
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str" + templateName + "String_Node_Str");
    out.newLine();
    out.write("String_Node_Str" + templateName);
    out.newLine();
    out.write("String_Node_Str" + virtualSize);
    out.newLine();
    out.write("String_Node_Str" + virtualSize);
    out.newLine();
    out.write("String_Node_Str" + size);
    out.newLine();
  }
  finally {
    if (out != null) {
      out.close();
    }
  }
}
Program: 105291
Project: 105291
Buggy source:
private void writeMetaOvaForTemplate(String installFullPath,String ovfFilename,String vmdkFilename,String templateName,long diskSize) throws Exception {
  BufferedWriter out=null;
  try {
    out=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(installFullPath + "String_Node_Str" + templateName+ "String_Node_Str")));
    out.write("String_Node_Str" + templateName + "String_Node_Str");
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str" + ovfFilename);
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str" + vmdkFilename);
    out.newLine();
    out.write("String_Node_Str" + diskSize);
    out.newLine();
  }
  finally {
    if (out != null) {
      out.close();
    }
  }
}

Fixed version (ground truth):
private void writeMetaOvaForTemplate(String installFullPath,String ovfFilename,String vmdkFilename,String templateName,long diskSize) throws Exception {
  BufferedWriter out=null;
  try {
    out=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(installFullPath + "String_Node_Str" + templateName+ "String_Node_Str"),"String_Node_Str"));
    out.write("String_Node_Str" + templateName + "String_Node_Str");
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str" + ovfFilename);
    out.newLine();
    out.write("String_Node_Str");
    out.newLine();
    out.write("String_Node_Str" + vmdkFilename);
    out.newLine();
    out.write("String_Node_Str" + diskSize);
    out.newLine();
  }
  finally {
    if (out != null) {
      out.close();
    }
  }
}
Program: 105292
Project: 105292
Buggy source:
public ServerTransportProvider(){
}

Fixed version (ground truth):
public ServerTransportProvider(){
  randomGenerator=new SecureRandom();
  _nextEndpointId=randomGenerator.nextInt();
}
Program: 105293
Project: 105293
Buggy source:
public void parse(byte[] vmsdFileContent) throws IOException {
  BufferedReader in=null;
  try {
    in=new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmsdFileContent)));
    String line;
    while ((line=in.readLine()) != null) {
      s_logger.info("String_Node_Str" + line);
      String[] tokens=line.split("String_Node_Str");
      if (tokens.length == 2) {
        String name=tokens[0].trim();
        String value=tokens[1].trim();
        if (value.charAt(0) == '\"')         value=value.substring(1,value.length() - 1);
        _properties.put(name,value);
      }
    }
  }
  finally {
    if (in != null)     in.close();
  }
}

Fixed version (ground truth):
public void parse(byte[] vmsdFileContent) throws IOException {
  BufferedReader in=null;
  try {
    in=new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmsdFileContent),"String_Node_Str"));
    String line;
    while ((line=in.readLine()) != null) {
      s_logger.info("String_Node_Str" + line);
      String[] tokens=line.split("String_Node_Str");
      if (tokens.length == 2) {
        String name=tokens[0].trim();
        String value=tokens[1].trim();
        if (value.charAt(0) == '\"')         value=value.substring(1,value.length() - 1);
        _properties.put(name,value);
      }
    }
  }
  finally {
    if (in != null)     in.close();
  }
}
Program: 105294
Project: 105294
Buggy source:
public String[] listDatastoreDirContent(String urlString) throws Exception {
  List<String> fileList=new ArrayList<String>();
  String content=new String(getResourceContent(urlString));
  String marker="String_Node_Str";
  int parsePos=-1;
  do {
    parsePos=content.indexOf(marker,parsePos < 0 ? 0 : parsePos);
    if (parsePos > 0) {
      int beginPos=content.lastIndexOf('>',parsePos - 1);
      if (beginPos < 0)       beginPos=0;
      fileList.add((content.substring(beginPos + 1,parsePos)));
      parsePos+=marker.length();
    }
 else {
      break;
    }
  }
 while (parsePos > 0);
  return fileList.toArray(new String[0]);
}

Fixed version (ground truth):
public String[] listDatastoreDirContent(String urlString) throws Exception {
  List<String> fileList=new ArrayList<String>();
  String content=new String(getResourceContent(urlString),"String_Node_Str");
  String marker="String_Node_Str";
  int parsePos=-1;
  do {
    parsePos=content.indexOf(marker,parsePos < 0 ? 0 : parsePos);
    if (parsePos > 0) {
      int beginPos=content.lastIndexOf('>',parsePos - 1);
      if (beginPos < 0)       beginPos=0;
      fileList.add((content.substring(beginPos + 1,parsePos)));
      parsePos+=marker.length();
    }
 else {
      break;
    }
  }
 while (parsePos > 0);
  return fileList.toArray(new String[0]);
}
Program: 105296
Project: 105296
Buggy source:
public Map<String,String> getDetails(){
  Map<String,String> customparameterMap=new HashMap<String,String>();
  if (details != null && details.size() != 0) {
    Collection parameterCollection=details.values();
    Iterator iter=parameterCollection.iterator();
    while (iter.hasNext()) {
      HashMap<String,String> value=(HashMap<String,String>)iter.next();
      for (      Map.Entry<String,String> entry : value.entrySet()) {
        customparameterMap.put(entry.getKey(),entry.getValue());
      }
    }
  }
  return customparameterMap;
}

Fixed version (ground truth):
public Map<String,String> getDetails(){
  return details;
}
Program: 105297
Project: 105297
Buggy source:
public static byte[] composeDiskInfo(List<Ternary<String,String,String>> diskInfo,int disksInChain,boolean includeBase) throws IOException {
  BufferedWriter out=null;
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  try {
    out=new BufferedWriter(new OutputStreamWriter(bos));
    out.write("String_Node_Str" + disksInChain);
    out.newLine();
    out.write("String_Node_Str" + diskInfo.size());
    out.newLine();
    out.write("String_Node_Str" + includeBase);
    out.newLine();
    int seq=disksInChain - 1;
    for (    Ternary<String,String,String> item : diskInfo) {
      out.write(String.format("String_Node_Str",seq,item.first()));
      out.newLine();
      out.write(String.format("String_Node_Str",seq,item.second()));
      out.newLine();
      if (item.third() != null) {
        out.write(String.format("String_Node_Str",seq,item.third()));
        out.newLine();
      }
      seq--;
    }
    out.newLine();
  }
  finally {
    if (out != null)     out.close();
  }
  return bos.toByteArray();
}

Fixed version (ground truth):
public static byte[] composeDiskInfo(List<Ternary<String,String,String>> diskInfo,int disksInChain,boolean includeBase) throws IOException {
  BufferedWriter out=null;
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  try {
    out=new BufferedWriter(new OutputStreamWriter(bos,"String_Node_Str"));
    out.write("String_Node_Str" + disksInChain);
    out.newLine();
    out.write("String_Node_Str" + diskInfo.size());
    out.newLine();
    out.write("String_Node_Str" + includeBase);
    out.newLine();
    int seq=disksInChain - 1;
    for (    Ternary<String,String,String> item : diskInfo) {
      out.write(String.format("String_Node_Str",seq,item.first()));
      out.newLine();
      out.write(String.format("String_Node_Str",seq,item.second()));
      out.newLine();
      if (item.third() != null) {
        out.write(String.format("String_Node_Str",seq,item.third()));
        out.newLine();
      }
      seq--;
    }
    out.newLine();
  }
  finally {
    if (out != null)     out.close();
  }
  return bos.toByteArray();
}
Program: 105299
Project: 105299
Buggy source:
public void parse(byte[] vmdkFileContent) throws IOException {
  BufferedReader in=null;
  try {
    in=new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmdkFileContent)));
    String line;
    while ((line=in.readLine()) != null) {
      line=line.trim();
      if (line.isEmpty())       continue;
      if (line.charAt(0) == '#')       continue;
      String[] tokens=line.split("String_Node_Str");
      if (tokens.length == 2) {
        String name=tokens[0].trim();
        String value=tokens[1].trim();
        if (value.charAt(0) == '\"')         value=value.substring(1,value.length() - 1);
        _properties.put(name,value);
      }
 else {
        if (line.startsWith("String_Node_Str")) {
          int startPos=line.indexOf('\"');
          int endPos=line.lastIndexOf('\"');
          assert(startPos > 0);
          assert(endPos > 0);
          _baseFileName=line.substring(startPos + 1,endPos);
        }
 else {
          s_logger.warn("String_Node_Str" + line);
        }
      }
    }
  }
  finally {
    if (in != null)     in.close();
  }
}

Fixed version (ground truth):
public void parse(byte[] vmdkFileContent) throws IOException {
  BufferedReader in=null;
  try {
    in=new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmdkFileContent),"String_Node_Str"));
    String line;
    while ((line=in.readLine()) != null) {
      line=line.trim();
      if (line.isEmpty())       continue;
      if (line.charAt(0) == '#')       continue;
      String[] tokens=line.split("String_Node_Str");
      if (tokens.length == 2) {
        String name=tokens[0].trim();
        String value=tokens[1].trim();
        if (value.charAt(0) == '\"')         value=value.substring(1,value.length() - 1);
        _properties.put(name,value);
      }
 else {
        if (line.startsWith("String_Node_Str")) {
          int startPos=line.indexOf('\"');
          int endPos=line.lastIndexOf('\"');
          assert(startPos > 0);
          assert(endPos > 0);
          _baseFileName=line.substring(startPos + 1,endPos);
        }
 else {
          s_logger.warn("String_Node_Str" + line);
        }
      }
    }
  }
  finally {
    if (in != null)     in.close();
  }
}
Program: 105300
Project: 105300
Buggy source:
private static String getSecondaryDatastoreUUID(String storeUrl){
  return UUID.nameUUIDFromBytes(storeUrl.getBytes()).toString();
}

Fixed version (ground truth):
private static String getSecondaryDatastoreUUID(String storeUrl){
  String uuid=null;
  try {
    uuid=UUID.nameUUIDFromBytes(storeUrl.getBytes("String_Node_Str")).toString();
  }
 catch (  UnsupportedEncodingException e) {
    s_logger.warn("String_Node_Str" + storeUrl + "String_Node_Str");
  }
  return uuid;
}
Program: 105301
Project: 105301
Buggy source:
public static String readOvfContent(String ovfFilePath) throws IOException {
  StringBuffer strContent=new StringBuffer();
  BufferedReader in=new BufferedReader(new InputStreamReader(new FileInputStream(ovfFilePath)));
  String lineStr;
  while ((lineStr=in.readLine()) != null) {
    strContent.append(lineStr);
  }
  in.close();
  return strContent.toString();
}

Fixed version (ground truth):
public static String readOvfContent(String ovfFilePath) throws IOException {
  StringBuffer strContent=new StringBuffer();
  BufferedReader in=new BufferedReader(new InputStreamReader(new FileInputStream(ovfFilePath),"String_Node_Str"));
  String lineStr;
  while ((lineStr=in.readLine()) != null) {
    strContent.append(lineStr);
  }
  in.close();
  return strContent.toString();
}