nus-yam/ex-repair huggingface dataset:
Program: 105302
Project: 105302
Buggy source:
private UptimeStats getUptimeAndCpuIdleTime(){
  UptimeStats uptime=new UptimeStats(0d,0d);
  File f=new File(_uptimeFile);
  try (Scanner scanner=new Scanner(f)){
    String[] stats=scanner.useDelimiter("String_Node_Str").next().split("String_Node_Str");
    uptime=new UptimeStats(Double.parseDouble(stats[0]),Double.parseDouble(stats[1]));
  }
 catch (  FileNotFoundException ex) {
    s_logger.warn("String_Node_Str" + _uptimeFile + "String_Node_Str"+ ex.toString());
  }
  return uptime;
}

Fixed version (ground truth):
private UptimeStats getUptimeAndCpuIdleTime(){
  UptimeStats uptime=new UptimeStats(0d,0d);
  File f=new File(_uptimeFile);
  try (Scanner scanner=new Scanner(f,"String_Node_Str")){
    String[] stats=scanner.useDelimiter("String_Node_Str").next().split("String_Node_Str");
    uptime=new UptimeStats(Double.parseDouble(stats[0]),Double.parseDouble(stats[1]));
  }
 catch (  FileNotFoundException ex) {
    s_logger.warn("String_Node_Str" + _uptimeFile + "String_Node_Str"+ ex.toString());
  }
  return uptime;
}
Program: 105303
Project: 105303
Buggy source:
private void verifyMinAndMaxIops(String minIops,String maxIops){
  if ((minIops != null && maxIops == null) || (minIops == null && maxIops != null)) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  long lMinIops;
  try {
    if (minIops != null) {
      lMinIops=Long.valueOf(minIops);
    }
 else {
      lMinIops=0;
    }
  }
 catch (  NumberFormatException ex) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  long lMaxIops;
  try {
    if (maxIops != null) {
      lMaxIops=Long.valueOf(maxIops);
    }
 else {
      lMaxIops=0;
    }
  }
 catch (  NumberFormatException ex) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (lMinIops > lMaxIops) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void verifyMinAndMaxIops(String minIops,String maxIops){
  if ((minIops != null && maxIops == null) || (minIops == null && maxIops != null)) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  long lMinIops;
  try {
    if (minIops != null) {
      lMinIops=Long.parseLong(minIops);
    }
 else {
      lMinIops=0;
    }
  }
 catch (  NumberFormatException ex) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  long lMaxIops;
  try {
    if (maxIops != null) {
      lMaxIops=Long.valueOf(maxIops);
    }
 else {
      lMaxIops=0;
    }
  }
 catch (  NumberFormatException ex) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (lMinIops > lMaxIops) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
}
Program: 105304
Project: 105304
Buggy source:
private String sendRequest(String service,String xmlRequest) throws ExecutionException {
  HttpClient client=new HttpClient();
  byte[] response=null;
  PostMethod method=new PostMethod("String_Node_Str" + service);
  method.setRequestBody(xmlRequest);
  try {
    org.apache.commons.httpclient.protocol.Protocol myhttps=new org.apache.commons.httpclient.protocol.Protocol("String_Node_Str",new EasySSLProtocolSocketFactory(),443);
    client.getHostConfiguration().setHost(_ip,443,myhttps);
    int statusCode=client.executeMethod(method);
    if (statusCode != HttpStatus.SC_OK) {
      throw new Exception("String_Node_Str" + statusCode);
    }
    response=method.getResponseBody();
  }
 catch (  Exception e) {
    System.out.println(e.getMessage());
    throw new ExecutionException(e.getMessage());
  }
  System.out.println(new String(response));
  return new String(response);
}

Fixed version (ground truth):
private String sendRequest(String service,String xmlRequest) throws ExecutionException {
  HttpClient client=new HttpClient();
  String response=null;
  PostMethod method=new PostMethod("String_Node_Str" + service);
  method.setRequestBody(xmlRequest);
  try {
    org.apache.commons.httpclient.protocol.Protocol myhttps=new org.apache.commons.httpclient.protocol.Protocol("String_Node_Str",new EasySSLProtocolSocketFactory(),443);
    client.getHostConfiguration().setHost(_ip,443,myhttps);
    int statusCode=client.executeMethod(method);
    if (statusCode != HttpStatus.SC_OK) {
      throw new Exception("String_Node_Str" + statusCode);
    }
    response=method.getResponseBodyAsString();
  }
 catch (  Exception e) {
    System.out.println(e.getMessage());
    throw new ExecutionException(e.getMessage());
  }
  System.out.println(response);
  return response;
}
Program: 105305
Project: 105305
Buggy source:
public void uploadResourceContent(String urlString,byte[] content) throws Exception {
  HttpURLConnection conn=getHTTPConnection(urlString,"String_Node_Str");
  OutputStream out=conn.getOutputStream();
  out.write(content);
  out.flush();
  BufferedReader in=new BufferedReader(new InputStreamReader(conn.getInputStream()));
  String line;
  while ((line=in.readLine()) != null) {
    if (s_logger.isTraceEnabled())     s_logger.trace("String_Node_Str" + urlString + "String_Node_Str"+ line);
  }
  out.close();
  in.close();
}

Fixed version (ground truth):
public void uploadResourceContent(String urlString,byte[] content) throws Exception {
  HttpURLConnection conn=getHTTPConnection(urlString,"String_Node_Str");
  OutputStream out=conn.getOutputStream();
  out.write(content);
  out.flush();
  BufferedReader in=new BufferedReader(new InputStreamReader(conn.getInputStream(),conn.getContentEncoding()));
  String line;
  while ((line=in.readLine()) != null) {
    if (s_logger.isTraceEnabled())     s_logger.trace("String_Node_Str" + urlString + "String_Node_Str"+ line);
  }
  out.close();
  in.close();
}
Program: 105306
Project: 105306
Buggy source:
public void uploadFile(String urlString,File localFile) throws Exception {
  HttpURLConnection conn=getHTTPConnection(urlString,"String_Node_Str");
  OutputStream out=null;
  InputStream in=null;
  BufferedReader br=null;
  try {
    out=conn.getOutputStream();
    in=new FileInputStream(localFile);
    byte[] buf=new byte[ChunkSize];
    int len=0;
    while ((len=in.read(buf)) > 0) {
      out.write(buf,0,len);
    }
    out.flush();
    br=new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String line;
    while ((line=br.readLine()) != null) {
      if (s_logger.isTraceEnabled())       s_logger.trace("String_Node_Str" + urlString + "String_Node_Str"+ line);
    }
  }
  finally {
    if (in != null)     in.close();
    if (out != null)     out.close();
    if (br != null)     br.close();
  }
}

Fixed version (ground truth):
public void uploadFile(String urlString,File localFile) throws Exception {
  HttpURLConnection conn=getHTTPConnection(urlString,"String_Node_Str");
  OutputStream out=null;
  InputStream in=null;
  BufferedReader br=null;
  try {
    out=conn.getOutputStream();
    in=new FileInputStream(localFile);
    byte[] buf=new byte[ChunkSize];
    int len=0;
    while ((len=in.read(buf)) > 0) {
      out.write(buf,0,len);
    }
    out.flush();
    br=new BufferedReader(new InputStreamReader(conn.getInputStream(),conn.getContentEncoding()));
    String line;
    while ((line=br.readLine()) != null) {
      if (s_logger.isTraceEnabled())       s_logger.trace("String_Node_Str" + urlString + "String_Node_Str"+ line);
    }
  }
  finally {
    if (in != null)     in.close();
    if (out != null)     out.close();
    if (br != null)     br.close();
  }
}
Program: 105308
Project: 105308
Buggy source:
private String getXml(String filename){
  try {
    String xmlFilePath=Script.findScript(scriptsDir,filename);
    if (xmlFilePath == null) {
      throw new Exception("String_Node_Str" + filename);
    }
    try (FileReader fr=new FileReader(xmlFilePath);BufferedReader br=new BufferedReader(fr)){
      String xml="String_Node_Str";
      String line;
      while ((line=br.readLine()) != null) {
        xml+=line.trim();
      }
      return xml;
    }
 catch (    Exception e) {
      s_logger.debug(e);
      return null;
    }
  }
 catch (  Exception e) {
    s_logger.debug(e);
    return null;
  }
}

Fixed version (ground truth):
private String getXml(String filename){
  try {
    String xmlFilePath=Script.findScript(scriptsDir,filename);
    if (xmlFilePath == null) {
      throw new Exception("String_Node_Str" + filename);
    }
    try (InputStreamReader fr=new InputStreamReader(new FileInputStream(xmlFilePath),"String_Node_Str");BufferedReader br=new BufferedReader(fr)){
      String xml="String_Node_Str";
      String line;
      while ((line=br.readLine()) != null) {
        xml+=line.trim();
      }
      return xml;
    }
 catch (    Exception e) {
      s_logger.debug(e);
      return null;
    }
  }
 catch (  Exception e) {
    s_logger.debug(e);
    return null;
  }
}
Program: 105311
Project: 105311
Buggy source:
private String getXml(String filename){
  try {
    String xmlFilePath=Script.findScript(scriptsDir,filename);
    if (xmlFilePath == null) {
      throw new Exception("String_Node_Str" + filename);
    }
    FileReader fr=new FileReader(xmlFilePath);
    BufferedReader br=new BufferedReader(fr);
    String xml="String_Node_Str";
    String line;
    while ((line=br.readLine()) != null) {
      xml+=line;
    }
    return xml;
  }
 catch (  Exception e) {
    s_logger.debug(e);
    return null;
  }
}

Fixed version (ground truth):
private String getXml(String filename){
  try {
    String xmlFilePath=Script.findScript(scriptsDir,filename);
    if (xmlFilePath == null) {
      throw new Exception("String_Node_Str" + filename);
    }
    InputStreamReader fr=new InputStreamReader(new FileInputStream(xmlFilePath),"String_Node_Str");
    BufferedReader br=new BufferedReader(fr);
    String xml="String_Node_Str";
    String line;
    while ((line=br.readLine()) != null) {
      xml+=line;
    }
    return xml;
  }
 catch (  Exception e) {
    s_logger.debug(e);
    return null;
  }
}
Program: 105313
Project: 105313
Buggy source:
@Deprecated public void setSnapshotDirectory(String snapshotDir) throws Exception {
  VirtualMachineFileInfo fileInfo=getFileInfo();
  Pair<DatacenterMO,String> dcInfo=getOwnerDatacenter();
  String vmxUrl=_context.composeDatastoreBrowseUrl(dcInfo.second(),fileInfo.getVmPathName());
  byte[] vmxContent=_context.getResourceContent(vmxUrl);
  BufferedReader in=null;
  BufferedWriter out=null;
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  boolean replaced=false;
  try {
    in=new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmxContent)));
    out=new BufferedWriter(new OutputStreamWriter(bos));
    String line;
    while ((line=in.readLine()) != null) {
      if (line.startsWith("String_Node_Str")) {
        replaced=true;
        out.write(String.format("String_Node_Str",snapshotDir));
        out.newLine();
      }
 else {
        out.write(line);
        out.newLine();
      }
    }
    if (!replaced) {
      out.newLine();
      out.write(String.format("String_Node_Str",snapshotDir));
      out.newLine();
    }
  }
  finally {
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
  _context.uploadResourceContent(vmxUrl,bos.toByteArray());
}

Fixed version (ground truth):
@Deprecated public void setSnapshotDirectory(String snapshotDir) throws Exception {
  VirtualMachineFileInfo fileInfo=getFileInfo();
  Pair<DatacenterMO,String> dcInfo=getOwnerDatacenter();
  String vmxUrl=_context.composeDatastoreBrowseUrl(dcInfo.second(),fileInfo.getVmPathName());
  byte[] vmxContent=_context.getResourceContent(vmxUrl);
  BufferedReader in=null;
  BufferedWriter out=null;
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  boolean replaced=false;
  try {
    in=new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmxContent),"String_Node_Str"));
    out=new BufferedWriter(new OutputStreamWriter(bos,"String_Node_Str"));
    String line;
    while ((line=in.readLine()) != null) {
      if (line.startsWith("String_Node_Str")) {
        replaced=true;
        out.write(String.format("String_Node_Str",snapshotDir));
        out.newLine();
      }
 else {
        out.write(line);
        out.newLine();
      }
    }
    if (!replaced) {
      out.newLine();
      out.write(String.format("String_Node_Str",snapshotDir));
      out.newLine();
    }
  }
  finally {
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
  _context.uploadResourceContent(vmxUrl,bos.toByteArray());
}
Program: 105314
Project: 105314
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 (      String key : value.keySet()) {
        customparameterMap.put(key,value.get(key));
      }
    }
  }
  return customparameterMap;
}

Fixed version (ground truth):
public Map<String,String> getDetails(){
  return details;
}
Program: 105315
Project: 105315
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 (      String key : value.keySet()) {
        customparameterMap.put(key,value.get(key));
      }
    }
  }
  return customparameterMap;
}

Fixed version (ground truth):
public Map<String,String> getDetails(){
  return details;
}
Program: 105316
Project: 105316
Buggy source:
private Answer executeProxyLoadScan(final Command cmd,final long proxyVmId,final String proxyVmName,final String proxyManagementIp,final int cmdPort){
  String result=null;
  final StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str").append(proxyManagementIp).append("String_Node_Str" + cmdPort).append("String_Node_Str");
  boolean success=true;
  try {
    final URL url=new URL(sb.toString());
    final URLConnection conn=url.openConnection();
    final InputStream is=conn.getInputStream();
    final BufferedReader reader=new BufferedReader(new InputStreamReader(is));
    final StringBuilder sb2=new StringBuilder();
    String line=null;
    try {
      while ((line=reader.readLine()) != null)       sb2.append(line + "String_Node_Str");
      result=sb2.toString();
    }
 catch (    final IOException e) {
      success=false;
    }
 finally {
      try {
        is.close();
      }
 catch (      final IOException e) {
        s_logger.warn("String_Node_Str" + proxyManagementIp);
        success=false;
      }
    }
  }
 catch (  final IOException e) {
    s_logger.warn("String_Node_Str" + proxyManagementIp);
    success=false;
  }
  return new ConsoleProxyLoadAnswer(cmd,proxyVmId,proxyVmName,success,result);
}

Fixed version (ground truth):
private Answer executeProxyLoadScan(final Command cmd,final long proxyVmId,final String proxyVmName,final String proxyManagementIp,final int cmdPort){
  String result=null;
  final StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str").append(proxyManagementIp).append("String_Node_Str" + cmdPort).append("String_Node_Str");
  boolean success=true;
  try {
    final URL url=new URL(sb.toString());
    final URLConnection conn=url.openConnection();
    final InputStream is=conn.getInputStream();
    final BufferedReader reader=new BufferedReader(new InputStreamReader(is,"String_Node_Str"));
    final StringBuilder sb2=new StringBuilder();
    String line=null;
    try {
      while ((line=reader.readLine()) != null)       sb2.append(line + "String_Node_Str");
      result=sb2.toString();
    }
 catch (    final IOException e) {
      success=false;
    }
 finally {
      try {
        is.close();
      }
 catch (      final IOException e) {
        s_logger.warn("String_Node_Str" + proxyManagementIp);
        success=false;
      }
    }
  }
 catch (  final IOException e) {
    s_logger.warn("String_Node_Str" + proxyManagementIp);
    success=false;
  }
  return new ConsoleProxyLoadAnswer(cmd,proxyVmId,proxyVmName,success,result);
}
Program: 105317
Project: 105317
Buggy source:
public Answer executeProxyLoadScan(final Command cmd,final long proxyVmId,final String proxyVmName,final String proxyManagementIp,final int cmdPort){
  String result=null;
  final StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str").append(proxyManagementIp).append("String_Node_Str" + cmdPort).append("String_Node_Str");
  boolean success=true;
  try {
    final URL url=new URL(sb.toString());
    final URLConnection conn=url.openConnection();
    final InputStream is=conn.getInputStream();
    final BufferedReader reader=new BufferedReader(new InputStreamReader(is));
    final StringBuilder sb2=new StringBuilder();
    String line=null;
    try {
      while ((line=reader.readLine()) != null) {
        sb2.append(line + "String_Node_Str");
      }
      result=sb2.toString();
    }
 catch (    final IOException e) {
      success=false;
    }
 finally {
      try {
        is.close();
      }
 catch (      final IOException e) {
        s_logger.warn("String_Node_Str" + proxyManagementIp);
        success=false;
      }
    }
  }
 catch (  final IOException e) {
    s_logger.warn("String_Node_Str" + proxyManagementIp);
    success=false;
  }
  return new ConsoleProxyLoadAnswer(cmd,proxyVmId,proxyVmName,success,result);
}

Fixed version (ground truth):
public Answer executeProxyLoadScan(final Command cmd,final long proxyVmId,final String proxyVmName,final String proxyManagementIp,final int cmdPort){
  String result=null;
  final StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str").append(proxyManagementIp).append("String_Node_Str" + cmdPort).append("String_Node_Str");
  boolean success=true;
  try {
    final URL url=new URL(sb.toString());
    final URLConnection conn=url.openConnection();
    final InputStream is=conn.getInputStream();
    final BufferedReader reader=new BufferedReader(new InputStreamReader(is,"String_Node_Str"));
    final StringBuilder sb2=new StringBuilder();
    String line=null;
    try {
      while ((line=reader.readLine()) != null) {
        sb2.append(line + "String_Node_Str");
      }
      result=sb2.toString();
    }
 catch (    final IOException e) {
      success=false;
    }
 finally {
      try {
        is.close();
      }
 catch (      final IOException e) {
        s_logger.warn("String_Node_Str" + proxyManagementIp);
        success=false;
      }
    }
  }
 catch (  final IOException e) {
    s_logger.warn("String_Node_Str" + proxyManagementIp);
    success=false;
  }
  return new ConsoleProxyLoadAnswer(cmd,proxyVmId,proxyVmName,success,result);
}
Program: 105318
Project: 105318
Buggy source:
protected Answer executeProxyLoadScan(final Command cmd,final long proxyVmId,final String proxyVmName,final String proxyManagementIp,final int cmdPort){
  String result=null;
  final StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str").append(proxyManagementIp).append("String_Node_Str" + cmdPort).append("String_Node_Str");
  boolean success=true;
  try {
    final URL url=new URL(sb.toString());
    final URLConnection conn=url.openConnection();
    conn.setConnectTimeout(5000);
    conn.setReadTimeout(5000);
    final InputStream is=conn.getInputStream();
    final BufferedReader reader=new BufferedReader(new InputStreamReader(is,Charset.defaultCharset()));
    final StringBuilder sb2=new StringBuilder();
    String line=null;
    try {
      while ((line=reader.readLine()) != null) {
        sb2.append(line + "String_Node_Str");
      }
      result=sb2.toString();
    }
 catch (    final IOException e) {
      success=false;
    }
 finally {
      try {
        is.close();
      }
 catch (      final IOException e) {
        s_logger.warn("String_Node_Str" + proxyManagementIp);
        success=false;
      }
    }
  }
 catch (  final IOException e) {
    s_logger.warn("String_Node_Str" + proxyManagementIp);
    success=false;
  }
  return new ConsoleProxyLoadAnswer(cmd,proxyVmId,proxyVmName,success,result);
}

Fixed version (ground truth):
protected Answer executeProxyLoadScan(final Command cmd,final long proxyVmId,final String proxyVmName,final String proxyManagementIp,final int cmdPort){
  String result=null;
  final StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str").append(proxyManagementIp).append("String_Node_Str" + cmdPort).append("String_Node_Str");
  boolean success=true;
  try {
    final URL url=new URL(sb.toString());
    final URLConnection conn=url.openConnection();
    conn.setConnectTimeout(5000);
    conn.setReadTimeout(5000);
    final InputStream is=conn.getInputStream();
    final BufferedReader reader=new BufferedReader(new InputStreamReader(is,"String_Node_Str"));
    final StringBuilder sb2=new StringBuilder();
    String line=null;
    try {
      while ((line=reader.readLine()) != null) {
        sb2.append(line + "String_Node_Str");
      }
      result=sb2.toString();
    }
 catch (    final IOException e) {
      success=false;
    }
 finally {
      try {
        is.close();
      }
 catch (      final IOException e) {
        s_logger.warn("String_Node_Str" + proxyManagementIp);
        success=false;
      }
    }
  }
 catch (  final IOException e) {
    s_logger.warn("String_Node_Str" + proxyManagementIp);
    success=false;
  }
  return new ConsoleProxyLoadAnswer(cmd,proxyVmId,proxyVmName,success,result);
}
Program: 105319
Project: 105319
Buggy source:
public void doHandle(HttpExchange t) throws Exception {
  String path=t.getRequestURI().getPath();
  int i=path.indexOf("String_Node_Str",1);
  String cmd=path.substring(i + 1);
  s_logger.info("String_Node_Str" + cmd);
  if (cmd.equals("String_Node_Str")) {
    ConsoleProxyClientStatsCollector statsCollector=ConsoleProxy.getStatsCollector();
    Headers hds=t.getResponseHeaders();
    hds.set("String_Node_Str","String_Node_Str");
    t.sendResponseHeaders(200,0);
    OutputStreamWriter os=new OutputStreamWriter(t.getResponseBody());
    statsCollector.getStatsReport(os);
    os.close();
  }
}

Fixed version (ground truth):
public void doHandle(HttpExchange t) throws Exception {
  String path=t.getRequestURI().getPath();
  int i=path.indexOf("String_Node_Str",1);
  String cmd=path.substring(i + 1);
  s_logger.info("String_Node_Str" + cmd);
  if (cmd.equals("String_Node_Str")) {
    ConsoleProxyClientStatsCollector statsCollector=ConsoleProxy.getStatsCollector();
    Headers hds=t.getResponseHeaders();
    hds.set("String_Node_Str","String_Node_Str");
    t.sendResponseHeaders(200,0);
    OutputStreamWriter os=new OutputStreamWriter(t.getResponseBody(),"String_Node_Str");
    statsCollector.getStatsReport(os);
    os.close();
  }
}
Program: 105320
Project: 105320
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: 105321
Project: 105321
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: 105322
Project: 105322
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: 105325
Project: 105325
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: 105326
Project: 105326
Buggy source:
private void deleteVirtualServerAndDefaultPool(String virtualServerName) throws ExecutionException {
  try {
    if (virtualServerExists(virtualServerName)) {
      List<String> poolMembers=getMembers(virtualServerName);
      for (      String poolMember : poolMembers) {
        String[] destIpAndPort=getIpAndPort(poolMember);
        deletePoolMember(virtualServerName,destIpAndPort[0],Integer.valueOf(destIpAndPort[1]));
      }
      s_logger.debug("String_Node_Str" + virtualServerName);
      _virtualServerApi.delete_virtual_server(genStringArray(virtualServerName));
      if (getStrippedVirtualServers().contains(virtualServerName)) {
        throw new ExecutionException("String_Node_Str" + virtualServerName);
      }
      deletePool(virtualServerName);
    }
  }
 catch (  RemoteException e) {
    throw new ExecutionException(e.getMessage());
  }
}

Fixed version (ground truth):
private void deleteVirtualServerAndDefaultPool(String virtualServerName) throws ExecutionException {
  try {
    if (virtualServerExists(virtualServerName)) {
      List<String> poolMembers=getMembers(virtualServerName);
      for (      String poolMember : poolMembers) {
        String[] destIpAndPort=getIpAndPort(poolMember);
        deletePoolMember(virtualServerName,destIpAndPort[0],Integer.parseInt(destIpAndPort[1]));
      }
      s_logger.debug("String_Node_Str" + virtualServerName);
      _virtualServerApi.delete_virtual_server(genStringArray(virtualServerName));
      if (getStrippedVirtualServers().contains(virtualServerName)) {
        throw new ExecutionException("String_Node_Str" + virtualServerName);
      }
      deletePool(virtualServerName);
    }
  }
 catch (  RemoteException e) {
    throw new ExecutionException(e.getMessage());
  }
}
Program: 105327
Project: 105327
Buggy source:
private void deleteInactivePoolMembers(String virtualServerName,List<String> activePoolMembers) throws ExecutionException {
  List<String> allPoolMembers=getMembers(virtualServerName);
  for (  String member : allPoolMembers) {
    if (!activePoolMembers.contains(member)) {
      String[] ipAndPort=member.split("String_Node_Str");
      deletePoolMember(virtualServerName,ipAndPort[0],Integer.valueOf(ipAndPort[1]));
    }
  }
}

Fixed version (ground truth):
private void deleteInactivePoolMembers(String virtualServerName,List<String> activePoolMembers) throws ExecutionException {
  List<String> allPoolMembers=getMembers(virtualServerName);
  for (  String member : allPoolMembers) {
    if (!activePoolMembers.contains(member)) {
      String[] ipAndPort=member.split("String_Node_Str");
      deletePoolMember(virtualServerName,ipAndPort[0],Integer.parseInt(ipAndPort[1]));
    }
  }
}
Program: 105328
Project: 105328
Buggy source:
private String getVolumePathInDatastore(DatastoreMO dsMo,String volumeFileName) throws Exception {
}

Fixed version (ground truth):
private String getVolumePathInDatastore(DatastoreMO dsMo,String volumeFileName) throws Exception {
  String datastoreVolumePath=dsMo.searchFileInSubFolders(volumeFileName,true);
  if (datastoreVolumePath == null) {
    throw new CloudRuntimeException("String_Node_Str" + volumeFileName + "String_Node_Str"+ dsMo.getName());
  }
  return datastoreVolumePath;
}
Program: 105329
Project: 105329
Buggy source:
private String generatePassword() throws ServerApiException {
  try {
    final SecureRandom randomGen=SecureRandom.getInstance("String_Node_Str");
    final byte bytes[]=new byte[20];
    randomGen.nextBytes(bytes);
    return Base64.encode(bytes).toString();
  }
 catch (  final NoSuchAlgorithmException e) {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str");
  }
}

Fixed version (ground truth):
private String generatePassword() throws ServerApiException {
  try {
    final SecureRandom randomGen=SecureRandom.getInstance("String_Node_Str");
    final byte bytes[]=new byte[20];
    randomGen.nextBytes(bytes);
    return new String(Base64.encode(bytes),"String_Node_Str");
  }
 catch (  NoSuchAlgorithmException|UnsupportedEncodingException e) {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str");
  }
}
Program: 105330
Project: 105330
Buggy source:
private String generatePassword() throws ServerApiException {
  try {
    final SecureRandom randomGen=SecureRandom.getInstance("String_Node_Str");
    final byte bytes[]=new byte[20];
    randomGen.nextBytes(bytes);
    String encodedPassword=new String(Base64.encode(bytes));
    return encodedPassword;
  }
 catch (  final NoSuchAlgorithmException e) {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str");
  }
}

Fixed version (ground truth):
private String generatePassword() throws ServerApiException {
  try {
    final SecureRandom randomGen=SecureRandom.getInstance("String_Node_Str");
    final byte bytes[]=new byte[20];
    randomGen.nextBytes(bytes);
    return new String(Base64.encode(bytes),"String_Node_Str");
  }
 catch (  NoSuchAlgorithmException|UnsupportedEncodingException e) {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str");
  }
}
Program: 105332
Project: 105332
Buggy source:
public static String generateSignature(String data,String key){
  try {
    final Mac mac=Mac.getInstance("String_Node_Str");
    final SecretKeySpec keySpec=new SecretKeySpec(key.getBytes("String_Node_Str"),"String_Node_Str");
    mac.init(keySpec);
    mac.update(data.getBytes(Charset.defaultCharset()));
    final byte[] encryptedBytes=mac.doFinal();
    return Base64.encodeBase64String(encryptedBytes);
  }
 catch (  NoSuchAlgorithmException|InvalidKeyException|UnsupportedEncodingException e) {
    s_logger.error("String_Node_Str" + e.getMessage());
    throw new CloudRuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static String generateSignature(String data,String key){
  try {
    final Mac mac=Mac.getInstance("String_Node_Str");
    final SecretKeySpec keySpec=new SecretKeySpec(key.getBytes("String_Node_Str"),"String_Node_Str");
    mac.init(keySpec);
    mac.update(data.getBytes("String_Node_Str"));
    final byte[] encryptedBytes=mac.doFinal();
    return Base64.encodeBase64String(encryptedBytes);
  }
 catch (  NoSuchAlgorithmException|InvalidKeyException|UnsupportedEncodingException e) {
    s_logger.error("String_Node_Str" + e.getMessage());
    throw new CloudRuntimeException("String_Node_Str",e);
  }
}
Program: 105336
Project: 105336
Buggy source:
public static String generateSignature(String data,String key){
  try {
    final Mac mac=Mac.getInstance("String_Node_Str");
    final SecretKeySpec keySpec=new SecretKeySpec(key.getBytes(),"String_Node_Str");
    mac.init(keySpec);
    mac.update(data.getBytes());
    final byte[] encryptedBytes=mac.doFinal();
    return Base64.encodeBase64String(encryptedBytes);
  }
 catch (  NoSuchAlgorithmException|InvalidKeyException e) {
    s_logger.error("String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
public static String generateSignature(String data,String key){
  try {
    final Mac mac=Mac.getInstance("String_Node_Str");
    final SecretKeySpec keySpec=new SecretKeySpec(key.getBytes("String_Node_Str"),"String_Node_Str");
    mac.init(keySpec);
    mac.update(data.getBytes());
    final byte[] encryptedBytes=mac.doFinal();
    return Base64.encodeBase64String(encryptedBytes);
  }
 catch (  NoSuchAlgorithmException|InvalidKeyException|UnsupportedEncodingException e) {
    s_logger.error("String_Node_Str" + e.getMessage());
    throw new CloudRuntimeException("String_Node_Str",e);
  }
}
Program: 105338
Project: 105338
Buggy source:
public void processStartupAnswer(Answer answer,Response response,Link link){
  boolean cancelled=false;
synchronized (this) {
    if (_startup != null) {
      _startup.cancel();
      _startup=null;
    }
 else {
      cancelled=true;
    }
  }
  final StartupAnswer startup=(StartupAnswer)answer;
  if (!startup.getResult()) {
    s_logger.error("String_Node_Str" + answer.getDetails());
    System.exit(1);
  }
  if (cancelled) {
    s_logger.warn("String_Node_Str");
    return;
  }
  s_logger.info("String_Node_Str" + startup.getHostId());
  setId(startup.getHostId());
  _pingInterval=startup.getPingInterval() * 1000;
  setLastPingResponseTime();
  scheduleWatch(link,response,_pingInterval,_pingInterval);
  _ugentTaskPool.setKeepAliveTime(2 * _pingInterval,TimeUnit.MILLISECONDS);
  s_logger.info("String_Node_Str" + getId());
}

Fixed version (ground truth):
public void processStartupAnswer(Answer answer,Response response,Link link){
  boolean cancelled=false;
synchronized (this) {
    if (_startup != null) {
      _startup.cancel();
      _startup=null;
    }
 else {
      cancelled=true;
    }
  }
  final StartupAnswer startup=(StartupAnswer)answer;
  if (!startup.getResult()) {
    s_logger.error("String_Node_Str" + answer.getDetails());
    System.exit(1);
  }
  if (cancelled) {
    s_logger.warn("String_Node_Str");
    return;
  }
  s_logger.info("String_Node_Str" + startup.getHostId());
  setId(startup.getHostId());
  _pingInterval=(long)startup.getPingInterval() * 1000;
  setLastPingResponseTime();
  scheduleWatch(link,response,_pingInterval,_pingInterval);
  _ugentTaskPool.setKeepAliveTime(2 * _pingInterval,TimeUnit.MILLISECONDS);
  s_logger.info("String_Node_Str" + getId());
}
Program: 105339
Project: 105339
Buggy source:
private VirtualMachineGuru getVmGuru(VirtualMachine vm){
  return _vmGurus.get(vm.getType());
}

Fixed version (ground truth):
private VirtualMachineGuru getVmGuru(VirtualMachine vm){
  if (vm != null)   return _vmGurus.get(vm.getType());
  return null;
}
Program: 105340
Project: 105340
Buggy source:
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  super.configure(name,params);
  Map<String,String> configs=_configDao.getConfiguration(null,params);
  String globalStorageOverprovisioningFactor=configs.get("String_Node_Str");
  _storageOverprovisioningFactor=new BigDecimal(NumbersUtil.parseFloat(globalStorageOverprovisioningFactor,2.0f));
  _extraBytesPerVolume=0;
  _rand=new Random(System.currentTimeMillis());
  _dontMatter=Boolean.parseBoolean(configs.get("String_Node_Str"));
  String allocationAlgorithm=configs.get("String_Node_Str");
  if (allocationAlgorithm != null) {
    _allocationAlgorithm=allocationAlgorithm;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  super.configure(name,params);
  if (_configDao != null) {
    Map<String,String> configs=_configDao.getConfiguration(null,params);
    String globalStorageOverprovisioningFactor=configs.get("String_Node_Str");
    _storageOverprovisioningFactor=new BigDecimal(NumbersUtil.parseFloat(globalStorageOverprovisioningFactor,2.0f));
    _extraBytesPerVolume=0;
    _rand=new Random(System.currentTimeMillis());
    _dontMatter=Boolean.parseBoolean(configs.get("String_Node_Str"));
    String allocationAlgorithm=configs.get("String_Node_Str");
    if (allocationAlgorithm != null) {
      _allocationAlgorithm=allocationAlgorithm;
    }
    return true;
  }
  return false;
}
Program: 105341
Project: 105341
Buggy source:
@Override public void completeCall(Object returnObject){
  assert(_sourceAddress != null);
  assert(_targetAddress != null);
  RpcCallResponsePdu pdu=new RpcCallResponsePdu();
  pdu.setCommand(_requestPdu.getCommand());
  pdu.setRequestTag(_requestPdu.getRequestTag());
  pdu.setRequestStartTick(_requestPdu.getRequestStartTick());
  pdu.setRequestStartTick(RpcCallResponsePdu.RESULT_SUCCESSFUL);
  if (returnObject != null) {
    assert(_rpcProvider.getMessageSerializer() != null);
    pdu.setSerializedResult(_rpcProvider.getMessageSerializer().serializeTo(returnObject.getClass(),returnObject));
  }
  _rpcProvider.sendRpcPdu(_targetAddress,_sourceAddress,_rpcProvider.getMessageSerializer().serializeTo(RpcCallResponsePdu.class,pdu));
}

Fixed version (ground truth):
@Override public void completeCall(Object returnObject){
  assert(_sourceAddress != null);
  assert(_targetAddress != null);
  RpcCallResponsePdu pdu=new RpcCallResponsePdu();
  pdu.setCommand(_requestPdu.getCommand());
  pdu.setRequestTag(_requestPdu.getRequestTag());
  pdu.setRequestStartTick(_requestPdu.getRequestStartTick());
  pdu.setRequestStartTick(RpcCallResponsePdu.RESULT_SUCCESSFUL);
  if (returnObject != null) {
    assert(_rpcProvider.getMessageSerializer() != null);
    pdu.setSerializedResult(_rpcProvider.getMessageSerializer().serializeTo(returnObject.getClass(),returnObject));
  }
  _rpcProvider.sendRpcPdu(_sourceAddress,_targetAddress,_rpcProvider.getMessageSerializer().serializeTo(RpcCallResponsePdu.class,pdu));
}
Program: 105344
Project: 105344
Buggy source:
@Override public Answer createTemplateFromSnapshot(CopyCommand cmd){
  SnapshotObjectTO snapshot=(SnapshotObjectTO)cmd.getSrcTO();
  TemplateObjectTO template=(TemplateObjectTO)cmd.getDestTO();
  DataStoreTO imageStore=template.getDataStore();
  String details;
  String uniqeName=UUID.randomUUID().toString();
  VmwareContext context=hostService.getServiceContext(cmd);
  try {
    if (!(imageStore instanceof NfsTO)) {
      return new CopyCmdAnswer("String_Node_Str");
    }
    NfsTO nfsSvr=(NfsTO)imageStore;
    Ternary<String,Long,Long> result=createTemplateFromSnapshot(template.getPath(),uniqeName,nfsSvr.getUrl(),snapshot.getPath(),template.getId(),cmd.getWait() * 1000);
    TemplateObjectTO newTemplate=new TemplateObjectTO();
    newTemplate.setPath(result.first());
    newTemplate.setPhysicalSize(result.second());
    newTemplate.setSize(result.third());
    newTemplate.setFormat(ImageFormat.OVA);
    newTemplate.setName(uniqeName);
    return new CopyCmdAnswer(newTemplate);
  }
 catch (  Throwable e) {
    if (e instanceof RemoteException) {
      hostService.invalidateServiceContext(context);
    }
    s_logger.error("String_Node_Str",e);
    details="String_Node_Str" + VmwareHelper.getExceptionMessage(e);
    return new CopyCmdAnswer(details);
  }
}

Fixed version (ground truth):
@Override public Answer createTemplateFromSnapshot(CopyCommand cmd){
  SnapshotObjectTO snapshot=(SnapshotObjectTO)cmd.getSrcTO();
  TemplateObjectTO template=(TemplateObjectTO)cmd.getDestTO();
  DataStoreTO imageStore=template.getDataStore();
  String details;
  String uniqeName=UUID.randomUUID().toString();
  VmwareContext context=hostService.getServiceContext(cmd);
  try {
    if (!(imageStore instanceof NfsTO)) {
      return new CopyCmdAnswer("String_Node_Str");
    }
    NfsTO nfsSvr=(NfsTO)imageStore;
    Ternary<String,Long,Long> result=createTemplateFromSnapshot(template.getPath(),uniqeName,nfsSvr.getUrl(),snapshot.getPath(),template.getId(),(long)cmd.getWait() * 1000);
    TemplateObjectTO newTemplate=new TemplateObjectTO();
    newTemplate.setPath(result.first());
    newTemplate.setPhysicalSize(result.second());
    newTemplate.setSize(result.third());
    newTemplate.setFormat(ImageFormat.OVA);
    newTemplate.setName(uniqeName);
    return new CopyCmdAnswer(newTemplate);
  }
 catch (  Throwable e) {
    if (e instanceof RemoteException) {
      hostService.invalidateServiceContext(context);
    }
    s_logger.error("String_Node_Str",e);
    details="String_Node_Str" + VmwareHelper.getExceptionMessage(e);
    return new CopyCmdAnswer(details);
  }
}
Program: 105347
Project: 105347
Buggy source:
protected VDI cloudVDIcopy(Connection conn,VDI vdi,SR sr,int wait) throws Exception {
  Task task=null;
  if (wait == 0) {
    wait=2 * 60 * 60;
  }
  try {
    task=vdi.copyAsync(conn,sr);
    waitForTask(conn,task,1000,wait * 1000);
    checkForSuccess(conn,task);
    VDI dvdi=Types.toVDI(task,conn);
    return dvdi;
  }
  finally {
    if (task != null) {
      try {
        task.destroy(conn);
      }
 catch (      Exception e) {
        s_logger.debug("String_Node_Str" + task.toString() + "String_Node_Str"+ _host.uuid+ "String_Node_Str"+ e.toString());
      }
    }
  }
}

Fixed version (ground truth):
protected VDI cloudVDIcopy(Connection conn,VDI vdi,SR sr,int wait) throws Exception {
  Task task=null;
  if (wait == 0) {
    wait=2 * 60 * 60;
  }
  try {
    task=vdi.copyAsync(conn,sr);
    waitForTask(conn,task,1000,(long)wait * 1000);
    checkForSuccess(conn,task);
    VDI dvdi=Types.toVDI(task,conn);
    return dvdi;
  }
  finally {
    if (task != null) {
      try {
        task.destroy(conn);
      }
 catch (      Exception e) {
        s_logger.debug("String_Node_Str" + task.toString() + "String_Node_Str"+ _host.uuid+ "String_Node_Str"+ e.toString());
      }
    }
  }
}
Program: 105349
Project: 105349
Buggy source:
public static void setBasicVmConfig(VirtualMachineConfigSpec vmConfig,int cpuCount,int cpuSpeedMHz,int cpuReservedMhz,int memoryMB,int memoryReserveMB,String guestOsIdentifier,boolean limitCpuUse){
  vmConfig.setMemoryMB((long)memoryMB);
  vmConfig.setNumCPUs(cpuCount);
  ResourceAllocationInfo cpuInfo=new ResourceAllocationInfo();
  if (limitCpuUse) {
    cpuInfo.setLimit((long)(cpuSpeedMHz * cpuCount));
  }
 else {
    cpuInfo.setLimit(-1L);
  }
  cpuInfo.setReservation((long)cpuReservedMhz);
  vmConfig.setCpuAllocation(cpuInfo);
  if (cpuSpeedMHz != cpuReservedMhz) {
    vmConfig.setCpuHotAddEnabled(true);
  }
  if (memoryMB != memoryReserveMB) {
    vmConfig.setMemoryHotAddEnabled(true);
  }
  ResourceAllocationInfo memInfo=new ResourceAllocationInfo();
  memInfo.setLimit((long)memoryMB);
  memInfo.setReservation((long)memoryReserveMB);
  vmConfig.setMemoryAllocation(memInfo);
  vmConfig.setGuestId(guestOsIdentifier);
}

Fixed version (ground truth):
public static void setBasicVmConfig(VirtualMachineConfigSpec vmConfig,int cpuCount,int cpuSpeedMHz,int cpuReservedMhz,int memoryMB,int memoryReserveMB,String guestOsIdentifier,boolean limitCpuUse){
  vmConfig.setMemoryMB((long)memoryMB);
  vmConfig.setNumCPUs(cpuCount);
  ResourceAllocationInfo cpuInfo=new ResourceAllocationInfo();
  if (limitCpuUse) {
    cpuInfo.setLimit(((long)cpuSpeedMHz * cpuCount));
  }
 else {
    cpuInfo.setLimit(-1L);
  }
  cpuInfo.setReservation((long)cpuReservedMhz);
  vmConfig.setCpuAllocation(cpuInfo);
  if (cpuSpeedMHz != cpuReservedMhz) {
    vmConfig.setCpuHotAddEnabled(true);
  }
  if (memoryMB != memoryReserveMB) {
    vmConfig.setMemoryHotAddEnabled(true);
  }
  ResourceAllocationInfo memInfo=new ResourceAllocationInfo();
  memInfo.setLimit((long)memoryMB);
  memInfo.setReservation((long)memoryReserveMB);
  vmConfig.setMemoryAllocation(memInfo);
  vmConfig.setGuestId(guestOsIdentifier);
}
Program: 105351
Project: 105351
Buggy source:
public BcfAnswer(Command command,Exception e){
  super(command,e);
  this.hash="String_Node_Str";
}

Fixed version (ground truth):
public BcfAnswer(final Command command,final Exception e){
  super(command,e);
  this.hash="String_Node_Str";
}
Program: 105352
Project: 105352
Buggy source:
public void setTopology(TopologyData topology){
  this.topology=topology;
}

Fixed version (ground truth):
public void setTopology(final TopologyData topology){
  this.topology=topology;
}
Program: 105353
Project: 105353
Buggy source:
public CacheBcfTopologyCommand(TopologyData topology){
  this.topology=topology;
}

Fixed version (ground truth):
public CacheBcfTopologyCommand(final TopologyData topology){
  this._topology=topology;
}
Program: 105354
Project: 105354
Buggy source:
public TopologyData getTopology(){
  return topology;
}

Fixed version (ground truth):
public TopologyData getTopology(){
  return _topology;
}