nus-yam/ex-repair huggingface dataset:
Program: 96640
Project: 96640
Buggy source:
public synchronized BuildConnector getCore() throws CoreException {
  if (core != null) {
    return core;
  }
  if (status != null) {
    throw new CoreException(status);
  }
  IStatus result=descriptor.createConnector();
  if (result.isOK()) {
    core=descriptor.core;
  }
 else {
    status=result;
  }
  if (status != null) {
    throw new CoreException(status);
  }
  return core;
}

Fixed version (ground truth):
public synchronized BuildConnector getCore() throws CoreException {
  if (core != null) {
    return core;
  }
  if (status != null) {
    throw new CoreException(status);
  }
  IStatus result=descriptor.createConnector();
  if (result.isOK()) {
    descriptor.core.setLocationFactory(locationFactory);
    core=descriptor.core;
  }
 else {
    status=result;
  }
  if (status != null) {
    throw new CoreException(status);
  }
  return core;
}
Program: 96641
Project: 96641
Buggy source:
@Override public void applyTo(TaskRepository repository){
  super.applyTo(repository);
  repository.setProperty(IRepositoryConstants.PROPERTY_CATEGORY,IRepositoryConstants.CATEGORY_BUILD);
  BuildConnector buildConnector=getBuildConnector();
  if (buildConnector != null) {
    repository.setProperty(BuildTaskConnector.TASK_REPOSITORY_KEY_BUILD_CONNECTOR_KIND,buildConnector.getConnectorKind());
  }
 else {
    repository.setProperty(BuildTaskConnector.TASK_REPOSITORY_KEY_BUILD_CONNECTOR_KIND,null);
  }
  BuildServer server=getWorkingCopy();
  server.setConnectorKind(repository.getProperty(BuildTaskConnector.TASK_REPOSITORY_KEY_BUILD_CONNECTOR_KIND));
  server.setName(repository.getRepositoryLabel());
  server.setRepository(repository);
  server.setRepositoryUrl(repository.getRepositoryUrl());
  server.setUrl(repository.getRepositoryUrl());
}

Fixed version (ground truth):
@Override public void applyTo(TaskRepository repository){
  super.applyTo(repository);
  repository.setProperty(IRepositoryConstants.PROPERTY_CATEGORY,IRepositoryConstants.CATEGORY_BUILD);
  repository.setProperty(ITasksCoreConstants.PROPERTY_USE_SECURE_STORAGE,Boolean.TRUE.toString());
  BuildConnector buildConnector=getBuildConnector();
  if (buildConnector != null) {
    repository.setProperty(BuildTaskConnector.TASK_REPOSITORY_KEY_BUILD_CONNECTOR_KIND,buildConnector.getConnectorKind());
  }
 else {
    repository.setProperty(BuildTaskConnector.TASK_REPOSITORY_KEY_BUILD_CONNECTOR_KIND,null);
  }
  BuildServer server=getWorkingCopy();
  server.setConnectorKind(repository.getProperty(BuildTaskConnector.TASK_REPOSITORY_KEY_BUILD_CONNECTOR_KIND));
  server.setName(repository.getRepositoryLabel());
  server.setRepository(repository);
  server.setRepositoryUrl(repository.getRepositoryUrl());
  server.setUrl(repository.getRepositoryUrl());
}
Program: 96642
Project: 96642
Buggy source:
private void validateStatement(Statement statement,List<String> parameters){
  try {
    statement.validate(statements,parameters);
  }
 catch (  IllegalArgumentException e) {
    validator.add(new ValidationMessage("String_Node_Str","String_Node_Str",e.getCause().getMessage()));
    validator.onErrorUse(Results.logic()).forwardTo(getClass()).index(null);
  }
}

Fixed version (ground truth):
private void validateStatement(Statement statement,List<String> parameters){
  try {
    statement.validate(statements,parameters);
  }
 catch (  IllegalArgumentException e) {
    validator.add(new ValidationMessage("String_Node_Str","String_Node_Str",e.getCause().getMessage()));
    validator.onErrorUse(Results.logic()).redirectTo(getClass()).index(null);
  }
}
Program: 96643
Project: 96643
Buggy source:
@Path("String_Node_Str") @Get public void show(Statement statement,String password,Integer maxResults){
  statement=statements.load(statement.getId());
  boolean canView=currentUser.canCreateStatements() || statement.canBeAccessedWithKey(password);
  if (canView) {
    List<Object[]> results=executeStatement(statement,maxResults);
    List<String> columns=statement.getColumns();
    renderResponse(statement,results,columns,maxResults);
  }
 else {
    result.use(HttpResult.class).sendError(401);
  }
}

Fixed version (ground truth):
@Path("String_Node_Str") @Get public void show(Statement statement,String password,Integer maxResults){
  statement=statements.load(statement.getId());
  maxResults=(maxResults == null ? 100 : maxResults);
  boolean canView=currentUser.canCreateStatements() || statement.canBeAccessedWithKey(password);
  if (canView) {
    List<Object[]> results=executeStatement(statement,maxResults);
    List<String> columns=statement.getColumns();
    renderResponse(statement,results,columns,maxResults);
  }
 else {
    result.use(HttpResult.class).sendError(401);
  }
}
Program: 96644
Project: 96644
Buggy source:
public FreemarkerRoute(Route route,MutableRequest request){
  this.route=route;
  this.request=request;
}

Fixed version (ground truth):
public FreemarkerRoute(Route route){
  this.route=route;
}
Program: 96645
Project: 96645
Buggy source:
public String getControllerAndMethodName(){
  ResourceMethod resourceMethod=route.resourceMethod(this.request,this.route.getOriginalUri());
  String controllerName=resourceMethod.getResource().getType().getSimpleName();
  String methodName=resourceMethod.getMethod().getName();
  return controllerName + "String_Node_Str" + methodName;
}

Fixed version (ground truth):
public String getControllerAndMethodName(){
  Field resourceMethodField=new Mirror().on(FixedMethodStrategy.class).reflect().field("String_Node_Str");
  resourceMethodField.setAccessible(true);
  try {
    ResourceMethod resourceMethod=(ResourceMethod)resourceMethodField.get(route);
    return resourceMethod.getMethod().toString();
  }
 catch (  Exception e) {
    return "String_Node_Str" + e.getMessage();
  }
}
Program: 96646
Project: 96646
Buggy source:
private List<FreemarkerRoute> createRoutesForFreeMarker(List<Route> routes){
  List<FreemarkerRoute> freemakerRoutes=new ArrayList<FreemarkerRoute>();
  for (  Route route : routes) {
    freemakerRoutes.add(new FreemarkerRoute(route,this.request));
  }
  return freemakerRoutes;
}

Fixed version (ground truth):
private List<FreemarkerRoute> createRoutesForFreeMarker(List<Route> routes){
  List<FreemarkerRoute> freemakerRoutes=new ArrayList<FreemarkerRoute>();
  for (  Route route : routes) {
    freemakerRoutes.add(new FreemarkerRoute(route));
  }
  return freemakerRoutes;
}
Program: 96647
Project: 96647
Buggy source:
public RoutesController(Router router,MutableRequest request,Freemarker marker,Environment environment){
  this.router=router;
  this.request=request;
  this.marker=marker;
  this.environment=environment;
}

Fixed version (ground truth):
public RoutesController(Router router,Freemarker marker,Environment environment){
  this.router=router;
  this.marker=marker;
  this.environment=environment;
}
Program: 96648
Project: 96648
Buggy source:
@Before public void setUp() throws Exception {
  this.controller=new RoutesController(router,request,marker,environment);
  when(marker.use("String_Node_Str")).thenReturn(indexTemplate);
  when(indexTemplate.with(anyString(),any())).thenReturn(indexTemplate);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  this.controller=new RoutesController(router,marker,environment);
  when(marker.use("String_Node_Str")).thenReturn(indexTemplate);
  when(indexTemplate.with(anyString(),any())).thenReturn(indexTemplate);
}
Program: 96649
Project: 96649
Buggy source:
private void validateStatement(Statement statement,List<String> parameters){
  try {
    statement.validate(statements,parameters);
  }
 catch (  IllegalArgumentException e) {
    validator.add(new ValidationMessage("String_Node_Str","String_Node_Str",e.getCause().getMessage()));
    validator.onErrorUse(Results.logic()).redirectTo(getClass()).index(null);
  }
}

Fixed version (ground truth):
private void validateStatement(Statement statement,List<String> parameters){
  try {
    statement.validate(statements,parameters);
  }
 catch (  IllegalArgumentException e) {
    validator.add(new I18nMessage("String_Node_Str","String_Node_Str",e.getCause().getMessage()));
    validator.onErrorRedirectTo(this).index(null);
  }
}
Program: 96650
Project: 96650
Buggy source:
@Override public boolean accepts(ResourceMethod method){
  return true;
}

Fixed version (ground truth):
@Override public boolean accepts(ResourceMethod method){
  return method.getResource().getType().getPackage().getName().startsWith("String_Node_Str");
}
Program: 96651
Project: 96651
Buggy source:
public FreemarkerRoute(Route route,MutableRequest request){
  this.route=route;
  this.request=request;
}

Fixed version (ground truth):
public FreemarkerRoute(Route route){
  this.route=route;
}
Program: 96652
Project: 96652
Buggy source:
public String getControllerAndMethodName(){
  ResourceMethod resourceMethod=route.resourceMethod(this.request,this.route.getOriginalUri());
  String controllerName=resourceMethod.getResource().getType().getSimpleName();
  String methodName=resourceMethod.getMethod().getName();
  return controllerName + "String_Node_Str" + methodName;
}

Fixed version (ground truth):
public String getControllerAndMethodName(){
  Field resourceMethodField=new Mirror().on(FixedMethodStrategy.class).reflect().field("String_Node_Str");
  resourceMethodField.setAccessible(true);
  try {
    ResourceMethod resourceMethod=(ResourceMethod)resourceMethodField.get(route);
    return resourceMethod.getMethod().toString();
  }
 catch (  Exception e) {
    return "String_Node_Str" + e.getMessage();
  }
}
Program: 96653
Project: 96653
Buggy source:
private List<FreemarkerRoute> createRoutesForFreeMarker(List<Route> routes){
  List<FreemarkerRoute> freemakerRoutes=new ArrayList<FreemarkerRoute>();
  for (  Route route : routes) {
    freemakerRoutes.add(new FreemarkerRoute(route,this.request));
  }
  return freemakerRoutes;
}

Fixed version (ground truth):
private List<FreemarkerRoute> createRoutesForFreeMarker(List<Route> routes){
  List<FreemarkerRoute> freemakerRoutes=new ArrayList<FreemarkerRoute>();
  for (  Route route : routes) {
    freemakerRoutes.add(new FreemarkerRoute(route));
  }
  return freemakerRoutes;
}
Program: 96654
Project: 96654
Buggy source:
public RoutesController(Router router,MutableRequest request,Freemarker marker,Environment environment){
  this.router=router;
  this.request=request;
  this.marker=marker;
  this.environment=environment;
}

Fixed version (ground truth):
public RoutesController(Router router,Freemarker marker,Environment environment){
  this.router=router;
  this.marker=marker;
  this.environment=environment;
}
Program: 96655
Project: 96655
Buggy source:
@Before public void setUp() throws Exception {
  this.controller=new RoutesController(router,request,marker,environment);
  when(marker.use("String_Node_Str")).thenReturn(indexTemplate);
  when(indexTemplate.with(anyString(),any())).thenReturn(indexTemplate);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  this.controller=new RoutesController(router,marker,environment);
  when(marker.use("String_Node_Str")).thenReturn(indexTemplate);
  when(indexTemplate.with(anyString(),any())).thenReturn(indexTemplate);
}
Program: 96656
Project: 96656
Buggy source:
@Override public boolean accepts(ResourceMethod method){
  return true;
}

Fixed version (ground truth):
@Override public boolean accepts(ResourceMethod method){
  return method.getResource().getType().getPackage().getName().startsWith("String_Node_Str");
}
Program: 96657
Project: 96657
Buggy source:
private void checkPortAvailability(Connector connector){
  String hostName=(String)connector.getProperty("String_Node_Str");
  if (hostName == null) {
    if (!NetUtils.isPortAvailable(connector.getPort())) {
      this.eventLogger.log(TomcatLogEvents.PORT_IN_USE,connector.getPort());
      System.exit(-1);
    }
  }
 else {
    if (!NetUtils.isPortAvailable(hostName,connector.getPort())) {
      this.eventLogger.log(TomcatLogEvents.PORT_IN_USE,connector.getPort(),hostName);
      System.exit(-1);
    }
  }
}

Fixed version (ground truth):
private void checkPortAvailability(Connector connector){
  Object address=connector.getProperty("String_Node_Str");
  String hostName=(address != null) ? ((InetAddress)address).getHostAddress() : null;
  if (hostName == null) {
    if (!NetUtils.isPortAvailable(connector.getPort())) {
      this.eventLogger.log(TomcatLogEvents.PORT_IN_USE,connector.getPort());
      System.exit(-1);
    }
  }
 else {
    if (!NetUtils.isPortAvailable(hostName,connector.getPort())) {
      this.eventLogger.log(TomcatLogEvents.PORT_IN_USE,connector.getPort(),hostName);
      System.exit(-1);
    }
  }
}
Program: 96658
Project: 96658
Buggy source:
private void parse(InputStream in,PrintWriter out){
  Scanner scanner=new Scanner(in);
  String parsedLine;
  while (scanner.hasNextLine()) {
    parsedLine=parseLine(scanner.nextLine());
    if (parsedLine != null && !parsedLine.trim().isEmpty()) {
      out.append(parsedLine);
      out.append('\n');
    }
  }
}

Fixed version (ground truth):
private void parse(InputStream in,PrintWriter out){
  try (Scanner scanner=new Scanner(in,StandardCharsets.UTF_8.name())){
    String parsedLine;
    while (scanner.hasNextLine()) {
      parsedLine=parseLine(scanner.nextLine());
      if (parsedLine != null && !parsedLine.trim().isEmpty()) {
        out.append(parsedLine);
        out.append('\n');
      }
    }
  }
 }
Program: 96661
Project: 96661
Buggy source:
IAgileTeam getAgileTeam(IAgileItem item);

Fixed version (ground truth):
/** 
 * @return agile team from team definition relation, then sprint relation, then backlog relation. Else null.
 */
IAgileTeam getAgileTeam(IAtsWorkItem workItem);
Program: 96662
Project: 96662
Buggy source:
@Override public IAgileTeam getAgileTeam(IAgileItem item){
  ArtifactId itemArt=services.getArtifact(item);
  ArtifactId backlogArt=services.getRelationResolver().getRelatedOrNull(itemArt,AtsRelationTypes.Goal_Member);
  if (backlogArt != null) {
    ArtifactId teamArt=services.getRelationResolver().getRelatedOrNull(backlogArt,AtsRelationTypes.AgileTeamToBacklog_AgileTeam);
    if (teamArt != null) {
      return services.getConfigItemFactory().getAgileTeam(teamArt);
    }
  }
  ArtifactId sprintArt=services.getRelationResolver().getRelatedOrNull(itemArt,AtsRelationTypes.AgileSprintToItem_Sprint);
  if (sprintArt != null) {
    ArtifactId teamArt=services.getRelationResolver().getRelatedOrNull(sprintArt,AtsRelationTypes.AgileTeamToSprint_AgileTeam);
    if (teamArt != null) {
      return services.getConfigItemFactory().getAgileTeam(teamArt);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public IAgileTeam getAgileTeam(IAtsWorkItem workItem){
  IAgileTeam agileTeam=null;
  IAtsTeamWorkflow teamWf=workItem.getParentTeamWorkflow();
  if (teamWf != null) {
    IAtsTeamDefinition teamDef=teamWf.getTeamDefinition();
    if (teamDef != null) {
      ArtifactId agileTeamArt=services.getRelationResolver().getRelatedOrNull(teamDef,AtsRelationTypes.AgileTeamToAtsTeam_AgileTeam);
      if (agileTeamArt != null) {
        agileTeam=services.getAgileService().getAgileTeam(agileTeamArt);
      }
    }
    if (agileTeam == null) {
      ArtifactId sprintArt=services.getRelationResolver().getRelatedOrNull(workItem,AtsRelationTypes.AgileSprintToItem_Sprint);
      if (sprintArt != null) {
        IAgileSprint sprint=getAgileSprint(sprintArt);
        if (sprint != null) {
          agileTeam=services.getAgileService().getAgileTeamFromSprint(sprint);
        }
      }
    }
    if (agileTeam == null) {
      ArtifactId backlogArt=services.getRelationResolver().getRelatedOrNull(workItem,AtsRelationTypes.Goal_Goal);
      if (backlogArt != null) {
        IAgileBacklog backlog=getAgileBacklog(backlogArt);
        if (backlog != null) {
          agileTeam=services.getAgileService().getAgileTeamFromBacklog(backlog);
        }
      }
    }
  }
  return agileTeam;
}
Program: 96663
Project: 96663
Buggy source:
@Override public String getText(IAtsObject atsObject) throws Exception {
  String result="String_Node_Str";
  if (atsObject instanceof IAtsWorkItem) {
    ArtifactToken sprintArt=services.getRelationResolver().getRelatedOrNull(atsObject,AtsRelationTypes.AgileSprintToItem_Sprint);
    Conditions.assertNotNull(sprintArt,"String_Node_Str",atsObject.toStringWithId());
    if (sprintArt != null) {
      ArtifactToken agileTeamArt=services.getRelationResolver().getRelatedOrNull(sprintArt,AtsRelationTypes.AgileTeamToSprint_AgileTeam);
      Conditions.assertNotNull(agileTeamArt,"String_Node_Str",sprintArt.toStringWithId());
      AttributeTypeId pointsAttrType=AtsAttributeTypes.Points;
      String pointsAttrTypeName=services.getAttributeResolver().getSoleAttributeValue(agileTeamArt,AtsAttributeTypes.PointsAttributeType,"String_Node_Str");
      if (Strings.isValid(pointsAttrTypeName)) {
        AttributeTypeId type=services.getStoreService().getAttributeType(pointsAttrTypeName);
        if (type.isValid()) {
          pointsAttrType=type;
        }
      }
      result=services.getAttributeResolver().getSoleAttributeValue(atsObject,pointsAttrType,"String_Node_Str");
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public String getText(IAtsObject atsObject) throws Exception {
  String result="String_Node_Str";
  if (atsObject instanceof IAtsWorkItem) {
    result=services.getAgileService().getAgileTeamPointsStr((IAtsWorkItem)atsObject);
  }
  return result;
}
Program: 96667
Project: 96667
Buggy source:
@Override public boolean editDispoItem(BranchId branch,String itemId,DispoItemData newDispoItem){
  boolean wasUpdated=false;
  DispoItem dispoItemToEdit=getQuery().findDispoItemById(branch,itemId);
  if (dispoItemToEdit != null && newDispoItem.getAnnotationsList() == null && newDispoItem.getDiscrepanciesList() == null) {
    ArtifactReadable author=getQuery().findUser();
    DispoStorageMetadata metadata=new DispoStorageMetadata();
    getWriter().updateDispoItem(author,branch,dispoItemToEdit.getGuid(),newDispoItem,metadata);
    if (!metadata.getIdsOfUpdatedItems().isEmpty()) {
      updateBroadcaster.broadcastUpdateItems(metadata.getIdsOfUpdatedItems(),singleton(newDispoItem),getDispoItemParentSet(branch,itemId));
    }
    wasUpdated=true;
  }
  return wasUpdated;
}

Fixed version (ground truth):
@Override public boolean editDispoItem(BranchId branch,String itemId,DispoItemData newDispoItem){
  boolean wasUpdated=false;
  DispoItem dispoItemToEdit=getQuery().findDispoItemById(branch,itemId);
  if (dispoItemToEdit != null && newDispoItem.getAnnotationsList() == null && newDispoItem.getDiscrepanciesList() == null) {
    ArtifactReadable author=getQuery().findUser();
    DispoStorageMetadata metadata=new DispoStorageMetadata();
    try {
      Date date=DispoUtil.getTimestampOfFile(getFullFilePathFromDispoItemId(branch,itemId,dispoItemToEdit));
      newDispoItem.setLastUpdate(date);
    }
 catch (    Throwable ex) {
      throw new OseeCoreException(ex);
    }
    getWriter().updateDispoItem(author,branch,dispoItemToEdit.getGuid(),newDispoItem,metadata);
    if (!metadata.getIdsOfUpdatedItems().isEmpty()) {
      updateBroadcaster.broadcastUpdateItems(metadata.getIdsOfUpdatedItems(),singleton(newDispoItem),getDispoItemParentSet(branch,itemId));
    }
    wasUpdated=true;
  }
  return wasUpdated;
}
Program: 96669
Project: 96669
Buggy source:
private void processFunction(VCastInstrumentedFile lisFile,VCastLisFileParser lisFileParser,int fileNum,VCastDataStore dataStore,VCastInstrumentedFile instrumentedFile,VCastFunction function,boolean isMCDCFile,OperationReport report){
  int functionNum=function.getFindex();
  DispoItemData newItem=new DispoItemData();
  newItem.setAnnotationsList(new ArrayList<DispoAnnotationData>());
  VCastSourceFileJoin sourceFileJoin=dataStore.getSourceFileJoin(lisFile);
  newItem.setName(sourceFileJoin.getDisplayName() + "String_Node_Str" + function.getName());
  newItem.setFileNumber(Integer.toString(fileNum));
  newItem.setMethodNumber(Integer.toString(functionNum));
  String datId=generateDatId(fileNum,functionNum);
  datIdToItem.put(datId,newItem);
  Collection<VCastStatementCoverage> statementCoverageItems=Collections.emptyList();
  try {
    statementCoverageItems=dataStore.getStatementCoverageLines(function);
  }
 catch (  OseeCoreException ex) {
    report.addEntry("String_Node_Str",String.format("String_Node_Str",instrumentedFile.getId(),function.getId(),ex.getMessage()),ERROR);
  }
  Map<String,Discrepancy> discrepancies=new HashMap<>();
  for (  VCastStatementCoverage statementCoverageItem : statementCoverageItems) {
    processStatement(lisFile,lisFileParser,fileNum,functionNum,function,statementCoverageItem,isMCDCFile,discrepancies,report);
  }
  newItem.setDiscrepanciesList(discrepancies);
}

Fixed version (ground truth):
private void processFunction(VCastInstrumentedFile lisFile,VCastLisFileParser lisFileParser,int fileNum,VCastDataStore dataStore,VCastInstrumentedFile instrumentedFile,VCastFunction function,boolean isMCDCFile,OperationReport report){
  int functionNum=function.getFindex();
  DispoItemData newItem=new DispoItemData();
  newItem.setAnnotationsList(new ArrayList<DispoAnnotationData>());
  VCastSourceFileJoin sourceFileJoin=dataStore.getSourceFileJoin(lisFile);
  newItem.setName(sourceFileJoin.getDisplayName() + "String_Node_Str" + function.getName());
  newItem.setFileNumber(Integer.toString(fileNum));
  newItem.setMethodNumber(Integer.toString(functionNum));
  try {
    Date lastModified=DispoUtil.getTimestampOfFile(lisFile.getLISFile());
    newItem.setLastUpdate(lastModified);
  }
 catch (  Throwable ex) {
    report.addEntry("String_Node_Str",String.format("String_Node_Str",instrumentedFile.getId(),ex.getMessage()),ERROR);
  }
  String datId=generateDatId(fileNum,functionNum);
  datIdToItem.put(datId,newItem);
  Collection<VCastStatementCoverage> statementCoverageItems=Collections.emptyList();
  try {
    statementCoverageItems=dataStore.getStatementCoverageLines(function);
  }
 catch (  OseeCoreException ex) {
    report.addEntry("String_Node_Str",String.format("String_Node_Str",instrumentedFile.getId(),function.getId(),ex.getMessage()),ERROR);
  }
  Map<String,Discrepancy> discrepancies=new HashMap<>();
  for (  VCastStatementCoverage statementCoverageItem : statementCoverageItems) {
    processStatement(lisFile,lisFileParser,fileNum,functionNum,function,statementCoverageItem,isMCDCFile,discrepancies,report);
  }
  newItem.setDiscrepanciesList(discrepancies);
}
Program: 96670
Project: 96670
Buggy source:
public List<Artifact> getOppositeArtifacts(){
  List<Artifact> oppositeArtifacts=new ArrayList<>();
  for (  RelationLink link : artifact.getRelationsAll(DeletionFlag.EXCLUDE_DELETED)) {
    if (link.getRelationType().getName().equals(relationTypeName)) {
      if (link.getAArtifactId() == artifactId) {
        oppositeArtifacts.add(link.getArtifactB());
      }
 else {
        oppositeArtifacts.add(link.getArtifactA());
      }
    }
  }
  return oppositeArtifacts;
}

Fixed version (ground truth):
public List<Artifact> getOppositeArtifacts(){
  List<Artifact> oppositeArtifacts=new ArrayList<>();
  RelationTypeSide relationSide=new RelationTypeSide(relationType,parentIsOnSideA ? RelationSide.SIDE_B : RelationSide.SIDE_A);
  oppositeArtifacts.addAll(artifact.getRelatedArtifacts(relationSide,DeletionFlag.EXCLUDE_DELETED));
  return oppositeArtifacts;
}
Program: 96671
Project: 96671
Buggy source:
@Before public void setUp(){
  MockitoAnnotations.initMocks(this);
  branch=BranchId.valueOf(23L);
  when(setId.getGuid()).thenReturn("String_Node_Str");
  when(itemId.getGuid()).thenReturn("String_Node_Str");
  when(mockBranch.getName()).thenReturn("String_Node_Str");
  when(storage.findUser()).thenReturn(author);
  when(storageProvider.get()).thenReturn(storage);
  dispoApi.setStorageProvider(storageProvider);
  dispoApi.setDataFactory(dataFactory);
  dispoApi.setDispoConnector(dispoConnector);
  dispoApi.setResolutionValidator(validator);
  dispoApi.setLogger(logger);
  dispoApi.start();
}

Fixed version (ground truth):
@Before public void setUp(){
  MockitoAnnotations.initMocks(this);
  branch=BranchId.valueOf(23L);
  when(setId.getGuid()).thenReturn("String_Node_Str");
  when(itemId.getGuid()).thenReturn("String_Node_Str");
  when(mockBranch.getName()).thenReturn("String_Node_Str");
  when(storage.findUser()).thenReturn(author);
  when(storageProvider.get()).thenReturn(storage);
  dispoApi.setStorageProvider(storageProvider);
  dispoApi.setDataFactory(dataFactory);
  dispoApi.setDispoConnector(dispoConnector);
  dispoApi.setResolutionValidator(validator);
  dispoApi.setLogger(logger);
  dispoApi.start(mockConfigProperties);
}
Program: 96672
Project: 96672
Buggy source:
public void start(){
  logger.trace("String_Node_Str");
  importerFactory=new DispoImporterFactory(dataFactory,executor,logger);
}

Fixed version (ground truth):
public void start(Map<String,Object> props){
  logger.trace("String_Node_Str");
  importerFactory=new DispoImporterFactory(dataFactory,executor,logger);
  update(props);
}
Program: 96677
Project: 96677
Buggy source:
private static Collection<IAgileFeatureGroup> getSelectedFeatureGroups(Collection<? extends AbstractWorkflowArtifact> awas){
  List<IAgileFeatureGroup> selected=new LinkedList<>();
  if (awas.size() == 1) {
    for (    Artifact featureArt : awas.iterator().next().getRelatedArtifacts(AtsRelationTypes.AgileFeatureToItem_FeatureGroup)) {
      IAgileFeatureGroup featureGroup=AtsClientService.get().getConfigItemFactory().getAgileFeatureGroup(featureArt);
      if (featureGroup.isActive()) {
        selected.add(featureGroup);
      }
    }
  }
  return selected;
}

Fixed version (ground truth):
private static Collection<JaxAgileFeatureGroup> getSelectedFeatureGroups(Collection<? extends AbstractWorkflowArtifact> awas){
  List<JaxAgileFeatureGroup> selected=new LinkedList<>();
  if (awas.size() == 1) {
    for (    Artifact featureArt : awas.iterator().next().getRelatedArtifacts(AtsRelationTypes.AgileFeatureToItem_FeatureGroup)) {
      IAgileFeatureGroup featureGroup=AtsClientService.get().getConfigItemFactory().getAgileFeatureGroup(featureArt);
      if (featureGroup.isActive()) {
        selected.add(createJaxAgileFeatureGroupFromAgileFeatureGroup(featureGroup));
      }
    }
  }
  return selected;
}
Program: 96681
Project: 96681
Buggy source:
/** 
 * Return current date or null if not set
 * @return date or null if not set
 */
@Override public Date getValue() throws OseeCoreException {
  Object value=getAttributeDataProvider().getValue();
  return new Date((Long)value);
}

Fixed version (ground truth):
@Override public Date getValue() throws OseeCoreException {
  Object value=getAttributeDataProvider().getValue();
  return new Date((Long)value);
}
Program: 96682
Project: 96682
Buggy source:
/** 
 * Return date in format given by pattern or "" if not set
 * @param pattern DateAttribute.MMDDYY, etc...
 * @return formated date
 */
public String getAsFormattedString(DateFormat dateFormat) throws OseeCoreException {
  Date date=getValue();
  return date != null ? dateFormat.format(date) : "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Return date in format given by pattern or "" if not set
 * @param pattern DateAttribute.MMDDYY, etc...
 * @return formated date
 */
public String getAsFormattedString(DateFormat dateFormat) throws OseeCoreException {
  return dateFormat.format(getValue());
}
Program: 96683
Project: 96683
Buggy source:
/** 
 * Sets date
 * @param value value or null to clear
 */
@Override public boolean subClassSetValue(Date value) throws OseeCoreException {
  return getAttributeDataProvider().setValue(value != null ? value.getTime() : "String_Node_Str");
}

Fixed version (ground truth):
@Override public boolean subClassSetValue(Date value) throws OseeCoreException {
  if (value == null) {
    OseeLog.log(this.getClass(),Level.SEVERE,String.format("String_Node_Str",getAttributeType(),getGammaId()));
    return false;
  }
  return getAttributeDataProvider().setValue(value.getTime());
}
Program: 96685
Project: 96685
Buggy source:
private String getLinkId(LinkType destLinkType,ArtifactReadable artifact,TransactionId tx,String sessionId,String oseeLink) throws OseeCoreException {
  String toReturn;
  if (destLinkType == LinkType.OSEE_SERVER_LINK) {
    toReturn=escapeXml(oseeLink);
  }
 else {
    toReturn=artifact.getGuid();
  }
  return toReturn;
}

Fixed version (ground truth):
private String getLinkId(LinkType destLinkType,ArtifactReadable artifact,TransactionId tx,String sessionId,String oseeLink) throws OseeCoreException {
  String toReturn;
  if (destLinkType == LinkType.OSEE_SERVER_LINK) {
    toReturn=escapeXml(oseeLink);
    toReturn=toReturn.replaceAll("String_Node_Str",artifact.getGuid());
  }
 else {
    toReturn=artifact.getGuid();
  }
  return toReturn;
}
Program: 96686
Project: 96686
Buggy source:
@Override public Map<String,List<String>> getBranchViewFeatureValues(BranchId branch,ArtifactId viewId){
  Map<String,List<String>> toReturn=new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
  List<ApplicabilityToken> result=getViewApplicabilityTokens(viewId,branch);
  for (  ApplicabilityToken app : result) {
    if (!app.getName().equalsIgnoreCase("String_Node_Str")) {
      String[] values=app.getName().split("String_Node_Str");
      if (values.length <= 2) {
        String name=values[0].trim();
        String value=values[1].trim();
        if (toReturn.containsKey(name)) {
          List<String> list=new ArrayList<>();
          list.addAll(toReturn.get(name));
          list.add(value);
          toReturn.put(name,list);
        }
 else {
          toReturn.put(name,Arrays.asList(value));
        }
      }
    }
  }
  return toReturn;
}

Fixed version (ground truth):
@Override public Map<String,List<String>> getBranchViewFeatureValues(BranchId branch,ArtifactId viewId){
  Map<String,List<String>> toReturn=new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
  List<ApplicabilityToken> result=getViewApplicabilityTokens(viewId,branch);
  for (  ApplicabilityToken app : result) {
    if (!app.getName().equalsIgnoreCase("String_Node_Str") && !app.getName().contains("String_Node_Str") && !app.getName().contains("String_Node_Str")) {
      String[] values=app.getName().split("String_Node_Str");
      if (values.length <= 2) {
        String name=values[0].trim();
        String value=values[1].trim();
        if (toReturn.containsKey(name)) {
          List<String> list=new ArrayList<>();
          list.addAll(toReturn.get(name));
          list.add(value);
          toReturn.put(name,list);
        }
 else {
          toReturn.put(name,Arrays.asList(value));
        }
      }
    }
  }
  return toReturn;
}
Program: 96690
Project: 96690
Buggy source:
private Collection<VCastStatementCoverage> getStatementCoverageLinesWithBranch(VCastFunction function){
  Collection<VCastStatementCoverage> toReturn=new ArrayList<>();
  JdbcStatement stmt=getStatement();
  try {
    String query="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
    stmt.runPreparedQuery(query,function.getId());
    while (stmt.next()) {
      Integer id=stmt.getInt("String_Node_Str");
      Integer line=stmt.getInt("String_Node_Str");
      Integer hit_count=stmt.getInt("String_Node_Str");
      Integer max_hit_count=stmt.getInt("String_Node_Str");
      Integer num_conditions=stmt.getInt("String_Node_Str");
      toReturn.add(new VCastStatementCoverage(id,function.getId(),line,hit_count,max_hit_count,false,"String_Node_Str","String_Node_Str",num_conditions));
    }
  }
 catch (  Exception ex) {
    System.out.println(ex);
  }
 finally {
    stmt.close();
  }
  return toReturn;
}

Fixed version (ground truth):
private Collection<VCastStatementCoverage> getStatementCoverageLinesWithBranch(VCastFunction function){
  Collection<VCastStatementCoverage> toReturn=new ArrayList<>();
  JdbcStatement stmt=getStatement();
  try {
    String query="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
    stmt.runPreparedQuery(query,function.getId(),function.getId());
    while (stmt.next()) {
      Integer id=stmt.getInt("String_Node_Str");
      Integer line=stmt.getInt("String_Node_Str");
      Integer hit_count=stmt.getInt("String_Node_Str");
      Integer max_hit_count=stmt.getInt("String_Node_Str");
      Integer num_conditions=stmt.getInt("String_Node_Str");
      toReturn.add(new VCastStatementCoverage(id,function.getId(),line,hit_count,max_hit_count,false,"String_Node_Str","String_Node_Str",num_conditions));
    }
  }
 catch (  Exception ex) {
    System.out.println(ex);
  }
 finally {
    stmt.close();
  }
  return toReturn;
}
Program: 96691
Project: 96691
Buggy source:
private BranchId getBranch(){
  Conditions.assertNotNull(editor,"String_Node_Str");
  ChangeReportEditorInput editorInput=editor.getEditorInput();
  if (editorInput != null) {
    BranchId branch=editorInput.getBranch();
    if (branch == null) {
      button.setEnabled(false);
    }
    return branch;
  }
  return null;
}

Fixed version (ground truth):
private BranchId getBranch(){
  Conditions.assertNotNull(editor,"String_Node_Str");
  ChangeReportEditorInput editorInput=editor.getEditorInput();
  if (editorInput != null) {
    BranchId branch=editorInput.getBranch();
    if (branch == null && button != null && !button.isDisposed()) {
      button.setEnabled(false);
    }
    return branch;
  }
  return null;
}
Program: 96693
Project: 96693
Buggy source:
@Override public void writeRow(Object... row) throws IOException {
  if (row[0] instanceof Collection<?>) {
    int rowLength=((Collection<?>)row[0]).size();
    Collection<?> values=(Collection<?>)row[0];
    for (    Object obj : values) {
      writeCell(obj,implicitCellIndex,rowLength);
    }
  }
  for (int i=0; i < row.length; i++) {
    writeCell(row[i],implicitCellIndex,row.length);
  }
  endRow();
}

Fixed version (ground truth):
@Override public void writeRow(Object... row) throws IOException {
  for (int i=0; i < row.length; i++) {
    writeCell(row[i],implicitCellIndex,row.length);
  }
  endRow();
}
Program: 96694
Project: 96694
Buggy source:
public void writeRow(Collection<Object> row) throws IOException ;

Fixed version (ground truth):
public void writeRow(Collection<?> row) throws IOException ;
Program: 96696
Project: 96696
Buggy source:
private boolean isFeatureValuePairValid(String feature,String value){
  if (viewApplicabilitiesMap.containsKey(feature)) {
    Collection<String> validValues=viewApplicabilitiesMap.get(feature);
    value=value.equalsIgnoreCase("String_Node_Str") ? getDefaultValue(feature) : value;
    if (containsIgnoreCase(validValues,value)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isFeatureValuePairValid(String feature,String value){
  if (viewApplicabilitiesMap.containsKey(feature)) {
    Collection<String> validValues=viewApplicabilitiesMap.get(feature);
    value=value.equalsIgnoreCase("String_Node_Str") ? getDefaultValue(feature) : value.trim();
    if (containsIgnoreCase(validValues,value)) {
      return true;
    }
  }
  return false;
}
Program: 96697
Project: 96697
Buggy source:
private boolean isValidConfigurationBracket(String beginConfig){
  beginConfig=WordCoreUtil.textOnly(beginConfig);
  int start=beginConfig.indexOf("String_Node_Str") + 1;
  int end=beginConfig.indexOf("String_Node_Str");
  String applicExpText=beginConfig.substring(start,end);
  String[] configs=applicExpText.split("String_Node_Str");
  for (int i=0; i < configs.length; i++) {
    configs[i]=configs[i].split("String_Node_Str")[0];
    if (!containsIgnoreCase(validConfigurations,configs[i])) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean isValidConfigurationBracket(String beginConfig){
  beginConfig=WordCoreUtil.textOnly(beginConfig);
  int start=beginConfig.indexOf("String_Node_Str") + 1;
  int end=beginConfig.indexOf("String_Node_Str");
  String applicExpText=beginConfig.substring(start,end);
  String[] configs=applicExpText.split("String_Node_Str");
  for (int i=0; i < configs.length; i++) {
    configs[i]=configs[i].split("String_Node_Str")[0].trim();
    if (!containsIgnoreCase(validConfigurations,configs[i])) {
      return false;
    }
  }
  return true;
}
Program: 96698
Project: 96698
Buggy source:
private static boolean isValidConfigurationBracket(String beginConfig,Set<String> allValidConfigurations){
  beginConfig=WordCoreUtil.textOnly(beginConfig);
  int start=beginConfig.indexOf("String_Node_Str") + 1;
  int end=beginConfig.indexOf("String_Node_Str");
  String applicExpText=beginConfig.substring(start,end);
  String[] configs=applicExpText.split("String_Node_Str");
  for (int i=0; i < configs.length; i++) {
    configs[i]=configs[i].split("String_Node_Str")[0];
    if (!containsIgnoreCase(allValidConfigurations,configs[i])) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private static boolean isValidConfigurationBracket(String beginConfig,Set<String> allValidConfigurations){
  beginConfig=WordCoreUtil.textOnly(beginConfig);
  int start=beginConfig.indexOf("String_Node_Str") + 1;
  int end=beginConfig.indexOf("String_Node_Str");
  String applicExpText=beginConfig.substring(start,end);
  String[] configs=applicExpText.split("String_Node_Str");
  for (int i=0; i < configs.length; i++) {
    configs[i]=configs[i].split("String_Node_Str")[0].trim();
    if (!containsIgnoreCase(allValidConfigurations,configs[i])) {
      return false;
    }
  }
  return true;
}
Program: 96699
Project: 96699
Buggy source:
public static boolean isExpressionInvalid(String expression,BranchId branch,HashCollection<String,String> validFeatureValues){
  ApplicabilityGrammarLexer lex=new ApplicabilityGrammarLexer(new ANTLRStringStream(expression.toUpperCase()));
  ApplicabilityGrammarParser parser=new ApplicabilityGrammarParser(new CommonTokenStream(lex));
  try {
    parser.start();
  }
 catch (  RecognitionException ex) {
    return true;
  }
  HashMap<String,List<String>> featureIdValuesMap=parser.getIdValuesMap();
  for (  String featureId : featureIdValuesMap.keySet()) {
    if (validFeatureValues.containsKey(featureId.toUpperCase())) {
      List<String> values=featureIdValuesMap.get(featureId);
      if (values.contains("String_Node_Str")) {
        continue;
      }
      Collection<String> validValues=validFeatureValues.getValues(featureId.toUpperCase());
      for (      String val : values) {
        if (val.equals("String_Node_Str") || val.equals("String_Node_Str") || val.equals("String_Node_Str")|| val.equals("String_Node_Str")) {
          continue;
        }
        if (!containsIgnoreCase(validValues,val)) {
          return true;
        }
      }
    }
 else {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isExpressionInvalid(String expression,BranchId branch,HashCollection<String,String> validFeatureValues){
  ApplicabilityGrammarLexer lex=new ApplicabilityGrammarLexer(new ANTLRStringStream(expression.toUpperCase()));
  ApplicabilityGrammarParser parser=new ApplicabilityGrammarParser(new CommonTokenStream(lex));
  try {
    parser.start();
  }
 catch (  RecognitionException ex) {
    return true;
  }
  HashMap<String,List<String>> featureIdValuesMap=parser.getIdValuesMap();
  for (  String featureId : featureIdValuesMap.keySet()) {
    featureId=featureId.trim();
    if (validFeatureValues.containsKey(featureId.toUpperCase())) {
      List<String> values=featureIdValuesMap.get(featureId);
      if (values.contains("String_Node_Str")) {
        continue;
      }
      Collection<String> validValues=validFeatureValues.getValues(featureId.toUpperCase());
      for (      String val : values) {
        val=val.trim();
        if (val.equals("String_Node_Str") || val.equals("String_Node_Str") || val.equals("String_Node_Str")|| val.equals("String_Node_Str")) {
          continue;
        }
        if (!containsIgnoreCase(validValues,val)) {
          return true;
        }
      }
    }
 else {
      return true;
    }
  }
  return false;
}
Program: 96700
Project: 96700
Buggy source:
public String getValidConfigurationContent(String fullText,HashMap<String,List<String>> id_value_map){
  Matcher match=WordCoreUtil.ELSE_PATTERN.matcher(fullText);
  String beginningText=fullText;
  String elseText="String_Node_Str";
  if (match.find()) {
    beginningText=fullText.substring(0,match.start());
    elseText=fullText.substring(match.end());
    elseText=elseText.replaceAll(WordCoreUtil.ENDCONFIG,"String_Node_Str");
    elseText=elseText.replaceAll(WordCoreUtil.BEGINCONFIG,"String_Node_Str");
  }
  String toReturn="String_Node_Str";
  List<String> values=id_value_map.get(configurationsAllowed.iterator().next().toUpperCase());
  if (values != null) {
    String value=values.get(0);
    if (!value.toLowerCase().equals("String_Node_Str")) {
      toReturn=beginningText;
    }
  }
  return toReturn;
}

Fixed version (ground truth):
public String getValidConfigurationContent(String fullText,HashMap<String,List<String>> id_value_map){
  Matcher match=WordCoreUtil.ELSE_PATTERN.matcher(fullText);
  String beginningText=fullText;
  String elseText="String_Node_Str";
  if (match.find()) {
    beginningText=fullText.substring(0,match.start());
    elseText=fullText.substring(match.end());
    elseText=elseText.replaceAll(WordCoreUtil.ENDCONFIG,"String_Node_Str");
    elseText=elseText.replaceAll(WordCoreUtil.BEGINCONFIG,"String_Node_Str");
  }
  String toReturn="String_Node_Str";
  List<String> values=id_value_map.get(configurationsAllowed.iterator().next().toUpperCase());
  if (values != null) {
    String value=values.get(0);
    if (!value.toLowerCase().equals("String_Node_Str")) {
      toReturn=beginningText;
    }
  }
 else {
    boolean isExcluded=false;
    for (    Entry<String,List<String>> entry : id_value_map.entrySet()) {
      List<String> value=entry.getValue();
      isExcluded=value.get(0).toLowerCase().equals("String_Node_Str") ? true : false;
      if (!isExcluded) {
        break;
      }
    }
    toReturn=isExcluded ? beginningText : "String_Node_Str";
  }
  return toReturn;
}
Program: 96701
Project: 96701
Buggy source:
public static void setLastBranch(IOseeBranch branch){
  lastBranch=branch;
}

Fixed version (ground truth):
public static void setLastBranch(BranchId branch){
  lastBranch=branch;
}
Program: 96702
Project: 96702
Buggy source:
public static IOseeBranch getLastBranch(){
  if (lastBranch == null) {
    try {
      Long branchUuid=Long.valueOf(UserManager.getSetting(LAST_DEFAULT_BRANCH));
      lastBranch=getBranch(branchUuid);
    }
 catch (    Exception ex) {
      try {
        lastBranch=getBranchToken(getDefaultInitialBranch());
        UserManager.setSetting(LAST_DEFAULT_BRANCH,lastBranch.getUuid());
      }
 catch (      OseeCoreException ex1) {
        OseeLog.log(Activator.class,Level.SEVERE,ex1);
      }
    }
  }
  return lastBranch;
}

Fixed version (ground truth):
public static BranchId getLastBranch(){
  if (lastBranch == null) {
    try {
      Long branchUuid=Long.valueOf(UserManager.getSetting(LAST_DEFAULT_BRANCH));
      lastBranch=getBranch(branchUuid);
    }
 catch (    Exception ex) {
      try {
        lastBranch=getBranchToken(getDefaultInitialBranch());
        UserManager.setSetting(LAST_DEFAULT_BRANCH,lastBranch.getUuid());
      }
 catch (      OseeCoreException ex1) {
        OseeLog.log(Activator.class,Level.SEVERE,ex1);
      }
    }
  }
  return lastBranch;
}
Program: 96703
Project: 96703
Buggy source:
private void handleSelectedBranch(Event event){
  if (event.widget == branchSelectButton || event.widget == branchSelectTextWidget && branchSelectTextWidget.getDoubleClickEnabled()) {
    if (areOnlyWorkingBranchesAllowed()) {
      IOseeBranch newBranch=BranchSelectionDialog.getWorkingBranchFromUser();
      if (newBranch != null) {
        setSelected(newBranch);
      }
    }
 else {
      IOseeBranch newBranch=BranchSelectionDialog.getBranchFromUser();
      if (newBranch != null) {
        setSelected(newBranch);
      }
    }
  }
}

Fixed version (ground truth):
private void handleSelectedBranch(Event event){
  if (event.widget == branchSelectButton || event.widget == branchSelectTextWidget && branchSelectTextWidget.getDoubleClickEnabled()) {
    if (areOnlyWorkingBranchesAllowed()) {
      BranchId newBranch=BranchSelectionDialog.getWorkingBranchFromUser();
      if (newBranch != null) {
        setSelected(newBranch);
      }
    }
 else {
      BranchId newBranch=BranchSelectionDialog.getBranchFromUser();
      if (newBranch != null) {
        setSelected(newBranch);
      }
    }
  }
}
Program: 96704
Project: 96704
Buggy source:
private void storeSelectedBranch(){
  List<IOseeBranch> branches=branchWidget.getSelectedBranches();
  if (!branches.isEmpty()) {
    selected=branches.iterator().next();
    BranchManager.setLastBranch(selected);
    lastSelectedBranch=selected;
  }
}

Fixed version (ground truth):
private void storeSelectedBranch(){
  List<BranchId> branches=branchWidget.getSelectedBranches();
  if (!branches.isEmpty()) {
    selected=branches.iterator().next();
    BranchManager.setLastBranch(selected);
    lastSelectedBranch=selected;
  }
}
Program: 96705
Project: 96705
Buggy source:
public static IOseeBranch getBranchFromUser(){
  return createDialog(false);
}

Fixed version (ground truth):
public static BranchId getBranchFromUser(){
  return createDialog(false);
}
Program: 96706
Project: 96706
Buggy source:
private static IOseeBranch createDialog(boolean allowOnlyWorkingBranches){
  IOseeBranch toReturn=null;
  BranchSelectionDialog branchSelection=new BranchSelectionDialog("String_Node_Str",allowOnlyWorkingBranches);
  if (lastSelectedBranch != null) {
    try {
      if (!BranchManager.isArchived(lastSelectedBranch)) {
        branchSelection.setDefaultSelection(lastSelectedBranch);
      }
    }
 catch (    OseeCoreException ex) {
    }
  }
  int result=branchSelection.open();
  if (result == Window.OK) {
    toReturn=branchSelection.getSelection();
  }
  return toReturn;
}

Fixed version (ground truth):
private static BranchId createDialog(boolean allowOnlyWorkingBranches){
  BranchId toReturn=null;
  BranchSelectionDialog branchSelection=new BranchSelectionDialog("String_Node_Str",allowOnlyWorkingBranches);
  if (lastSelectedBranch != null) {
    try {
      if (!BranchManager.isArchived(lastSelectedBranch)) {
        branchSelection.setDefaultSelection(lastSelectedBranch);
      }
    }
 catch (    OseeCoreException ex) {
    }
  }
  int result=branchSelection.open();
  if (result == Window.OK) {
    toReturn=branchSelection.getSelection();
  }
  return toReturn;
}
Program: 96707
Project: 96707
Buggy source:
public IOseeBranch getSelection(){
  return selected;
}

Fixed version (ground truth):
public BranchId getSelection(){
  return selected;
}
Program: 96708
Project: 96708
Buggy source:
public static IOseeBranch getWorkingBranchFromUser(){
  return createDialog(true);
}

Fixed version (ground truth):
public static BranchId getWorkingBranchFromUser(){
  return createDialog(true);
}