nus-yam/ex-repair huggingface dataset:
Program: 53229
Project: 53229
Buggy source:
/** 
 * Retrieves form jcrModule the categoryRules and deduce the rule to extend depending of the assetItem categories retrieve the rule name between ruleDelimiter
 * @param jcrModule module which has the category rule defined
 * @param jcrAssetItem asset with the categories, which can extend the rule
 * @param ruleDelimiter The delimiter used to contruct the return value
 * @return the rule to extend depending of the asset category and the category rules defined by package between ruleDelimiter
 */
public String getExtendedRuleFromCategoryRules(Module jcrModule,AssetItem jcrAssetItem,String ruleDelimiter){
  HashMap catRuleHashMap=new HashMap();
  String ruleName;
  if (jcrModule.getCatRules() != null && jcrModule.getCatRules().keySet() != null && jcrModule.getCatRules().keySet().size() > 0) {
    for (Iterator it=jcrModule.getCatRules().keySet().iterator(); it.hasNext(); ) {
      ruleName=(String)it.next();
      catRuleHashMap.put(jcrModule.getCatRules().get(ruleName),ruleName);
    }
  }
  List<org.drools.repository.CategoryItem> assetCategories=jcrAssetItem.getCategories();
  String extendCategories="String_Node_Str";
  int i=0;
  for (  CategoryItem categoryItem : assetCategories) {
    ruleName=(String)catRuleHashMap.get(categoryItem.getName());
    if (ruleName != null) {
      if (i != 0)       extendCategories+="String_Node_Str";
      extendCategories+=ruleDelimiter + ruleName + ruleDelimiter;
      i++;
    }
  }
  return extendCategories;
}

Fixed version (ground truth):
/** 
 * Retrieves form jcrModule the categoryRules and deduce the rule to extend depending of the assetItem categories retrieve the rule name between ruleDelimiter
 * @param jcrModule module which has the category rule defined
 * @param jcrAssetItem asset with the categories, which can extend the rule
 * @param ruleDelimiter The delimiter used to contruct the return value
 * @return the rule to extend depending of the asset category and the category rules defined by package between ruleDelimiter
 */
public String getExtendedRuleFromCategoryRules(Module jcrModule,AssetItem jcrAssetItem,String ruleDelimiter){
  HashMap catRuleHashMap=new HashMap();
  String ruleName;
  if (jcrModule.getCatRules() != null && jcrModule.getCatRules().keySet() != null && jcrModule.getCatRules().keySet().size() > 0) {
    for (Iterator it=jcrModule.getCatRules().keySet().iterator(); it.hasNext(); ) {
      ruleName=(String)it.next();
      catRuleHashMap.put(jcrModule.getCatRules().get(ruleName),ruleName);
    }
  }
  List<org.drools.repository.CategoryItem> assetCategories=jcrAssetItem.getCategories();
  StringBuilder extendCategoriesBuilder=new StringBuilder();
  int i=0;
  for (  CategoryItem categoryItem : assetCategories) {
    ruleName=(String)catRuleHashMap.get(categoryItem.getName());
    if (ruleName != null) {
      if (i != 0)       extendCategoriesBuilder.append("String_Node_Str");
      extendCategoriesBuilder.append(ruleDelimiter);
      extendCategoriesBuilder.append(ruleName);
      extendCategoriesBuilder.append(ruleDelimiter);
      i++;
    }
  }
  return extendCategoriesBuilder.toString();
}
Program: 53230
Project: 53230
Buggy source:
/** 
 * Constructs the extends expression, using the asset categories and the module categoryRules, and adds to the passed content. If passed content has an "extend" expression this function returns the same content with the extra extend added, If not, constructs another "extend" with the new rule and modify the content.
 * @param jcrModule module with the categoryRules
 * @param jcrAssetItem asset with the categories to decide the extend expression to add
 * @param content string to be completed with the necessary extend
 * @return the content passed with the extend expression if it's necessary.
 */
public String getExtendExpression(Module jcrModule,AssetItem jcrAssetItem,String content){
  String extendedRules=getExtendedRuleFromCategoryRules(jcrModule,jcrAssetItem,"String_Node_Str");
  if (extendedRules != null && extendedRules.trim().length() > 0) {
    String[] contentSplit=content.split("String_Node_Str");
    String ruleName=contentSplit[0];
    if (ruleName.indexOf("String_Node_Str") == -1) {
      contentSplit[0]+="String_Node_Str" + extendedRules;
    }
 else {
      contentSplit[0]+="String_Node_Str" + extendedRules;
    }
    String str="String_Node_Str";
    for (    String s : contentSplit) {
      str+=s + "String_Node_Str";
    }
    return str;
  }
  return content;
}

Fixed version (ground truth):
/** 
 * Constructs the extends expression, using the asset categories and the module categoryRules, and adds to the passed content. If passed content has an "extend" expression this function returns the same content with the extra extend added, If not, constructs another "extend" with the new rule and modify the content.
 * @param jcrModule module with the categoryRules
 * @param jcrAssetItem asset with the categories to decide the extend expression to add
 * @param content string to be completed with the necessary extend
 * @return the content passed with the extend expression if it's necessary.
 */
public String getExtendExpression(Module jcrModule,AssetItem jcrAssetItem,String content){
  String extendedRules=getExtendedRuleFromCategoryRules(jcrModule,jcrAssetItem,"String_Node_Str");
  if (extendedRules != null && extendedRules.trim().length() > 0) {
    String[] contentSplit=content.split("String_Node_Str");
    String ruleName=contentSplit[0];
    if (ruleName.indexOf("String_Node_Str") == -1) {
      contentSplit[0]+="String_Node_Str" + extendedRules;
    }
 else {
      contentSplit[0]+="String_Node_Str" + extendedRules;
    }
    StringBuilder contentWithExtendsBuilder=new StringBuilder();
    for (    String s : contentSplit) {
      contentWithExtendsBuilder.append(s);
      contentWithExtendsBuilder.append("String_Node_Str");
    }
    return contentWithExtendsBuilder.toString();
  }
  return content;
}
Program: 53231
Project: 53231
Buggy source:
private String getPackageName(Module jcrModule){
  String packageName=jcrModule.getName();
  int dotIndex=packageName.indexOf("String_Node_Str");
  return packageName;
}

Fixed version (ground truth):
private String getPackageName(Module jcrModule){
  String packageName=jcrModule.getName();
  return packageName;
}
Program: 53234
Project: 53234
Buggy source:
public void onCloneRepositoryRequest(final @Observes CloneRepositoryRequest jobRequest){
  if (!approveRequest(jobRequest)) {
    return;
  }
  projectResourceDispatcher.cloneRepository(jobRequest.getJodId(),jobRequest.getRepository());
}

Fixed version (ground truth):
public void onCloneRepositoryRequest(final @Observes CreateOrCloneRepositoryRequest jobRequest){
  if (!approveRequest(jobRequest)) {
    return;
  }
  projectResourceDispatcher.createOrCloneRepository(jobRequest.getJodId(),jobRequest.getRepository());
}
Program: 53235
Project: 53235
Buggy source:
@GET @Produces(MediaType.APPLICATION_JSON) @Path("String_Node_Str") public JobResult getJobStatus(@PathParam("String_Node_Str") String jobId){
  System.out.println("String_Node_Str" + jobId);
  JobResult job=jobs.get(jobId);
  if (job == null) {
    job=new JobResult();
    job.setStatus(JobRequest.Status.GONE);
    return job;
  }
  return job;
}

Fixed version (ground truth):
@GET @Produces(MediaType.APPLICATION_JSON) @Path("String_Node_Str") public JobResult getJobStatus(@PathParam("String_Node_Str") String jobId){
  System.out.println("String_Node_Str" + jobId);
  JobResult job=jobs.get(jobId);
  if (job == null) {
    System.out.println("String_Node_Str" + jobId + "String_Node_Str");
    job=new JobResult();
    job.setStatus(JobRequest.Status.GONE);
    return job;
  }
  return job;
}
Program: 53236
Project: 53236
Buggy source:
public void onUpateJobStatus(final @Observes JobResult jobResult){
  JobResult job=jobs.get(jobResult.getJodId());
  if (job == null) {
    return;
  }
  jobs.put(jobResult.getJodId(),job);
}

Fixed version (ground truth):
public void onUpateJobStatus(final @Observes JobResult jobResult){
  JobResult job=jobs.get(jobResult.getJodId());
  if (job == null) {
    System.out.println("String_Node_Str" + jobResult.getJodId() + "String_Node_Str");
    return;
  }
  jobs.put(jobResult.getJodId(),jobResult);
}
Program: 53237
Project: 53237
Buggy source:
@DELETE @Produces(MediaType.APPLICATION_JSON) @Path("String_Node_Str") public JobResult removeJob(@PathParam("String_Node_Str") String jobId){
  System.out.println("String_Node_Str" + jobId);
  JobResult job=jobs.get(jobId);
  if (job == null) {
    job=new JobResult();
    job.setStatus(JobRequest.Status.GONE);
    return job;
  }
  jobs.remove(jobId);
  job.setStatus(JobRequest.Status.GONE);
  return job;
}

Fixed version (ground truth):
@DELETE @Produces(MediaType.APPLICATION_JSON) @Path("String_Node_Str") public JobResult removeJob(@PathParam("String_Node_Str") String jobId){
  System.out.println("String_Node_Str" + jobId);
  JobResult job=jobs.get(jobId);
  if (job == null) {
    System.out.println("String_Node_Str" + jobId + "String_Node_Str");
    job=new JobResult();
    job.setStatus(JobRequest.Status.GONE);
    return job;
  }
  jobs.remove(jobId);
  job.setStatus(JobRequest.Status.GONE);
  return job;
}
Program: 53238
Project: 53238
Buggy source:
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Path("String_Node_Str") public JobRequest createOrCloneRepository(Repository repository){
  System.out.println("String_Node_Str" + repository.getName());
  String id="String_Node_Str" + System.currentTimeMillis() + "String_Node_Str"+ counter.incrementAndGet();
  CloneRepositoryRequest jobRequest=new CloneRepositoryRequest();
  jobRequest.setStatus(JobRequest.Status.ACCEPTED);
  jobRequest.setJodId(id);
  jobRequest.setRepository(repository);
  JobResult jobResult=new JobResult();
  jobResult.setJodId(id);
  jobResult.setStatus(JobRequest.Status.ACCEPTED);
  jobs.put(id,jobResult);
  cloneJobRequestEvent.fire(jobRequest);
  return jobRequest;
}

Fixed version (ground truth):
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Path("String_Node_Str") public JobRequest createOrCloneRepository(Repository repository){
  System.out.println("String_Node_Str" + repository.getName());
  String id="String_Node_Str" + System.currentTimeMillis() + "String_Node_Str"+ counter.incrementAndGet();
  CreateOrCloneRepositoryRequest jobRequest=new CreateOrCloneRepositoryRequest();
  jobRequest.setStatus(JobRequest.Status.ACCEPTED);
  jobRequest.setJodId(id);
  jobRequest.setRepository(repository);
  JobResult jobResult=new JobResult();
  jobResult.setJodId(id);
  jobResult.setStatus(JobRequest.Status.ACCEPTED);
  jobs.put(id,jobResult);
  createOrCloneJobRequestEvent.fire(jobRequest);
  return jobRequest;
}
Program: 53239
Project: 53239
Buggy source:
private void migrate(Module jcrModule){
  POM pom=new POM();
  Path modulePath=migrationPathManager.generateRootPath();
  projectService.newProject(makeRepository(modulePath),jcrModule.getName(),pom,"String_Node_Str");
}

Fixed version (ground truth):
private void migrate(Module jcrModule){
  GAV gav=new GAV(jcrModule.getName(),jcrModule.getName(),"String_Node_Str");
  POM pom=new POM(gav);
  Path modulePath=migrationPathManager.generateRootPath();
  projectService.newProject(makeRepository(modulePath),jcrModule.getName(),pom,"String_Node_Str");
}
Program: 53241
Project: 53241
Buggy source:
public Path generateRootPath(){
  final org.kie.commons.java.nio.file.Path _path=fs.getPath("String_Node_Str" + escapePathEntry("String_Node_Str"));
  final Path path=PathFactory.newPath(paths.convert(_path.getFileSystem()),_path.getFileName().toString(),_path.toUri().toString());
  return path;
}

Fixed version (ground truth):
public Path generateRootPath(){
  final org.kie.commons.java.nio.file.Path _path=fs.getPath("String_Node_Str");
  return paths.convert(_path,false);
}
Program: 53242
Project: 53242
Buggy source:
void runAllScenarios(Path path,String sessoinName);

Fixed version (ground truth):
void runAllScenarios(Path path);
Program: 53243
Project: 53243
Buggy source:
void runScenario(Path path,Scenario scenario,String sessoinName);

Fixed version (ground truth):
void runScenario(Path path,Scenario scenario);
Program: 53244
Project: 53244
Buggy source:
@Override public void runAllScenarios(final Path testResourcePath,final String sessionName){
  try {
    final Project project=projectService.resolveProject(testResourcePath);
    List<Path> scenarioPaths=loadScenarioPaths(testResourcePath);
    List<Scenario> scenarios=new ArrayList<Scenario>();
    for (    Path path : scenarioPaths) {
      Scenario s=load(path);
      scenarios.add(s);
    }
    new ScenarioRunnerWrapper().run(scenarios,sessionService.newKieSession(project,sessionName),testResultMessageEvent);
  }
 catch (  Exception e) {
    throw ExceptionUtilities.handleException(e);
  }
}

Fixed version (ground truth):
@Override public void runAllScenarios(final Path testResourcePath){
  try {
    final Project project=projectService.resolveProject(testResourcePath);
    List<Path> scenarioPaths=loadScenarioPaths(testResourcePath);
    List<Scenario> scenarios=new ArrayList<Scenario>();
    for (    Path path : scenarioPaths) {
      Scenario s=load(path);
      scenarios.add(s);
    }
    new ScenarioRunnerWrapper().run(scenarios,sessionService.newKieSession(project),testResultMessageEvent);
  }
 catch (  Exception e) {
    throw ExceptionUtilities.handleException(e);
  }
}
Program: 53245
Project: 53245
Buggy source:
@Override public void runScenario(final Path path,final Scenario scenario,final String sessionName){
  try {
    final Project project=projectService.resolveProject(path);
    new ScenarioRunnerWrapper().run(scenario,sessionService.newKieSession(project,sessionName),testResultMessageEvent);
  }
 catch (  Exception e) {
    throw ExceptionUtilities.handleException(e);
  }
}

Fixed version (ground truth):
@Override public void runScenario(final Path path,final Scenario scenario){
  try {
    final Project project=projectService.resolveProject(path);
    new ScenarioRunnerWrapper().run(scenario,sessionService.newKieSession(project),testResultMessageEvent);
  }
 catch (  Exception e) {
    throw ExceptionUtilities.handleException(e);
  }
}
Program: 53246
Project: 53246
Buggy source:
@Override public void callback(Void v){
  pop.hide();
  BusyPopup.close();
}

Fixed version (ground truth):
@Override public void callback(Void v){
  BusyPopup.close();
}
Program: 53247
Project: 53247
Buggy source:
@Override public void onRunAllButton(){
  final FormStylePopup pop=new FormStylePopup();
  final TextBox sessionNameTextBox=new TextBox();
  pop.addAttribute("String_Node_Str" + "String_Node_Str",sessionNameTextBox);
  Button ok=new Button("String_Node_Str");
  ok.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      if (sessionNameTextBox.getText() == null || "String_Node_Str".equals(sessionNameTextBox.getText())) {
        Window.alert(TestScenarioConstants.INSTANCE.PleaseInputSessionName());
        return;
      }
      BusyPopup.showMessage(TestScenarioConstants.INSTANCE.BuildingAndRunningScenario());
      scenarioService.call(new RemoteCallback<Void>(){
        @Override public void callback(        Void v){
          pop.hide();
          BusyPopup.close();
        }
      }
,new HasBusyIndicatorDefaultErrorCallback(BulkRunTestScenarioEditor.this)).runAllScenarios(path,sessionNameTextBox.getText());
    }
  }
);
  pop.addAttribute("String_Node_Str",ok);
  pop.show();
}

Fixed version (ground truth):
@Override public void onRunAllButton(){
  BusyPopup.showMessage(TestScenarioConstants.INSTANCE.BuildingAndRunningScenario());
  scenarioService.call(new RemoteCallback<Void>(){
    @Override public void callback(    Void v){
      BusyPopup.close();
    }
  }
,new HasBusyIndicatorDefaultErrorCallback(BulkRunTestScenarioEditor.this)).runAllScenarios(path);
}
Program: 53248
Project: 53248
Buggy source:
private boolean parseArgOutputVfsRepository(CommandLine commandLine,HelpFormatter formatter,Options options){
  outputVfsRepository=new File(commandLine.getOptionValue("String_Node_Str","String_Node_Str"));
  forceOverwriteOutputVfsRepository=Boolean.parseBoolean(commandLine.getOptionValue("String_Node_Str","String_Node_Str"));
  if (outputVfsRepository.exists()) {
    if (forceOverwriteOutputVfsRepository) {
      try {
        FileUtils.deleteDirectory(outputVfsRepository);
      }
 catch (      IOException e) {
        throw new IllegalStateException("String_Node_Str" + outputVfsRepository.getAbsolutePath() + "String_Node_Str",e);
      }
    }
 else {
      System.out.println("String_Node_Str" + outputVfsRepository.getAbsolutePath() + "String_Node_Str");
      return false;
    }
  }
  try {
    outputVfsRepository=outputVfsRepository.getCanonicalFile();
  }
 catch (  IOException e) {
    throw new IllegalArgumentException("String_Node_Str" + outputVfsRepository + "String_Node_Str",e);
  }
  outputVfsRepository.mkdirs();
  return true;
}

Fixed version (ground truth):
private boolean parseArgOutputVfsRepository(CommandLine commandLine,HelpFormatter formatter,Options options){
  outputVfsRepository=new File(commandLine.getOptionValue("String_Node_Str","String_Node_Str"));
  forceOverwriteOutputVfsRepository=commandLine.hasOption("String_Node_Str");
  if (outputVfsRepository.exists()) {
    if (forceOverwriteOutputVfsRepository) {
      try {
        FileUtils.deleteDirectory(outputVfsRepository);
      }
 catch (      IOException e) {
        throw new IllegalStateException("String_Node_Str" + outputVfsRepository.getAbsolutePath() + "String_Node_Str",e);
      }
    }
 else {
      System.out.println("String_Node_Str" + outputVfsRepository.getAbsolutePath() + "String_Node_Str");
      return false;
    }
  }
  try {
    outputVfsRepository=outputVfsRepository.getCanonicalFile();
  }
 catch (  IOException e) {
    throw new IllegalArgumentException("String_Node_Str" + outputVfsRepository + "String_Node_Str",e);
  }
  outputVfsRepository.mkdirs();
  return true;
}
Program: 53249
Project: 53249
Buggy source:
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  if (!AssetFormats.DECISION_TABLE_GUIDED.equals(jcrAssetItem.getFormat())) {
    throw new IllegalArgumentException("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str"+ jcrAssetItem.getFormat()+ "String_Node_Str");
  }
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.commons.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  GuidedDecisionTable52 model=GuidedDTXMLPersistence.getInstance().unmarshal(jcrAssetItem.getContent());
  final String requiredPackageName=projectService.resolvePackage(path).getPackageName();
  if (requiredPackageName != null && !"String_Node_Str".equals(requiredPackageName)) {
    model.setPackageName(requiredPackageName);
  }
  if (packageHeaderInfo.getHeader() != null) {
    final Imports imports=ImportsParser.parseImports(packageHeaderInfo.getHeader());
    if (imports != null) {
      model.setImports(imports);
    }
  }
  String sourceContent=GuidedDTXMLPersistence.getInstance().marshal(model);
  ioService.write(nioPath,sourceContent,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}

Fixed version (ground truth):
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  if (!AssetFormats.DECISION_TABLE_GUIDED.equals(jcrAssetItem.getFormat())) {
    throw new IllegalArgumentException("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str"+ jcrAssetItem.getFormat()+ "String_Node_Str");
  }
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.commons.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  String content=jcrAssetItem.getContent();
  content=content.replaceAll("String_Node_Str","String_Node_Str");
  GuidedDecisionTable52 model=GuidedDTXMLPersistence.getInstance().unmarshal(content);
  final String requiredPackageName=projectService.resolvePackage(path).getPackageName();
  if (requiredPackageName != null && !"String_Node_Str".equals(requiredPackageName)) {
    model.setPackageName(requiredPackageName);
  }
  if (packageHeaderInfo.getHeader() != null) {
    final Imports imports=ImportsParser.parseImports(packageHeaderInfo.getHeader());
    if (imports != null) {
      model.setImports(imports);
    }
  }
  String sourceContent=GuidedDTXMLPersistence.getInstance().marshal(model);
  ioService.write(nioPath,sourceContent,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}
Program: 53250
Project: 53250
Buggy source:
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.workbench.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  byte[] attachement=jcrAssetItem.getBinaryContentAsBytes();
  ioService.write(nioPath,attachement,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}

Fixed version (ground truth):
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.commons.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  byte[] attachement=jcrAssetItem.getBinaryContentAsBytes();
  ioService.write(nioPath,attachement,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}
Program: 53251
Project: 53251
Buggy source:
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  if (!AssetFormats.DRL_MODEL.equals(jcrAssetItem.getFormat())) {
    throw new IllegalArgumentException("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str"+ jcrAssetItem.getFormat()+ "String_Node_Str");
  }
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.workbench.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  FactModelContentHandler h=new FactModelContentHandler();
  StringBuilder stringBuilder=new StringBuilder();
  try {
    Asset jcrAsset=jcrRepositoryAssetService.loadRuleAsset(jcrAssetItem.getUUID());
    h.assembleSource(jcrAsset.getContent(),stringBuilder);
    String sourceDRLWithImport=drlTextEditorServiceImpl.assertPackageName(stringBuilder.toString(),path);
    sourceDRLWithImport=packageImportHelper.assertPackageImportDRL(sourceDRLWithImport,path);
    ioService.write(nioPath,sourceDRLWithImport,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
  }
 catch (  SerializationException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  if (!AssetFormats.DRL_MODEL.equals(jcrAssetItem.getFormat())) {
    throw new IllegalArgumentException("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str"+ jcrAssetItem.getFormat()+ "String_Node_Str");
  }
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.commons.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  FactModelContentHandler h=new FactModelContentHandler();
  StringBuilder stringBuilder=new StringBuilder();
  try {
    Asset jcrAsset=jcrRepositoryAssetService.loadRuleAsset(jcrAssetItem.getUUID());
    h.assembleSource(jcrAsset.getContent(),stringBuilder);
    String sourceDRLWithImport=drlTextEditorServiceImpl.assertPackageName(stringBuilder.toString(),path);
    sourceDRLWithImport=packageImportHelper.assertPackageImportDRL(sourceDRLWithImport,path);
    ioService.write(nioPath,sourceDRLWithImport,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
  }
 catch (  SerializationException e) {
    e.printStackTrace();
  }
}
Program: 53252
Project: 53252
Buggy source:
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  if (!AssetFormats.DECISION_TABLE_GUIDED.equals(jcrAssetItem.getFormat())) {
    throw new IllegalArgumentException("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str"+ jcrAssetItem.getFormat()+ "String_Node_Str");
  }
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.workbench.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  GuidedDecisionTable52 model=GuidedDTXMLPersistence.getInstance().unmarshal(jcrAssetItem.getContent());
  final String requiredPackageName=projectService.resolvePackageName(path);
  if (requiredPackageName != null && !"String_Node_Str".equals(requiredPackageName)) {
    model.setPackageName(requiredPackageName);
  }
  if (packageHeaderInfo.getHeader() != null) {
    final Imports imports=ImportsParser.parseImports(packageHeaderInfo.getHeader());
    if (imports != null) {
      model.setImports(imports);
    }
  }
  String sourceContent=GuidedDTXMLPersistence.getInstance().marshal(model);
  ioService.write(nioPath,sourceContent,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}

Fixed version (ground truth):
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  if (!AssetFormats.DECISION_TABLE_GUIDED.equals(jcrAssetItem.getFormat())) {
    throw new IllegalArgumentException("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str"+ jcrAssetItem.getFormat()+ "String_Node_Str");
  }
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.commons.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  GuidedDecisionTable52 model=GuidedDTXMLPersistence.getInstance().unmarshal(jcrAssetItem.getContent());
  final String requiredPackageName=projectService.resolvePackageName(path);
  if (requiredPackageName != null && !"String_Node_Str".equals(requiredPackageName)) {
    model.setPackageName(requiredPackageName);
  }
  if (packageHeaderInfo.getHeader() != null) {
    final Imports imports=ImportsParser.parseImports(packageHeaderInfo.getHeader());
    if (imports != null) {
      model.setImports(imports);
    }
  }
  String sourceContent=GuidedDTXMLPersistence.getInstance().marshal(model);
  ioService.write(nioPath,sourceContent,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}
Program: 53254
Project: 53254
Buggy source:
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  if (!AssetFormats.SCORECARD_GUIDED.equals(jcrAssetItem.getFormat())) {
    throw new IllegalArgumentException("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str"+ jcrAssetItem.getFormat()+ "String_Node_Str");
  }
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.workbench.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  String sourceContent=jcrAssetItem.getContent();
  String sourceContentWithPackage=packageImportHelper.assertPackageNameXML(sourceContent,path);
  sourceContentWithPackage=packageImportHelper.assertPackageImportXML(sourceContentWithPackage,path);
  ioService.write(nioPath,sourceContentWithPackage,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}

Fixed version (ground truth):
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  if (!AssetFormats.SCORECARD_GUIDED.equals(jcrAssetItem.getFormat())) {
    throw new IllegalArgumentException("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str"+ jcrAssetItem.getFormat()+ "String_Node_Str");
  }
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.commons.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  String sourceContent=jcrAssetItem.getContent();
  String sourceContentWithPackage=packageImportHelper.assertPackageNameXML(sourceContent,path);
  sourceContentWithPackage=packageImportHelper.assertPackageImportXML(sourceContentWithPackage,path);
  ioService.write(nioPath,sourceContentWithPackage,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}
Program: 53255
Project: 53255
Buggy source:
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.workbench.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  String content=jcrAssetItem.getContent();
  ioService.write(nioPath,content,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}

Fixed version (ground truth):
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.commons.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  String content=jcrAssetItem.getContent();
  ioService.write(nioPath,content,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}
Program: 53256
Project: 53256
Buggy source:
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.workbench.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  StringBuilder sb=new StringBuilder();
  if (AssetFormats.DRL.equals(jcrAssetItem.getFormat())) {
    sb.append("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
  }
 else   if (AssetFormats.FUNCTION.equals(jcrAssetItem.getFormat())) {
    sb.append("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
  }
  sb.append(jcrAssetItem.getContent());
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  String sourceWithImport=drlTextEditorServiceImpl.assertPackageName(sb.toString(),path);
  sourceWithImport=packageImportHelper.assertPackageImportDRL(sourceWithImport,path);
  ioService.write(nioPath,sourceWithImport,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}

Fixed version (ground truth):
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.commons.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  StringBuilder sb=new StringBuilder();
  if (AssetFormats.DRL.equals(jcrAssetItem.getFormat())) {
    sb.append("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
  }
 else   if (AssetFormats.FUNCTION.equals(jcrAssetItem.getFormat())) {
    sb.append("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
  }
  sb.append(jcrAssetItem.getContent());
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  String sourceWithImport=drlTextEditorServiceImpl.assertPackageName(sb.toString(),path);
  sourceWithImport=packageImportHelper.assertPackageImportDRL(sourceWithImport,path);
  ioService.write(nioPath,sourceWithImport,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}
Program: 53257
Project: 53257
Buggy source:
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  if (!AssetFormats.TEST_SCENARIO.equals(jcrAssetItem.getFormat())) {
    throw new IllegalArgumentException("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str"+ jcrAssetItem.getFormat()+ "String_Node_Str");
  }
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.workbench.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  String content=jcrAssetItem.getContent();
  String sourceContentWithPackage=packageImportHelper.assertPackageNameXML(content,path);
  sourceContentWithPackage=packageImportHelper.assertPackageImportXML(sourceContentWithPackage,path);
  ioService.write(nioPath,content,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}

Fixed version (ground truth):
public void migrate(Module jcrModule,AssetItem jcrAssetItem){
  if (!AssetFormats.TEST_SCENARIO.equals(jcrAssetItem.getFormat())) {
    throw new IllegalArgumentException("String_Node_Str" + jcrAssetItem.getName() + "String_Node_Str"+ jcrAssetItem.getFormat()+ "String_Node_Str");
  }
  Path path=migrationPathManager.generatePathForAsset(jcrModule,jcrAssetItem);
  final org.kie.commons.java.nio.file.Path nioPath=paths.convert(path);
  Map<String,Object> attrs;
  try {
    attrs=ioService.readAttributes(nioPath);
  }
 catch (  final NoSuchFileException ex) {
    attrs=new HashMap<String,Object>();
  }
  String content=jcrAssetItem.getContent();
  String sourceContentWithPackage=packageImportHelper.assertPackageNameXML(content,path);
  sourceContentWithPackage=packageImportHelper.assertPackageImportXML(sourceContentWithPackage,path);
  ioService.write(nioPath,content,attrs,new CommentedOption(jcrAssetItem.getLastContributor(),null,jcrAssetItem.getCheckinComment(),jcrAssetItem.getLastModified().getTime()));
}
Program: 53258
Project: 53258
Buggy source:
private org.kie.workbench.java.nio.file.Path getPomDirectoryPath(final Path pathToPomXML){
  return paths.convert(pathToPomXML).getParent();
}

Fixed version (ground truth):
private org.kie.commons.java.nio.file.Path getPomDirectoryPath(final Path pathToPomXML){
  return paths.convert(pathToPomXML).getParent();
}
Program: 53259
Project: 53259
Buggy source:
public Path generateRootPath(){
  final org.kie.workbench.java.nio.file.Path _path=fs.getPath("String_Node_Str" + escapePathEntry("String_Node_Str"));
  final Path path=PathFactory.newPath(paths.convert(_path.getFileSystem()),_path.getFileName().toString(),_path.toUri().toString());
  return path;
}

Fixed version (ground truth):
public Path generateRootPath(){
  final org.kie.commons.java.nio.file.Path _path=fs.getPath("String_Node_Str" + escapePathEntry("String_Node_Str"));
  final Path path=PathFactory.newPath(paths.convert(_path.getFileSystem()),_path.getFileName().toString(),_path.toUri().toString());
  return path;
}
Program: 53260
Project: 53260
Buggy source:
public Path generatePathForModule(Module jcrModule){
  final org.kie.workbench.java.nio.file.Path modulePath=fs.getPath("String_Node_Str" + escapePathEntry(jcrModule.getName()));
  final Path path=PathFactory.newPath(paths.convert(modulePath.getFileSystem()),modulePath.getFileName().toString(),modulePath.toUri().toString());
  register(jcrModule.getUuid(),path);
  return path;
}

Fixed version (ground truth):
public Path generatePathForModule(Module jcrModule){
  final org.kie.commons.java.nio.file.Path modulePath=fs.getPath("String_Node_Str" + escapePathEntry(jcrModule.getName()));
  final Path path=PathFactory.newPath(paths.convert(modulePath.getFileSystem()),modulePath.getFileName().toString(),modulePath.toUri().toString());
  register(jcrModule.getUuid(),path);
  return path;
}
Program: 53261
Project: 53261
Buggy source:
/** 
 * Replaces the current username with <code>userInfo</code>
 * @param userInfo The new userInfo
 * @return This builder
 */
public SessionFactoryBuilder setUserInfo(UserInfo userInfo){
  this.userInfo=userInfo;
  return this;
}

Fixed version (ground truth):
/** 
 * Replaces the current userInfo with <code>userInfo</code>
 * @param userInfo The new userInfo
 * @return This builder
 */
public SessionFactoryBuilder setUserInfo(UserInfo userInfo){
  this.userInfo=userInfo;
  return this;
}
Program: 53262
Project: 53262
Buggy source:
public void execute(Sftp sftp) throws JSchException, IOException {
  logger.debug("String_Node_Str",sessionManager);
  ChannelSftp channelSftp=null;
  try {
    channelSftp=(ChannelSftp)sessionManager.getSession().openChannel(CHANNEL_SFTP);
    sftp.run(channelSftp);
  }
  finally {
    if (channelSftp != null) {
      channelSftp.disconnect();
    }
  }
}

Fixed version (ground truth):
public void execute(Sftp sftp) throws JSchException, IOException {
  logger.debug("String_Node_Str",sessionManager);
  ChannelSftp channelSftp=null;
  try {
    channelSftp=(ChannelSftp)sessionManager.getSession().openChannel(CHANNEL_SFTP);
    channelSftp.connect();
    sftp.run(channelSftp);
  }
  finally {
    if (channelSftp != null) {
      channelSftp.disconnect();
    }
  }
}
Program: 53263
Project: 53263
Buggy source:
/** 
 * Get used glo message.
 * @param command Executed command.
 * @return Integer value of glo message.
 */
private static int getGloMessage(final int command){
  int cmd;
switch (command) {
case Command.READ_REQUEST:
    cmd=Command.GLO_READ_REQUEST;
  break;
case Command.GET_REQUEST:
cmd=Command.GLO_GET_REQUEST;
break;
case Command.WRITE_REQUEST:
cmd=Command.GLO_WRITE_REQUEST;
break;
case Command.SET_REQUEST:
cmd=Command.GLO_SET_REQUEST;
break;
case Command.METHOD_REQUEST:
cmd=Command.GLO_METHOD_REQUEST;
break;
case Command.READ_RESPONSE:
cmd=Command.GLO_READ_RESPONSE;
break;
case Command.GET_RESPONSE:
cmd=Command.GLO_GET_RESPONSE;
break;
case Command.WRITE_RESPONSE:
cmd=Command.GLO_WRITE_RESPONSE;
break;
case Command.SET_RESPONSE:
cmd=Command.GLO_SET_RESPONSE;
break;
case Command.METHOD_RESPONSE:
cmd=Command.GLO_METHOD_RESPONSE;
break;
case Command.DATA_NOTIFICATION:
cmd=Command.GENERAL_GLO_CIPHERING;
break;
default :
throw new GXDLMSException("String_Node_Str");
}
return cmd;
}

Fixed version (ground truth):
/** 
 * Get used glo message.
 * @param command Executed command.
 * @return Integer value of glo message.
 */
private static int getGloMessage(final int command){
  int cmd;
switch (command) {
case Command.READ_REQUEST:
    cmd=Command.GLO_READ_REQUEST;
  break;
case Command.GET_REQUEST:
cmd=Command.GLO_GET_REQUEST;
break;
case Command.WRITE_REQUEST:
cmd=Command.GLO_WRITE_REQUEST;
break;
case Command.SET_REQUEST:
cmd=Command.GLO_SET_REQUEST;
break;
case Command.METHOD_REQUEST:
cmd=Command.GLO_METHOD_REQUEST;
break;
case Command.READ_RESPONSE:
cmd=Command.GLO_READ_RESPONSE;
break;
case Command.GET_RESPONSE:
cmd=Command.GLO_GET_RESPONSE;
break;
case Command.WRITE_RESPONSE:
cmd=Command.GLO_WRITE_RESPONSE;
break;
case Command.SET_RESPONSE:
cmd=Command.GLO_SET_RESPONSE;
break;
case Command.METHOD_RESPONSE:
cmd=Command.GLO_METHOD_RESPONSE;
break;
case Command.DATA_NOTIFICATION:
cmd=Command.GENERAL_GLO_CIPHERING;
break;
case Command.RELEASE_REQUEST:
cmd=Command.RELEASE_REQUEST;
break;
case Command.RELEASE_RESPONSE:
cmd=Command.RELEASE_RESPONSE;
break;
default :
throw new GXDLMSException("String_Node_Str");
}
return cmd;
}
Program: 53264
Project: 53264
Buggy source:
public void readList(List<Entry<GXDLMSObject,Integer>> list) throws Exception {
  byte[][] data=dlms.readList(list);
  GXReplyData reply=new GXReplyData();
  readDataBlock(data,reply);
  dlms.updateValues(list,Arrays.asList(reply.getValue()));
}

Fixed version (ground truth):
public void readList(List<Entry<GXDLMSObject,Integer>> list) throws Exception {
  byte[][] data=dlms.readList(list);
  GXReplyData reply=new GXReplyData();
  List<Object> values=new ArrayList<Object>(list.size());
  for (  byte[] it : data) {
    readDataBlock(it,reply);
    if (list.size() != 1 && reply.getValue() instanceof Object[]) {
      values.addAll(Arrays.asList((Object[])reply.getValue()));
    }
 else     if (reply.getValue() != null) {
      values.add(reply.getValue());
    }
    reply.clear();
  }
  if (values.size() != list.size()) {
    throw new Exception("String_Node_Str");
  }
  dlms.updateValues(list,values);
}
Program: 53266
Project: 53266
Buggy source:
/** 
 * Determines, whether the DLMS packet is completed.
 * @param data The data to be parsed, to complete the DLMS packet.
 * @return True, when the DLMS packet is completed.
 */
public final boolean isDLMSPacketComplete(byte[] data){
  if (data == null) {
    return false;
  }
  byte[] frame=new byte[1];
  int[] error=new int[1];
  try {
    boolean[] packetFull=new boolean[1], wrongCrc=new boolean[1];
    int[] command=new int[1];
    getDataFromFrame(java.nio.ByteBuffer.wrap(data),null,frame,true,error,false,packetFull,wrongCrc,command);
    return packetFull[0];
  }
 catch (  java.lang.Exception ex) {
    System.out.println(ex.getMessage());
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Determines, whether the DLMS packet is completed.
 * @param data The data to be parsed, to complete the DLMS packet.
 * @return True, when the DLMS packet is completed.
 */
public final boolean isDLMSPacketComplete(byte[] data){
  if (data == null) {
    return false;
  }
  byte[] frame=new byte[1];
  int[] error=new int[1];
  try {
    if (getInterfaceType() == InterfaceType.GENERAL) {
      if (data.length < 5) {
        return false;
      }
      boolean compleate=false;
      for (int index=0; index < data.length; ++index) {
        if (data[index] == GXCommon.HDLCFrameStartEnd) {
          if (2 + data[index + 2] <= data.length) {
            compleate=true;
          }
          break;
        }
      }
      if (!compleate) {
        return false;
      }
    }
 else     if (getInterfaceType() == InterfaceType.NET) {
      if (data.length < 6) {
        return false;
      }
    }
 else {
      throw new Exception("String_Node_Str");
    }
    boolean[] packetFull=new boolean[1], wrongCrc=new boolean[1];
    int[] command=new int[1];
    getDataFromFrame(java.nio.ByteBuffer.wrap(data),null,frame,true,error,false,packetFull,wrongCrc,command);
    return packetFull[0];
  }
 catch (  java.lang.Exception ex) {
    System.out.println(ex.getMessage());
    return false;
  }
}
Program: 53267
Project: 53267
Buggy source:
/** 
 * Split the send packet to a size that the device can handle.
 * @param packet Packet to send.
 * @return Array of byte arrays that are sent to device.
 */
public final byte[][] splitToBlocks(java.nio.ByteBuffer packet,Command cmd){
  int[] index=new int[1];
  int len=packet.position();
  packet.limit(len);
  packet.position(0);
  if (!getUseLogicalNameReferencing()) {
    return splitToFrames(packet,0,index,len,cmd,0);
  }
  java.util.ArrayList<byte[]> buff=new java.util.ArrayList<byte[]>();
  int blockIndex=0;
  boolean multibleFrames=false;
  do {
    byte[][] frames=splitToFrames(packet,++blockIndex,index,getMaxReceivePDUSize(),cmd,0);
    buff.addAll(Arrays.asList(frames));
    if (frames.length != 1) {
      multibleFrames=true;
      expectedFrame+=3;
    }
  }
 while (index[0] < len);
  if (multibleFrames) {
    expectedFrame-=3;
  }
  byte[][] tmp=new byte[buff.size()][];
  int pos=-1;
  for (  byte[] it : buff) {
    ++pos;
    tmp[pos]=new byte[it.length];
    System.arraycopy(it,0,tmp[pos],0,it.length);
  }
  return tmp;
}

Fixed version (ground truth):
/** 
 * Split the send packet to a size that the device can handle.
 * @param packet Packet to send.
 * @return Array of byte arrays that are sent to device.
 */
public final byte[][] splitToBlocks(java.nio.ByteBuffer packet,Command cmd,boolean asList){
  int[] index=new int[1];
  int len=packet.position();
  packet.limit(len);
  packet.position(0);
  if (!getUseLogicalNameReferencing()) {
    return splitToFrames(packet,0,index,len,cmd,0,asList);
  }
  java.util.ArrayList<byte[]> buff=new java.util.ArrayList<byte[]>();
  int blockIndex=0;
  boolean multibleFrames=false;
  do {
    byte[][] frames=splitToFrames(packet,++blockIndex,index,getMaxReceivePDUSize(),cmd,0,asList);
    buff.addAll(Arrays.asList(frames));
    if (frames.length != 1) {
      multibleFrames=true;
      expectedFrame+=3;
    }
  }
 while (index[0] < len);
  if (multibleFrames) {
    expectedFrame-=3;
  }
  byte[][] tmp=new byte[buff.size()][];
  int pos=-1;
  for (  byte[] it : buff) {
    ++pos;
    tmp[pos]=new byte[it.length];
    System.arraycopy(it,0,tmp[pos],0,it.length);
  }
  return tmp;
}
Program: 53268
Project: 53268
Buggy source:
/** 
 * Determines, whether Logical, or Short name, referencing is used.      Referencing depends on the device to communicate with. Normally, a device supports only either Logical or Short name referencing. The referencing is defined by the device manufacurer. If the referencing is wrong, the SNMR message will fail.
 */
public final boolean getUseLogicalNameReferencing(){
  return privateUseLogicalNameReferencing;
}

Fixed version (ground truth):
/** 
 * Determines, whether Logical, or Short name, referencing is used.      Referencing depends on the device to communicate with. Normally, a device supports only either Logical or Short name referencing. The referencing is defined by the device manufacturer. If the referencing is wrong, the SNMR message will fail.
 */
public final boolean getUseLogicalNameReferencing(){
  return privateUseLogicalNameReferencing;
}
Program: 53271
Project: 53271
Buggy source:
/** 
 * List of available obis codes. This list is used when Association view is read from the meter and description of the object is needed. If collection is not set description of object is empty.
 */
public final GXObisCodeCollection getObisCodes(){
  return privateObisCodes;
}

Fixed version (ground truth):
/** 
 * List of available OBIS codes. This list is used when Association view is read from the meter and description of the object is needed. If collection is not set description of object is empty.
 */
public final GXObisCodeCollection getObisCodes(){
  return privateObisCodes;
}