nus-yam/ex-repair huggingface dataset:
Program: 36998
Project: 36998
Buggy source:
@Override public void readSonargraphReport(final Project project,final FileSystem fileSystem,final Settings settings){
  if (project == null) {
    LOG.error("String_Node_Str");
    return;
  }
  final String reportFileName=determineReportFileName(fileSystem,settings);
  LOG.info("String_Node_Str" + reportFileName);
  report=null;
  InputStream input=null;
  final ClassLoader defaultClassLoader=Thread.currentThread().getContextClassLoader();
  try {
    input=new FileInputStream(reportFileName);
    Thread.currentThread().setContextClassLoader(ReportFileReader.class.getClassLoader());
    final JAXBContext context=JAXBContext.newInstance("String_Node_Str");
    final Unmarshaller u=context.createUnmarshaller();
    report=(ReportContext)u.unmarshal(input);
  }
 catch (  final JAXBException e) {
    LOG.error("String_Node_Str" + reportFileName,e);
  }
catch (  final FileNotFoundException e) {
    if (project.isRoot()) {
      LOG.error("String_Node_Str" + reportFileName + "String_Node_Str");
      LOG.error("String_Node_Str" + "String_Node_Str");
      LOG.error("String_Node_Str" + "String_Node_Str");
    }
    LOG.debug("String_Node_Str",e);
  }
 finally {
    Thread.currentThread().setContextClassLoader(defaultClassLoader);
    if (input != null) {
      try {
        input.close();
      }
 catch (      final IOException e) {
        LOG.error("String_Node_Str" + reportFileName,e);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void readSonargraphReport(final Project project,final FileSystem fileSystem,final Settings settings){
  if (project == null) {
    LOG.error("String_Node_Str");
    return;
  }
  final String reportFileName=determineReportFileName(fileSystem,settings);
  LOG.info("String_Node_Str" + reportFileName);
  report=null;
  final ClassLoader defaultClassLoader=Thread.currentThread().getContextClassLoader();
  try (InputStream input=new FileInputStream(reportFileName)){
    Thread.currentThread().setContextClassLoader(ReportFileReader.class.getClassLoader());
    final JAXBContext context=JAXBContext.newInstance("String_Node_Str");
    final Unmarshaller u=context.createUnmarshaller();
    report=(ReportContext)u.unmarshal(input);
  }
 catch (  final JAXBException e) {
    LOG.error("String_Node_Str" + reportFileName,e);
  }
catch (  final FileNotFoundException e) {
    if (project.isRoot()) {
      LOG.error("String_Node_Str" + reportFileName + "String_Node_Str");
      LOG.error("String_Node_Str" + "String_Node_Str");
      LOG.error("String_Node_Str" + "String_Node_Str");
    }
    LOG.debug("String_Node_Str",e);
  }
catch (  final IOException e) {
    LOG.error("String_Node_Str" + reportFileName,e);
  }
 finally {
    Thread.currentThread().setContextClassLoader(defaultClassLoader);
  }
}
Program: 36999
Project: 36999
Buggy source:
public static String getBuildUnitName(String fqName){
  if (fqName == null) {
    return UNKNOWN;
  }
  int projectSeparatorPos=fqName.indexOf(PROJECT_BUILDUNIT_SEPARATOR);
  if (projectSeparatorPos == -1) {
    return UNKNOWN;
  }
  String buName=fqName.substring(projectSeparatorPos + 2);
  int groupSeparatorPos=buName.indexOf(GROUP_ARTIFACT_SEPARATOR);
  if (groupSeparatorPos > -1) {
    buName=buName.substring(groupSeparatorPos + 1);
  }
  if (DEFAULT_BUILD_UNIT.equals(buName)) {
    buName=fqName.substring(0,projectSeparatorPos);
  }
  return buName;
}

Fixed version (ground truth):
public static String getBuildUnitName(String fqName){
  if (fqName == null) {
    return UNKNOWN;
  }
  int projectSeparatorPos=fqName.indexOf(PROJECT_BUILDUNIT_SEPARATOR);
  if (projectSeparatorPos == -1) {
    return UNKNOWN;
  }
  String buName=fqName.substring(projectSeparatorPos + 2);
  if (DEFAULT_BUILD_UNIT.equals(buName)) {
    buName=fqName.substring(0,projectSeparatorPos);
  }
  return buName;
}
Program: 37000
Project: 37000
Buggy source:
@Test public void testBuildUnitMatchesAnalyzedProject(){
  String buildUnitName="String_Node_Str";
  assertTrue(Utilities.buildUnitMatchesAnalyzedProject(buildUnitName,new Project("String_Node_Str","String_Node_Str","String_Node_Str")));
  String projectKey="String_Node_Str";
  assertTrue(Utilities.buildUnitMatchesAnalyzedProject(buildUnitName,new Project(projectKey)));
  projectKey="String_Node_Str";
  assertTrue(Utilities.buildUnitMatchesAnalyzedProject(buildUnitName,new Project(projectKey)));
  projectKey="String_Node_Str";
  assertTrue(Utilities.buildUnitMatchesAnalyzedProject(buildUnitName,new Project(projectKey)));
  buildUnitName=Utilities.getBuildUnitName("String_Node_Str");
  assertEquals("String_Node_Str",buildUnitName);
  assertTrue(Utilities.buildUnitMatchesAnalyzedProject(buildUnitName,new Project("String_Node_Str")));
}

Fixed version (ground truth):
@Test public void testBuildUnitMatchesAnalyzedProject(){
  String buildUnitName="String_Node_Str";
  assertTrue(Utilities.buildUnitMatchesAnalyzedProject(buildUnitName,new Project("String_Node_Str","String_Node_Str","String_Node_Str")));
  String projectKey="String_Node_Str";
  assertTrue(Utilities.buildUnitMatchesAnalyzedProject(buildUnitName,new Project(projectKey)));
  projectKey="String_Node_Str";
  assertTrue(Utilities.buildUnitMatchesAnalyzedProject(buildUnitName,new Project(projectKey)));
  projectKey="String_Node_Str";
  assertTrue(Utilities.buildUnitMatchesAnalyzedProject(buildUnitName,new Project(projectKey)));
  buildUnitName=Utilities.getBuildUnitName("String_Node_Str");
  assertEquals("String_Node_Str",buildUnitName);
  Project project=new Project("String_Node_Str");
  assertTrue(Utilities.buildUnitMatchesAnalyzedProject(buildUnitName,project));
}
Program: 37001
Project: 37001
Buggy source:
void analyseCylceGroups(ReportContext report,XsdAttributeRoot buildUnit){
  XsdCycleGroups cycleGroups=report.getCycleGroups();
  double cyclicity=0;
  double biggestCycleGroupSize=0;
  double cyclicPackages=0;
  for (  XsdCycleGroup group : cycleGroups.getCycleGroup()) {
    if ("String_Node_Str".equals(group.getNamedElementGroup()) && getBuildUnitName(group).equals(Utilities.getBuildUnitName(buildUnit.getName()))) {
      int groupSize=group.getCyclePath().size();
      cyclicPackages+=groupSize;
      cyclicity+=groupSize * groupSize;
      if (groupSize > biggestCycleGroupSize) {
        biggestCycleGroupSize=groupSize;
      }
      handlePackageCycleGroup(group);
    }
  }
  saveMeasureToContext(SonargraphSystemMetrics.BIGGEST_CYCLE_GROUP,biggestCycleGroupSize,0);
  saveMeasureToContext(SonargraphBuildUnitMetrics.CYCLICITY,cyclicity,0);
  saveMeasureToContext(SonargraphBuildUnitMetrics.CYCLIC_PACKAGES,cyclicPackages,0);
}

Fixed version (ground truth):
void analyseCylceGroups(ReportContext report,XsdAttributeRoot buildUnit,Project project){
  LOG.debug("String_Node_Str" + buildUnit.getName());
  XsdCycleGroups cycleGroups=report.getCycleGroups();
  double cyclicity=0;
  double biggestCycleGroupSize=0;
  double cyclicPackages=0;
  for (  XsdCycleGroup group : cycleGroups.getCycleGroup()) {
    if ("String_Node_Str".equals(group.getNamedElementGroup()) && getBuildUnitName(group).equals(Utilities.getBuildUnitName(buildUnit.getName()))) {
      int groupSize=group.getCyclePath().size();
      cyclicPackages+=groupSize;
      cyclicity+=groupSize * groupSize;
      if (groupSize > biggestCycleGroupSize) {
        biggestCycleGroupSize=groupSize;
      }
      handlePackageCycleGroup(group);
    }
  }
  saveMeasureToContext(SonargraphSystemMetrics.BIGGEST_CYCLE_GROUP,biggestCycleGroupSize,0);
  saveMeasureToContext(SonargraphBuildUnitMetrics.CYCLICITY,cyclicity,0);
  if (project.isRoot()) {
    double packages=sensorContext.getMeasure(SonargraphBuildUnitMetrics.INTERNAL_PACKAGES).getValue();
    if (packages > 0) {
      double relCyclicity=100.0 * Math.sqrt(cyclicity) / packages;
      double relCyclicPackages=100.0 * cyclicPackages / packages;
      saveMeasureToContext(SonargraphSystemMetrics.RELATIVE_CYCLICITY,relCyclicity,0);
      saveMeasureToContext(SonargraphSystemMetrics.CYCLIC_PACKAGES_PERCENT,relCyclicPackages,1);
    }
 else {
      saveMeasureToContext(SonargraphSystemMetrics.RELATIVE_CYCLICITY,0,0);
      saveMeasureToContext(SonargraphSystemMetrics.CYCLIC_PACKAGES_PERCENT,0,1);
    }
  }
  saveMeasureToContext(SonargraphBuildUnitMetrics.CYCLIC_PACKAGES,cyclicPackages,0);
}
Program: 37003
Project: 37003
Buggy source:
void analyseSystemMeasures(ReportContext report,XsdAttributeRoot root){
  Map<String,Number> systemAttributes=new HashMap<String,Number>();
  Utilities.readAttributesToMap(report.getAttributes(),systemAttributes);
  saveMeasureToContext(SonargraphSystemMetrics.ARCHITECTURE_VIOLATIONS,getMetricValueFromMap(VIOLATING_REFERENCES,systemAttributes),0);
  saveMeasureToContext(SonargraphSystemMetrics.CYCLE_WARNINGS,getMetricValueFromMap(CYCLE_WARNINGS,systemAttributes),0);
  saveMeasureToContext(SonargraphSystemMetrics.WORKSPACE_WARNINGS,getMetricValueFromMap(WORKSPACE_WARNINGS,systemAttributes),0);
  saveMeasureToContext(SonargraphSystemMetrics.ALL_WARNINGS,getMetricValueFromMap(ALL_WARNINGS,systemAttributes),0);
}

Fixed version (ground truth):
void analyseSystemMeasures(ReportContext report,XsdAttributeRoot root){
  LOG.debug("String_Node_Str");
  Map<String,Number> systemAttributes=new HashMap<String,Number>();
  Utilities.readAttributesToMap(report.getAttributes(),systemAttributes);
  saveMeasureToContext(SonargraphSystemMetrics.ARCHITECTURE_VIOLATIONS,getMetricValueFromMap(VIOLATING_REFERENCES,systemAttributes),0);
  saveMeasureToContext(SonargraphSystemMetrics.CYCLE_WARNINGS,getMetricValueFromMap(CYCLE_WARNINGS,systemAttributes),0);
  saveMeasureToContext(SonargraphSystemMetrics.WORKSPACE_WARNINGS,getMetricValueFromMap(WORKSPACE_WARNINGS,systemAttributes),0);
  saveMeasureToContext(SonargraphSystemMetrics.ALL_WARNINGS,getMetricValueFromMap(ALL_WARNINGS,systemAttributes),0);
}
Program: 37004
Project: 37004
Buggy source:
void analyseBuildUnit(final ReportContext report,final XsdAttributeRoot buildUnit){
  Utilities.readAttributesToMap(buildUnit,buildUnitMetrics);
  Number internalPackages=this.getBuildUnitMetricValue(INTERNAL_PACKAGES);
  if (internalPackages.intValue() == 0) {
    LOG.warn("String_Node_Str" + buildUnit.getName());
    return;
  }
  saveExistingMeasureToContext(INTERNAL_PACKAGES,SonargraphBuildUnitMetrics.INTERNAL_PACKAGES,0);
  saveExistingMeasureToContext(ACD,SonargraphSystemMetrics.ACD,1);
  saveExistingMeasureToContext(NCCD,SonargraphSystemMetrics.NCCD,1);
  saveExistingMeasureToContext(INSTRUCTIONS,SonargraphBuildUnitMetrics.INSTRUCTIONS,0);
  saveExistingMeasureToContext(JAVA_FILES,SonargraphBuildUnitMetrics.JAVA_FILES,0);
  saveExistingMeasureToContext(TYPE_DEPENDENCIES,SonargraphBuildUnitMetrics.TYPE_DEPENDENCIES,0);
  saveExistingMeasureToContext(EROSION_REFS,SonargraphBuildUnitMetrics.EROSION_REFS,0);
  saveExistingMeasureToContext(EROSION_TYPES,SonargraphBuildUnitMetrics.EROSION_TYPES,0);
  saveExistingMeasureToContext(STUCTURAL_DEBT_INDEX,SonargraphBuildUnitMetrics.EROSION_INDEX,0).getValue();
}

Fixed version (ground truth):
void analyseBuildUnit(final ReportContext report,final XsdAttributeRoot buildUnit){
  LOG.debug("String_Node_Str" + buildUnit.getName());
  Utilities.readAttributesToMap(buildUnit,buildUnitMetrics);
  Number internalPackages=this.getBuildUnitMetricValue(INTERNAL_PACKAGES);
  if (internalPackages.intValue() == 0) {
    LOG.warn("String_Node_Str" + buildUnit.getName());
    return;
  }
  saveExistingMeasureToContext(INTERNAL_PACKAGES,SonargraphBuildUnitMetrics.INTERNAL_PACKAGES,0);
  saveExistingMeasureToContext(ACD,SonargraphSystemMetrics.ACD,1);
  saveExistingMeasureToContext(NCCD,SonargraphSystemMetrics.NCCD,1);
  saveExistingMeasureToContext(INSTRUCTIONS,SonargraphBuildUnitMetrics.INSTRUCTIONS,0);
  saveExistingMeasureToContext(JAVA_FILES,SonargraphBuildUnitMetrics.JAVA_FILES,0);
  saveExistingMeasureToContext(TYPE_DEPENDENCIES,SonargraphBuildUnitMetrics.TYPE_DEPENDENCIES,0);
  saveExistingMeasureToContext(EROSION_REFS,SonargraphBuildUnitMetrics.EROSION_REFS,0);
  saveExistingMeasureToContext(EROSION_TYPES,SonargraphBuildUnitMetrics.EROSION_TYPES,0);
  saveExistingMeasureToContext(STUCTURAL_DEBT_INDEX,SonargraphBuildUnitMetrics.EROSION_INDEX,0).getValue();
}
Program: 37008
Project: 37008
Buggy source:
void handleDuplicateCodeBlocks(XsdWarningsByAttributeGroup warningGroup,Rule rule){
  Map<Integer,List<DuplicateCodeBlock>> duplicateCodeBlocks=new HashMap<Integer,List<DuplicateCodeBlock>>();
  for (  XsdWarningsByAttribute warnings : warningGroup.getWarningsByAttribute()) {
    for (    XsdWarning warning : warnings.getWarning()) {
      DuplicateCodeBlock block=Utilities.createDuplicateCodeBlock(warning);
      if (null == block) {
        continue;
      }
      if (!duplicateCodeBlocks.containsKey(block.getBlockId())) {
        duplicateCodeBlocks.put(block.getBlockId(),new ArrayList<DuplicateCodeBlock>());
      }
      duplicateCodeBlocks.get(block.getBlockId()).add(block);
    }
  }
  for (  Entry<Integer,List<DuplicateCodeBlock>> entry : duplicateCodeBlocks.entrySet()) {
    for (    DuplicateCodeBlock block : entry.getValue()) {
      String message=Utilities.generateDuplicateCodeBlockMessage(block,entry.getValue());
      String fqName=Utilities.relativeFileNameToFqName(block.getElementName());
      saveViolation(rule,null,fqName,block.getStartLine(),message);
    }
  }
}

Fixed version (ground truth):
void handleDuplicateCodeBlocks(XsdWarningsByAttributeGroup warningGroup,Rule rule){
  LOG.debug("String_Node_Str");
  Map<Integer,List<DuplicateCodeBlock>> duplicateCodeBlocks=new HashMap<Integer,List<DuplicateCodeBlock>>();
  for (  XsdWarningsByAttribute warnings : warningGroup.getWarningsByAttribute()) {
    for (    XsdWarning warning : warnings.getWarning()) {
      DuplicateCodeBlock block=Utilities.createDuplicateCodeBlock(warning);
      if (null == block) {
        continue;
      }
      if (!duplicateCodeBlocks.containsKey(block.getBlockId())) {
        duplicateCodeBlocks.put(block.getBlockId(),new ArrayList<DuplicateCodeBlock>());
      }
      duplicateCodeBlocks.get(block.getBlockId()).add(block);
    }
  }
  for (  Entry<Integer,List<DuplicateCodeBlock>> entry : duplicateCodeBlocks.entrySet()) {
    for (    DuplicateCodeBlock block : entry.getValue()) {
      String message=Utilities.generateDuplicateCodeBlockMessage(block,entry.getValue());
      String fqName=Utilities.relativeFileNameToFqName(block.getElementName());
      saveViolation(rule,null,fqName,block.getStartLine(),message);
    }
  }
}
Program: 37009
Project: 37009
Buggy source:
/** 
 * Unmarshals the Sonargraph Report into a ReportContext
 * @param reportFileName the file name of the Sonargraph Report to be opened
 * @return {@link ReportContext} if successful, null otherwise
 */
public static ReportContext readSonargraphReport(String reportFileName){
  ReportContext result=null;
  InputStream input=null;
  ClassLoader defaultClassLoader=Thread.currentThread().getContextClassLoader();
  try {
    input=new FileInputStream(reportFileName);
    Thread.currentThread().setContextClassLoader(ReportFileReader.class.getClassLoader());
    JAXBContext context=JAXBContext.newInstance("String_Node_Str");
    Unmarshaller u=context.createUnmarshaller();
    result=(ReportContext)u.unmarshal(input);
  }
 catch (  JAXBException e) {
    LOG.error("String_Node_Str" + reportFileName,e);
  }
catch (  FileNotFoundException e) {
    LOG.error("String_Node_Str" + reportFileName + "String_Node_Str");
    LOG.error("String_Node_Str" + "String_Node_Str");
    LOG.error("String_Node_Str" + "String_Node_Str");
  }
 finally {
    Thread.currentThread().setContextClassLoader(defaultClassLoader);
    if (input != null) {
      try {
        input.close();
      }
 catch (      IOException e) {
        LOG.error("String_Node_Str" + reportFileName,e);
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Unmarshals the Sonargraph Report into a ReportContext
 * @param reportFileName the file name of the Sonargraph Report to be opened
 * @param isRoot specifies if this project is the root project or a module
 * @return {@link ReportContext} if successful, null otherwise
 */
public static ReportContext readSonargraphReport(String reportFileName,boolean isRoot){
  ReportContext result=null;
  InputStream input=null;
  ClassLoader defaultClassLoader=Thread.currentThread().getContextClassLoader();
  try {
    input=new FileInputStream(reportFileName);
    Thread.currentThread().setContextClassLoader(ReportFileReader.class.getClassLoader());
    JAXBContext context=JAXBContext.newInstance("String_Node_Str");
    Unmarshaller u=context.createUnmarshaller();
    result=(ReportContext)u.unmarshal(input);
  }
 catch (  JAXBException e) {
    LOG.error("String_Node_Str" + reportFileName,e);
  }
catch (  FileNotFoundException e) {
    if (isRoot) {
      LOG.error("String_Node_Str" + reportFileName + "String_Node_Str");
      LOG.error("String_Node_Str" + "String_Node_Str");
      LOG.error("String_Node_Str" + "String_Node_Str");
    }
  }
 finally {
    Thread.currentThread().setContextClassLoader(defaultClassLoader);
    if (input != null) {
      try {
        input.close();
      }
 catch (      IOException e) {
        LOG.error("String_Node_Str" + reportFileName,e);
      }
    }
  }
  return result;
}
Program: 37011
Project: 37011
Buggy source:
public static ReportContext initReport(){
  ReportContext report=ReportFileReader.readSonargraphReport(REPORT);
  assertNotNull(report);
  return report;
}

Fixed version (ground truth):
public static ReportContext initReport(){
  ReportContext report=ReportFileReader.readSonargraphReport(REPORT,false);
  assertNotNull(report);
  return report;
}
Program: 37012
Project: 37012
Buggy source:
@Test public void testAnalyse(){
  Project project=TestHelper.initProject();
  sensor.analyse(project,sensorContext);
}

Fixed version (ground truth):
@Test public void testAnalyse(){
  Project project=new Project("String_Node_Str","String_Node_Str","String_Node_Str");
  project.setConfiguration(TestHelper.initConfig());
  sensor.analyse(project,sensorContext);
  double value=sensorContext.getMeasure(SonargraphSystemMetrics.WORKSPACE_WARNINGS).getValue().doubleValue();
  assertEquals(0.0,value,0.01);
}
Program: 37013
Project: 37013
Buggy source:
/** 
 * Test method for   {@link com.hello2morrow.sonarplugin.foundation.ReportFileReader#readSonargraphReport(java.lang.String)}.
 */
@Test public void testReadSonargraphReport(){
  assertNotNull(ReportFileReader.readSonargraphReport(reportFileName));
  assertNull(ReportFileReader.readSonargraphReport("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.hello2morrow.sonarplugin.foundation.ReportFileReader#readSonargraphReport(java.lang.String)}.
 */
@Test public void testReadSonargraphReport(){
  assertNotNull(ReportFileReader.readSonargraphReport(reportFileName,false));
  assertNull(ReportFileReader.readSonargraphReport("String_Node_Str",false));
}
Program: 37014
Project: 37014
Buggy source:
public Build addRequestParams(String key,String value){
  return this;
}

Fixed version (ground truth):
public Build addRequestParams(String key,Object value){
  if (requestParams == null) {
    requestParams=new HashMap<String,Object>();
  }
  requestParams.put(key,value);
  return this;
}
Program: 37015
Project: 37015
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected Version checkUpdateInTask(ContextWrapper wrapper){
  log.debug("String_Node_Str");
  Object response=null;
  AppUpdateServiceConfiguration config=wrapper.getConfiguration();
  ResponseDelivery responseDelivery=config.getResponseDelivery();
  RequestInfo info=config.getRequestInfo();
  try {
    wrapper.append("String_Node_Str");
    response=responseDelivery.submitRequest(info);
    log.trace("String_Node_Str" + response.toString());
  }
 catch (  IOException exp) {
    log.error("String_Node_Str",exp);
    wrapper.setRequestError(true);
    wrapper.append("String_Node_Str");
  }
  Version version=null;
  if (response != null) {
    try {
      wrapper.append("String_Node_Str");
      version=responseDelivery.parserResponse(response);
      log.trace("String_Node_Str" + version.toString());
    }
 catch (    Exception exp) {
      log.error("String_Node_Str",exp);
      wrapper.setParserResponseError(true);
      wrapper.append("String_Node_Str");
    }
  }
 else {
    log.trace("String_Node_Str");
    wrapper.append("String_Node_Str");
  }
  wrapper.setVersion(version);
  return version;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected Version checkUpdateInTask(ContextWrapper wrapper){
  log.debug("String_Node_Str");
  Object response=null;
  AppUpdateServiceConfiguration config=wrapper.getConfiguration();
  ResponseDelivery responseDelivery=config.getResponseDelivery();
  RequestInfo info=config.getRequestInfo();
  try {
    wrapper.append("String_Node_Str");
    response=responseDelivery.submitRequest(info);
  }
 catch (  Throwable exp) {
    log.error("String_Node_Str",exp);
    wrapper.setRequestError(true);
    wrapper.append("String_Node_Str");
  }
  Version version=null;
  if (response != null) {
    try {
      wrapper.append("String_Node_Str");
      version=responseDelivery.parserResponse(response);
      log.trace("String_Node_Str" + version.toString());
    }
 catch (    Exception exp) {
      log.error("String_Node_Str",exp);
      wrapper.setParserResponseError(true);
      wrapper.append("String_Node_Str");
    }
  }
 else {
    log.trace("String_Node_Str");
    wrapper.append("String_Node_Str");
  }
  wrapper.setVersion(version);
  return version;
}
Program: 37017
Project: 37017
Buggy source:
public Version parserResponse(String response) throws Exception {
  log.debug("String_Node_Str");
  Version version=null;
  try {
    response=response.substring(response.indexOf("String_Node_Str"),response.lastIndexOf("String_Node_Str") + 1);
    log.trace("String_Node_Str" + response);
    JSONObject json=new JSONObject(response);
    if (json.has(ROOT_NODE) && !json.isNull(ROOT_NODE)) {
      log.trace("String_Node_Str");
      json=json.getJSONObject(ROOT_NODE);
    }
    version=new Version();
    version.setApp(json.getString("String_Node_Str"));
    version.setCode(json.getInt("String_Node_Str"));
    version.setName(json.getString("String_Node_Str"));
    version.setTitle(json.getString("String_Node_Str"));
    version.setDescription(json.getString("String_Node_Str"));
    version.setReleaseTime(new Date(json.getLong("String_Node_Str")));
    version.setTargetUrl(json.getString("String_Node_Str"));
    version.setMD5(json.getString("String_Node_Str"));
    version.setSHA1(json.getString("String_Node_Str"));
  }
 catch (  JSONException e) {
    log.warning("String_Node_Str",e);
    version=null;
  }
  return version;
}

Fixed version (ground truth):
public Version parserResponse(String response) throws Exception {
  log.debug("String_Node_Str");
  Version version=null;
  try {
    response=response.substring(response.indexOf("String_Node_Str"),response.lastIndexOf("String_Node_Str") + 1);
    JSONObject json=new JSONObject(response);
    if (json.has(ROOT_NODE) && !json.isNull(ROOT_NODE)) {
      log.trace("String_Node_Str");
      json=json.getJSONObject(ROOT_NODE);
    }
    version=new Version();
    version.setApp(json.getString("String_Node_Str"));
    version.setCode(json.getInt("String_Node_Str"));
    version.setName(json.getString("String_Node_Str"));
    version.setTitle(json.getString("String_Node_Str"));
    version.setDescription(json.getString("String_Node_Str"));
    version.setReleaseTime(new Date(json.getLong("String_Node_Str")));
    version.setTargetUrl(json.getString("String_Node_Str"));
    version.setMD5(json.getString("String_Node_Str"));
    version.setSHA1(json.getString("String_Node_Str"));
  }
 catch (  JSONException e) {
    log.warning("String_Node_Str",e);
    version=null;
  }
  return version;
}
Program: 37018
Project: 37018
Buggy source:
/** 
 * Process count value according to SCIM 2.0 specification
 * @param countStr
 * @return
 * @throws BadRequestException
 */
public static int processCount(String countStr) throws BadRequestException {
  int count=0;
  if (countStr == null) {
    count=CharonConfiguration.getInstance().getCountValueForPagination();
  }
  try {
    count=Integer.parseInt(countStr);
  }
 catch (  NumberFormatException e) {
    throw new BadRequestException("String_Node_Str");
  }
  if (count < 0) {
    count=0;
  }
  return count;
}

Fixed version (ground truth):
/** 
 * Process count value according to SCIM 2.0 specification
 * @param countStr
 * @return
 * @throws BadRequestException
 */
public static int processCount(String countStr) throws BadRequestException {
  int count;
  if (countStr == null || countStr.isEmpty()) {
    count=CharonConfiguration.getInstance().getCountValueForPagination();
  }
 else {
    try {
      count=Integer.parseInt(countStr);
    }
 catch (    NumberFormatException e) {
      throw new BadRequestException("String_Node_Str");
    }
  }
  if (count < 0) {
    count=0;
  }
  return count;
}
Program: 37021
Project: 37021
Buggy source:
/** 
 * Encode given bulkResponseData object and return the encoded string
 * @param bulkResponseData
 * @return
 */
public String encodeBulkResponseData(BulkResponseData bulkResponseData) throws InternalErrorException {
  String encodedString="String_Node_Str";
  List<BulkResponseContent> userResponseDataList=bulkResponseData.getUserOperationResponse();
  List<BulkResponseContent> groupResponseDataList=bulkResponseData.getGroupOperationResponse();
  JSONObject rootObject=new JSONObject();
  try {
    this.encodeArrayOfValues(SCIMConstants.CommonSchemaConstants.SCHEMAS,bulkResponseData.getSchemas().toArray(),rootObject);
    ArrayList<JSONObject> operationResponseList=new ArrayList<>();
    for (    BulkResponseContent userOperationResponse : userResponseDataList) {
      encodeResponseContent(userOperationResponse,operationResponseList);
    }
    for (    BulkResponseContent groupOperationResponse : groupResponseDataList) {
      encodeResponseContent(groupOperationResponse,operationResponseList);
    }
    this.encodeArrayOfValues(SCIMConstants.OperationalConstants.OPERATIONS,operationResponseList.toArray(),rootObject);
    encodedString=rootObject.toString();
  }
 catch (  JSONException e) {
    throw new InternalErrorException("String_Node_Str");
  }
  return encodedString;
}

Fixed version (ground truth):
public String encodeBulkResponseData(BulkResponseData bulkResponseData) throws InternalErrorException {
  String encodedString="String_Node_Str";
  List<BulkResponseContent> userResponseDataList=bulkResponseData.getUserOperationResponse();
  List<BulkResponseContent> groupResponseDataList=bulkResponseData.getGroupOperationResponse();
  JSONObject rootObject=new JSONObject();
  try {
    this.encodeArrayOfValues(SCIMConstants.CommonSchemaConstants.SCHEMAS,bulkResponseData.getSchemas().toArray(),rootObject);
    ArrayList<JSONObject> operationResponseList=new ArrayList<>();
    for (    BulkResponseContent userOperationResponse : userResponseDataList) {
      encodeResponseContent(userOperationResponse,operationResponseList);
    }
    for (    BulkResponseContent groupOperationResponse : groupResponseDataList) {
      encodeResponseContent(groupOperationResponse,operationResponseList);
    }
    this.encodeArrayOfValues(SCIMConstants.OperationalConstants.OPERATIONS,operationResponseList.toArray(),rootObject);
    encodedString=rootObject.toString();
  }
 catch (  JSONException e) {
    throw new InternalErrorException("String_Node_Str");
  }
  return encodedString;
}
Program: 37024
Project: 37024
Buggy source:
public String getExcludedAttributesAsString(){
  String excludedAttributes=null;
  StringBuffer str=new StringBuffer();
  for (  String attributeValue : this.excludedAttributes) {
    str.append("String_Node_Str").append(attributeValue);
  }
  excludedAttributes=str.toString();
  return excludedAttributes;
}

Fixed version (ground truth):
public String getExcludedAttributesAsString(){
  String excludedAttributes=null;
  StringBuffer str=new StringBuffer();
  for (  String attributeValue : this.excludedAttributes) {
    str.append("String_Node_Str").append(attributeValue);
  }
  excludedAttributes=str.toString();
  if (excludedAttributes.equals("String_Node_Str")) {
    return null;
  }
  return excludedAttributes;
}
Program: 37025
Project: 37025
Buggy source:
public String getAttributesAsString(){
  String attributes=null;
  StringBuffer str=new StringBuffer();
  for (  String attributeValue : this.attributes) {
    str.append("String_Node_Str").append(attributeValue);
  }
  attributes=str.toString();
  return attributes;
}

Fixed version (ground truth):
public String getAttributesAsString(){
  String attributes=null;
  StringBuffer str=new StringBuffer();
  for (  String attributeValue : this.attributes) {
    str.append("String_Node_Str").append(attributeValue);
  }
  attributes=str.toString();
  if (attributes.equals("String_Node_Str")) {
    return null;
  }
  return attributes;
}
Program: 37027
Project: 37027
Buggy source:
public Group getGroup(String id,Map<String,Boolean> requiredAttributes) throws NotImplementedException, BadRequestException, CharonException ;

Fixed version (ground truth):
public Group getGroup(String id,Map<String,Boolean> requiredAttributes) throws NotImplementedException, BadRequestException, CharonException, NotFoundException ;
Program: 37028
Project: 37028
Buggy source:
/** 
 * Decode the listed resource sent in the payload of response for filter/retrieve requests.
 * @param scimString
 * @return
 * @throws CharonException
 */
public ListedResource decodeListedResource(String scimString,ResourceSchema resourceSchemaOfListedResource,AbstractSCIMObject scimObjectOfListedResource) throws CharonException, BadRequestException {
  ListedResource listedResource=null;
  try {
    JSONObject decodedJsonObj=new JSONObject(new JSONTokener(scimString));
    Object totalResults=decodedJsonObj.opt(SCIMConstants.ListedResourcesConstants.TOTAL_RESULTS);
    listedResource=new ListedResource();
    listedResource.setTotalResults((Integer)totalResults);
    Object resources=decodedJsonObj.opt(SCIMConstants.ListedResourcesConstants.RESOURCES);
    List<SCIMObject> scimObjects=new ArrayList<SCIMObject>();
    for (int i=0; i < (((JSONArray)resources).length()); i++) {
      String scimResourceString=((JSONArray)resources).getString(i);
      SCIMObject scimObject=this.decodeResource(scimResourceString,resourceSchemaOfListedResource,scimObjectOfListedResource);
      scimObjects.add(scimObject);
    }
    listedResource.setScimObjects(scimObjects);
  }
 catch (  JSONException e) {
    String error="String_Node_Str";
    throw new BadRequestException();
  }
  return listedResource;
}

Fixed version (ground truth):
/** 
 * Decode the listed resource sent in the payload of response for filter/retrieve requests.
 * @param scimString
 * @return
 * @throws CharonException
 */
public ListedResource decodeListedResource(String scimString,ResourceSchema resourceSchemaOfListedResource,AbstractSCIMObject scimObjectOfListedResource) throws CharonException, BadRequestException {
  ListedResource listedResource=null;
  try {
    JSONObject decodedJsonObj=new JSONObject(new JSONTokener(scimString));
    Object totalResults=decodedJsonObj.opt(SCIMConstants.ListedResourcesConstants.TOTAL_RESULTS);
    listedResource=new ListedResource();
    listedResource.setTotalResults((Integer)totalResults);
    Object resources=decodedJsonObj.opt(SCIMConstants.ListedResourcesConstants.RESOURCES);
    List<SCIMObject> scimObjects=new ArrayList<SCIMObject>();
    for (int i=0; i < (((JSONArray)resources).length()); i++) {
      Object object=((JSONArray)resources).get(i);
      String scimResourceString=null;
      if (object instanceof String) {
        scimResourceString=((JSONArray)resources).getString(i);
      }
 else       if (object instanceof JSONObject) {
        scimResourceString=((JSONArray)resources).getJSONObject(i).toString();
      }
      SCIMObject scimObject=this.decodeResource(scimResourceString,resourceSchemaOfListedResource,scimObjectOfListedResource);
      scimObjects.add(scimObject);
    }
    listedResource.setScimObjects(scimObjects);
  }
 catch (  JSONException e) {
    String error="String_Node_Str";
    throw new BadRequestException();
  }
  return listedResource;
}
Program: 37029
Project: 37029
Buggy source:
public long getLargestPalindrome(long N){
  N--;
  if (Utils.isPalindrome(N)) {
    return N;
  }
 else {
    return getLargestPalindrome(N);
  }
}

Fixed version (ground truth):
public long getLargestPalindrome(long N){
  N--;
  if (Utils.isPalindrome(N)) {
    return N;
  }
 else {
    return getLargestPalindrome(N - 1);
  }
}
Program: 37030
Project: 37030
Buggy source:
public static long kthFac(int k,int n){
  long res=1;
  long limit=n;
  for (long i=2; i <= limit; i++) {
    res*=i;
    if (i == limit && k > 1) {
      k--;
      limit=res;
    }
  }
  return res;
}

Fixed version (ground truth):
public static long kthFac(int k,int n){
  long res=1;
  long limit=n;
  for (long i=2; i <= limit; i++) {
    res*=i;
    if (i == limit && k > 0) {
      k--;
      limit=res;
    }
  }
  return res;
}
Program: 37031
Project: 37031
Buggy source:
@Test public void test(){
  assertEquals(1,FaultyProblem5.kthFac(0,1));
  assertEquals(2,FaultyProblem5.kthFac(1,2));
  assertEquals(720,FaultyProblem5.kthFac(3,3));
}

Fixed version (ground truth):
@Test public void test(){
  assertEquals(1,FaultyProblem5.kthFac(0,1));
  assertEquals(2,FaultyProblem5.kthFac(1,2));
  assertEquals(720,FaultyProblem5.kthFac(2,3));
}
Program: 37032
Project: 37032
Buggy source:
@Test public void test(){
  assertEquals(1,FaultyProblem6.pow(1,999999999));
  assertEquals(8,FaultyProblem6.pow(2,3));
  assertEquals(16,FaultyProblem6.pow(2,4));
  assertEquals(4,FaultyProblem6.pow(4,0));
}

Fixed version (ground truth):
@Test public void test(){
  assertEquals(1,FaultyProblem6.pow(1,999999999));
  assertEquals(8,FaultyProblem6.pow(2,3));
  assertEquals(16,FaultyProblem6.pow(2,4));
  assertEquals(1,FaultyProblem6.pow(4,0));
}
Program: 37033
Project: 37033
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  boolean result=true;
switch (item.getItemId()) {
case R.id.action_itinerary:
    computeItinerary();
  result=false;
break;
case R.id.action_route:
computeOptimizedItinerary();
result=false;
break;
case R.id.action_locate_ext_poi:
locateExtPoi();
result=false;
break;
case R.id.action_clear_itinerary:
mItineraryRenderer.clear();
result=false;
break;
case R.id.action_clear_all:
mItineraryRenderer.clear();
mMapView.clearRenderer(GfxRto.class);
result=false;
break;
case R.id.action_information:
displayUIInformation();
result=false;
break;
case R.id.action_switch_site:
MainActivity act=(MainActivity)getActivity();
result=false;
break;
}
return result;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  boolean result=true;
switch (item.getItemId()) {
case R.id.action_itinerary:
    computeItinerary();
  result=false;
break;
case R.id.action_route:
computeOptimizedItinerary();
result=false;
break;
case R.id.action_locate_ext_poi:
locateExtPoi();
result=false;
break;
case R.id.action_clear_itinerary:
if (mItineraryRenderer != null) {
mItineraryRenderer.clear();
}
result=false;
break;
case R.id.action_clear_all:
if (mItineraryRenderer != null) {
mItineraryRenderer.clear();
}
mMapView.clearRenderer(GfxRto.class);
result=false;
break;
case R.id.action_information:
displayUIInformation();
result=false;
break;
case R.id.action_switch_site:
MainActivity act=(MainActivity)getActivity();
result=false;
break;
}
return result;
}
Program: 37034
Project: 37034
Buggy source:
/** 
 * This method shows how to compute an itinerary between two points
 */
private void computeItinerary(){
  mItineraryRenderer.setDisplayEnabled(false);
  ISPosition arrival=new ISPosition(mMapView.getMapId(),20,20);
  mItineraryProvider.requestItineraryFromCurrentLocation(arrival,true,this,PMR_ENABLED);
  if (!ISLocationProvider.getInstance().isStarted()) {
    startLocation();
  }
}

Fixed version (ground truth):
/** 
 * This method shows how to compute an itinerary between two points
 */
private void computeItinerary(){
  if (mItineraryRenderer != null) {
    mItineraryRenderer.setDisplayEnabled(false);
  }
  if (mItineraryProvider != null) {
    ISPosition arrival=new ISPosition(mMapView.getMapId(),20,20);
    mItineraryProvider.requestItineraryFromCurrentLocation(arrival,true,this,PMR_ENABLED);
  }
  if (!ISLocationProvider.getInstance().isStarted()) {
    startLocation();
  }
}
Program: 37035
Project: 37035
Buggy source:
/** 
 * This method shows how to compute a route between different positions
 */
private void computeOptimizedItinerary(){
  int positionNbr=4;
  ArrayList<ISPosition> pos=new ArrayList<ISPosition>();
  for (int i=0; i < positionNbr; i++) {
    double x=Math.random() * 50;
    double y=Math.random() * 50;
    if (mMaps.size() > 1 && i > positionNbr / 2) {
      ISMap otherMap=null;
      for (      ISMap map : mMaps) {
        if (map.getId() != mCurrentMap.getId()) {
          otherMap=map;
          break;
        }
      }
      if (otherMap != null) {
        ISPosition p=new ISPosition(otherMap.getId(),x,y);
        pos.add(p);
      }
    }
 else {
      ISPosition p=new ISPosition(mCurrentMap.getId(),x,y);
      pos.add(p);
    }
  }
  mItineraryProvider.requestOptimizedItinerary(pos,ISItineraryProvider.ISEOptimizationMode.NearestNeighbourShortestPath,true,false,this,false);
}

Fixed version (ground truth):
/** 
 * This method shows how to compute a route between different positions
 */
private void computeOptimizedItinerary(){
  int positionNbr=4;
  ArrayList<ISPosition> pos=new ArrayList<ISPosition>();
  for (int i=0; i < positionNbr; i++) {
    double x=Math.random() * 50;
    double y=Math.random() * 50;
    if (mMaps.size() > 1 && i > positionNbr / 2) {
      ISMap otherMap=null;
      for (      ISMap map : mMaps) {
        if (map.getId() != mCurrentMap.getId()) {
          otherMap=map;
          break;
        }
      }
      if (otherMap != null) {
        ISPosition p=new ISPosition(otherMap.getId(),x,y);
        pos.add(p);
      }
    }
 else {
      ISPosition p=new ISPosition(mCurrentMap.getId(),x,y);
      pos.add(p);
    }
  }
  if (mItineraryProvider != null) {
    mItineraryProvider.requestOptimizedItinerary(pos,ISItineraryProvider.ISEOptimizationMode.NearestNeighbourShortestPath,true,false,this,false);
  }
}
Program: 37036
Project: 37036
Buggy source:
/** 
 * Callback for itinerary request completion
 * @param aSuccess true if the request was successful
 * @param aRequest the request object containing itinerary data
 * @param error an error object containing a code and a message, null if request was successful 
 */
@Override public void onItineraryRequestDone(boolean aSuccess,ISItineraryProvider.ISBaseRequest aRequest,final ISError error){
  if (aSuccess)   mItineraryRenderer.setDisplayEnabled(true);
 else {
    String message=getString(R.string.error_itinerary_computation_failed) + "String_Node_Str" + error;
    Crouton.makeText(getActivity(),message,Style.ALERT).show();
  }
}

Fixed version (ground truth):
/** 
 * Callback for itinerary request completion
 * @param aSuccess true if the request was successful
 * @param aRequest the request object containing itinerary data
 * @param error an error object containing a code and a message, null if request was successful 
 */
@Override public void onItineraryRequestDone(boolean aSuccess,ISItineraryProvider.ISBaseRequest aRequest,final ISError error){
  if (aSuccess) {
    if (mItineraryRenderer != null) {
      mItineraryRenderer.setDisplayEnabled(true);
    }
  }
 else {
    String message=getString(R.string.error_itinerary_computation_failed) + "String_Node_Str" + error;
    Crouton.makeText(getActivity(),message,Style.ALERT).show();
  }
}
Program: 37037
Project: 37037
Buggy source:
protected void messageReceived(ChannelHandlerContext ctx,String msg) throws Exception {
  LOGGER.info("String_Node_Str",msg);
  if (StringUtils.isBlank(msg) || !StringUtils.equals(CMD_SHUTDOWN,msg)) {
    ChannelFuture future=ctx.writeAndFlush("String_Node_Str" + msg);
    future.addListener(ChannelFutureListener.CLOSE).channel().close();
    return;
  }
  ChannelFuture future=ctx.writeAndFlush("String_Node_Str");
  ctx.writeAndFlush(ManageServerInitializer.LINE_DELIMITER);
  LOGGER.info("String_Node_Str");
  Main.doShutdown();
  LOGGER.info("String_Node_Str");
  future.addListener(ChannelFutureListener.CLOSE).channel().close();
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * messageReceived.
 * @param ctx ctx.
 * @param msg msg.
 * @throws Exception Exception.
 */
protected void messageReceived(ChannelHandlerContext ctx,String msg) throws Exception {
  LOGGER.info("String_Node_Str",msg);
  if (StringUtils.isBlank(msg) || !StringUtils.equals(CMD_SHUTDOWN,msg)) {
    ChannelFuture future=ctx.writeAndFlush("String_Node_Str" + msg);
    future.addListener(ChannelFutureListener.CLOSE).channel().close();
    return;
  }
  ChannelFuture future=ctx.writeAndFlush("String_Node_Str");
  ctx.writeAndFlush(ManageServerInitializer.LINE_DELIMITER);
  LOGGER.info("String_Node_Str");
  Main.doShutdown();
  LOGGER.info("String_Node_Str");
  future.addListener(ChannelFutureListener.CLOSE).channel().close();
  LOGGER.info("String_Node_Str");
}
Program: 37038
Project: 37038
Buggy source:
/** 
 * run server.
 * @throws Exception Exception.
 */
public ChannelFuture start() throws Exception {
  ServerBootstrap bootstrap=new ServerBootstrap();
  bootstrap.group(bossGroup,workerGroup).channel(NioServerSocketChannel.class).handler(new LoggingHandler(LogLevel.INFO)).childHandler(this.serverInitializer);
  serverChannelFuture=bootstrap.bind(port);
  return serverChannelFuture;
}

Fixed version (ground truth):
/** 
 * run server.
 * @return ChannelFuture.
 * @throws Exception Exception.
 */
public ChannelFuture start() throws Exception {
  ServerBootstrap bootstrap=new ServerBootstrap();
  bootstrap.group(bossGroup,workerGroup).channel(NioServerSocketChannel.class).handler(new LoggingHandler(LogLevel.INFO)).childHandler(this.serverInitializer);
  serverChannelFuture=bootstrap.bind(port);
  return serverChannelFuture;
}
Program: 37039
Project: 37039
Buggy source:
public void messageReceived(ChannelHandlerContext ctx,String request){
  InetSocketAddress socketAddress=(InetSocketAddress)ctx.channel().remoteAddress();
  String remoteAddr=socketAddress.getAddress().getHostAddress();
  LOGGER.info("String_Node_Str",remoteAddr);
  String response=StringUtils.EMPTY;
  if (ConnectionControlService.exceedRateLimit(remoteAddr)) {
    LOGGER.debug("String_Node_Str");
    response=get429Response();
    writeResponseAndcloseConnection(ctx,response);
    return;
  }
  if (request.isEmpty()) {
    response="String_Node_Str";
  }
 else {
    ProxyService proxyService=ProxyService.getInstance();
    try {
      response=proxyService.execute(request);
    }
 catch (    ServiceException e) {
      response=e.getMessage();
    }
catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
      response="String_Node_Str";
    }
  }
  writeResponseAndcloseConnection(ctx,response);
}

Fixed version (ground truth):
/** 
 * messageReceived.
 * @param ctx ctx.
 * @param request request.
 */
public void messageReceived(ChannelHandlerContext ctx,String request){
  InetSocketAddress socketAddress=(InetSocketAddress)ctx.channel().remoteAddress();
  String remoteAddr=socketAddress.getAddress().getHostAddress();
  LOGGER.info("String_Node_Str",remoteAddr);
  String response=StringUtils.EMPTY;
  if (ConnectionControlService.exceedRateLimit(remoteAddr)) {
    LOGGER.debug("String_Node_Str");
    response=get429Response();
    writeResponseAndcloseConnection(ctx,response);
    return;
  }
  if (request.isEmpty()) {
    response="String_Node_Str";
  }
 else {
    ProxyService proxyService=ProxyService.getInstance();
    try {
      response=proxyService.execute(request);
    }
 catch (    ServiceException e) {
      response=e.getMessage();
    }
catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
      response="String_Node_Str";
    }
  }
  writeResponseAndcloseConnection(ctx,response);
}
Program: 37040
Project: 37040
Buggy source:
/** 
 * main service method.This will parse command, construct URI and request RDAP server for JSON response, and then convert JSON result to text format.
 * @param commandStr commandStr.
 * @return query result.
 * @throws ServiceException ServiceException.
 */
public String execute(String commandStr) throws Exception {
  LOGGER.info("String_Node_Str",commandStr);
  String requestURI=StringUtils.EMPTY;
  try {
    Command command=CommandParser.parse(commandStr);
    requestURI=generateRequestURI(command);
    if (StringUtils.isBlank(requestURI)) {
      LOGGER.error("String_Node_Str");
      throw new ServiceException("String_Node_Str" + commandStr);
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    LOGGER.error("String_Node_Str");
    requestURI=generateRequestURIForError();
  }
  RestResponse restResponse=RestClient.getInstance().execute(requestURI);
  if (null == restResponse || StringUtils.isBlank(restResponse.getBody())) {
    LOGGER.error("String_Node_Str");
    throw new ServiceException("String_Node_Str" + commandStr);
  }
  Map jsonMap=JsonUtil.deserializateJsonToMap(restResponse);
  String result=ResponseFormater.format(jsonMap);
  return result;
}

Fixed version (ground truth):
/** 
 * main service method.This will parse command, construct URI and request RDAP server for JSON response, and then convert JSON result to text format.
 * @param commandStr commandStr.
 * @return query result.
 * @throws Exception Exception.
 */
public String execute(String commandStr) throws Exception {
  LOGGER.info("String_Node_Str",commandStr);
  String requestURI=StringUtils.EMPTY;
  try {
    Command command=CommandParser.parse(commandStr);
    requestURI=generateRequestURI(command);
    if (StringUtils.isBlank(requestURI)) {
      LOGGER.error("String_Node_Str");
      throw new ServiceException("String_Node_Str" + commandStr);
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    LOGGER.error("String_Node_Str");
    requestURI=generateRequestURIForError();
  }
  RestResponse restResponse=RestClient.getInstance().execute(requestURI);
  if (null == restResponse || StringUtils.isBlank(restResponse.getBody())) {
    LOGGER.error("String_Node_Str");
    throw new ServiceException("String_Node_Str" + commandStr);
  }
  Map jsonMap=JsonUtil.deserializateJsonToMap(restResponse);
  String result=ResponseFormater.format(jsonMap);
  return result;
}
Program: 37041
Project: 37041
Buggy source:
/** 
 * constructor with cause.
 */
public ServiceException(Throwable cause){
  super(cause);
}

Fixed version (ground truth):
/** 
 * constructor with cause.
 * @param cause cause.
 */
public ServiceException(Throwable cause){
  super(cause);
}
Program: 37042
Project: 37042
Buggy source:
/** 
 * validate and format command.
 * @param commandStr commandStr.
 * @return formated command.
 * @throws ServiceException if validate error.
 */
private static String validateAndFormatCommandStr(String commandStr) throws ServiceException {
  if (StringUtils.isBlank(commandStr)) {
    LOGGER.error("String_Node_Str");
    throw new ServiceException("String_Node_Str");
  }
  commandStr=StringUtils.trim(commandStr);
  if (StringUtils.isBlank(commandStr)) {
    LOGGER.error("String_Node_Str");
    throw new ServiceException("String_Node_Str");
  }
  return commandStr;
}

Fixed version (ground truth):
/** 
 * validate and format command.
 * @param commandStr commandStr.
 * @return formated command.
 */
private static String validateAndFormatCommandStr(String commandStr){
  if (StringUtils.isBlank(commandStr)) {
    LOGGER.error("String_Node_Str");
    throw new ServiceException("String_Node_Str");
  }
  commandStr=StringUtils.trim(commandStr);
  if (StringUtils.isBlank(commandStr)) {
    LOGGER.error("String_Node_Str");
    throw new ServiceException("String_Node_Str");
  }
  return commandStr;
}