nus-yam/ex-repair huggingface dataset:
Program: 125764
Project: 125764
Buggy source:
protected void swap(Object[] children,int source,int target){
  if (source != target && source > -1 && target > -1 && source < children.length && target < children.length) {
    if (source > target) {
      Object sourceObject=children[source];
      for (int i=source; i > target; i--) {
        children[i]=children[i - 1];
      }
      children[target]=sourceObject;
    }
 else     if (source < target) {
      Object sourceObject=children[source];
      for (int i=source; i > target; i++) {
        children[i]=children[i + 1];
      }
      children[target]=sourceObject;
    }
  }
}

Fixed version (ground truth):
protected void swap(Object[] children,int source,int target){
  if (source != target && source > -1 && target > -1 && source < children.length && target < children.length) {
    if (source > target) {
      Object sourceObject=children[source];
      for (int i=source; i > target; i--) {
        children[i]=children[i - 1];
      }
      children[target]=sourceObject;
    }
 else     if (source < target) {
      Object sourceObject=children[source];
      for (int i=source; i < target; i++) {
        children[i]=children[i + 1];
      }
      children[target]=sourceObject;
    }
  }
}
Program: 125766
Project: 125766
Buggy source:
public List<ComponentProperties> getAllComponentProperties(Connection connection);

Fixed version (ground truth):
/** 
 * Get all component properties which are related to the <code>connection</code>.
 * @param connection the connection.
 * @param tableLabel the table which need to consider the component properties along.
 * @return
 */
public List<ComponentProperties> getAllComponentProperties(Connection connection,String tableLabel);
Program: 125767
Project: 125767
Buggy source:
protected void swap(Object[] children,int source,int target){
  if (source != target && source > -1 && target > -1 && source < children.length && target < children.length) {
    if (source > target) {
      Object sourceObject=children[source];
      for (int i=source; i > target; i--) {
        children[i]=children[i - 1];
      }
      children[target]=sourceObject;
    }
 else     if (source < target) {
      Object sourceObject=children[source];
      for (int i=source; i > target; i++) {
        children[i]=children[i + 1];
      }
      children[target]=sourceObject;
    }
  }
}

Fixed version (ground truth):
protected void swap(Object[] children,int source,int target){
  if (source != target && source > -1 && target > -1 && source < children.length && target < children.length) {
    if (source > target) {
      Object sourceObject=children[source];
      for (int i=source; i > target; i--) {
        children[i]=children[i - 1];
      }
      children[target]=sourceObject;
    }
 else     if (source < target) {
      Object sourceObject=children[source];
      for (int i=source; i < target; i++) {
        children[i]=children[i + 1];
      }
      children[target]=sourceObject;
    }
  }
}
Program: 125768
Project: 125768
Buggy source:
public static void saveResource(Resource resource) throws PersistenceException {
  if (resource == null) {
    return;
  }
  if (resource.getURI() == null) {
    return;
  }
  HashMap options=new HashMap(2);
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  options.put(XMLResource.OPTION_ESCAPE_USING_CDATA,Boolean.TRUE);
  try {
    resource.save(options);
  }
 catch (  IOException e) {
    throw new PersistenceException(e);
  }
catch (  RuntimeException e) {
    log.warn("String_Node_Str" + resource.getURI() + "String_Node_Str",e);
    options.put(XMLResource.OPTION_XML_VERSION,"String_Node_Str");
    try {
      resource.save(options);
    }
 catch (    IOException e1) {
      throw new PersistenceException(e);
    }
  }
}

Fixed version (ground truth):
public static void saveResource(Resource resource,OutputStream outputStream) throws PersistenceException {
  if (resource == null) {
    return;
  }
  if (resource.getURI() == null) {
    return;
  }
  HashMap options=new HashMap(2);
  options.put(XMLResource.OPTION_ENCODING,"String_Node_Str");
  options.put(XMLResource.OPTION_ESCAPE_USING_CDATA,Boolean.TRUE);
  try {
    if (outputStream == null) {
      resource.save(options);
    }
 else {
      resource.save(outputStream,options);
    }
  }
 catch (  IOException e) {
    throw new PersistenceException(e);
  }
catch (  RuntimeException e) {
    log.warn("String_Node_Str" + resource.getURI() + "String_Node_Str",e);
    options.put(XMLResource.OPTION_XML_VERSION,"String_Node_Str");
    try {
      if (outputStream == null) {
        resource.save(options);
      }
 else {
        resource.save(outputStream,options);
      }
    }
 catch (    IOException e1) {
      throw new PersistenceException(e);
    }
  }
}
Program: 125769
Project: 125769
Buggy source:
private Set<Relation> getItemsHaveRelationWith(Map<Relation,Set<Relation>> itemsRelations,String itemId){
  Set<Relation> relations=new HashSet<Relation>();
  for (  Relation baseItem : itemsRelations.keySet()) {
    for (    Relation relatedItem : itemsRelations.get(baseItem)) {
      String id=relatedItem.getId();
      if (id != null) {
        Relation tmpRelatedItem=null;
        if (id.indexOf("String_Node_Str") != -1) {
          try {
            tmpRelatedItem=(Relation)relatedItem.clone();
            tmpRelatedItem.setId(id.split("String_Node_Str")[0]);
          }
 catch (          CloneNotSupportedException e) {
            log.error(e);
          }
        }
 else {
          tmpRelatedItem=relatedItem;
        }
        if (tmpRelatedItem != null && itemId.equals(id)) {
          relations.add(baseItem);
          break;
        }
      }
    }
  }
  return relations;
}

Fixed version (ground truth):
private Set<Relation> getItemsHaveRelationWith(Map<Relation,Set<Relation>> itemsRelations,String itemId,boolean includeTestCase){
  Set<Relation> relations=new HashSet<Relation>();
  for (  Relation baseItem : itemsRelations.keySet()) {
    for (    Relation relatedItem : itemsRelations.get(baseItem)) {
      String id=relatedItem.getId();
      if (id != null) {
        Relation tmpRelatedItem=null;
        if (id.indexOf("String_Node_Str") != -1) {
          try {
            tmpRelatedItem=(Relation)relatedItem.clone();
            tmpRelatedItem.setId(id.split("String_Node_Str")[0]);
          }
 catch (          CloneNotSupportedException e) {
            log.error(e);
          }
        }
 else {
          tmpRelatedItem=relatedItem;
        }
        if (tmpRelatedItem != null && itemId.equals(id)) {
          if (!includeTestCase && TEST_RELATION.equals(tmpRelatedItem.getType())) {
            continue;
          }
          relations.add(baseItem);
          break;
        }
      }
    }
  }
  return relations;
}
Program: 125770
Project: 125770
Buggy source:
private void intitializeRefProject(Project project,Object parent){
  if (parent instanceof IRepositoryNode && ((IRepositoryNode)parent).isBin()) {
    return;
  }
  for (  ProjectReference refProject : (List<ProjectReference>)project.getReferencedProjects()) {
    String parentBranch=ProjectManager.getInstance().getMainProjectBranch(project);
    if (refProject.getBranch() == null || parentBranch.equals(refProject.getBranch())) {
      Project p=refProject.getReferencedProject();
      List<Project> list=nodeAndProject.get(parent);
      if (list == null) {
        list=new ArrayList<Project>();
        nodeAndProject.put(parent,list);
      }
      if (list.contains(p)) {
        return;
      }
 else {
        list.add(p);
      }
      initializeChildren(new org.talend.core.model.general.Project(p),parent);
      intitializeRefProject(p,parent);
    }
  }
}

Fixed version (ground truth):
private void intitializeRefProject(Project project,Object parent){
  if (parent instanceof IRepositoryNode && ((IRepositoryNode)parent).isBin()) {
    return;
  }
  for (  ProjectReference refProject : (List<ProjectReference>)project.getReferencedProjects()) {
    String parentBranch=ProjectManager.getInstance().getMainProjectBranch(project);
    if (refProject.getBranch() == null || parentBranch.equals(refProject.getBranch())) {
      Project p=refProject.getReferencedProject();
      initializeChildren(new org.talend.core.model.general.Project(p),parent);
      intitializeRefProject(p,parent);
    }
  }
}
Program: 125771
Project: 125771
Buggy source:
/** 
 * DOC matthieu Comment method "calculateObjectEditable".
 * @return
 */
private void calculateRepositoryObjectEditable(IRepositoryViewObject repositoryViewObject){
  if (repositoryObject != null && !forceReadOnly) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    repositoryObjectEditable=factory.isEditableAndLockIfPossible(repositoryObject);
    if (!CoreRuntimePlugin.getInstance().isDataProfilePerspectiveSelected()) {
      final IRepositoryNode repositoryNode=repositoryViewObject.getRepositoryNode();
      IRepositoryView repositoryView=RepositoryManagerHelper.findRepositoryView();
      if (repositoryView != null) {
        repositoryView.expand(repositoryNode);
        repositoryView.getViewer().refresh(repositoryObject.getRepositoryObjectType());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC matthieu Comment method "calculateObjectEditable".
 * @return
 */
private void calculateRepositoryObjectEditable(IRepositoryViewObject repositoryViewObject){
  if (repositoryObject != null && !forceReadOnly) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    repositoryObjectEditable=factory.isEditableAndLockIfPossible(repositoryViewObject);
    if (!CoreRuntimePlugin.getInstance().isDataProfilePerspectiveSelected()) {
      final IRepositoryNode repositoryNode=repositoryViewObject.getRepositoryNode();
      IRepositoryView repositoryView=RepositoryManagerHelper.findRepositoryView();
      if (repositoryView != null) {
        repositoryView.expand(repositoryNode);
        repositoryView.getViewer().refresh(repositoryObject.getRepositoryObjectType());
      }
    }
  }
}
Program: 125779
Project: 125779
Buggy source:
/** 
 * Added by Marvin Wang on Aug 10, 2012.
 */
protected void doHiveDistributionModify(){
  IHDistribution newHiveDistribution=getCurrentHiveDistribution(false);
  if (newHiveDistribution == null) {
    return;
  }
  String distributionObj=getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION);
  IHDistribution originalHiveDistribution=HiveMetadataHelper.getDistribution(distributionObj,false);
  boolean doSupportMapRTicket=false;
  IHadoopDistributionService hadoopService=getHadoopDistributionService();
  if (hadoopService != null && newHiveDistribution != null) {
    doSupportMapRTicket=hadoopService.doSupportMapRTicket(newHiveDistribution.getDefaultVersion());
  }
  useMaprTForHive.setEnabled(doSupportMapRTicket);
  hideControl(useMaprTForHive,!doSupportMapRTicket);
  hideControl(authenticationMaprTComForHive,!doSupportMapRTicket);
  hideControl(authenticationUserPassComForHive,!doSupportMapRTicket);
  if (originalHiveDistribution == null || !newHiveDistribution.equals(originalHiveDistribution)) {
    updateHiveVersionAndMakeSelection(newHiveDistribution,null);
    setHideVersionInfoWidgets(false);
    updateYarnInfo(newHiveDistribution,null);
    updateHiveModeAndMakeSelection(null);
    doHiveModeModify();
    fillDefaultsWhenHiveVersionChanged();
  }
}

Fixed version (ground truth):
/** 
 * Added by Marvin Wang on Aug 10, 2012.
 */
protected void doHiveDistributionModify(){
  IHDistribution newHiveDistribution=getCurrentHiveDistribution(false);
  if (newHiveDistribution == null) {
    return;
  }
  String distributionObj=getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION);
  IHDistribution originalHiveDistribution=HiveMetadataHelper.getDistribution(distributionObj,false);
  boolean doSupportMapRTicket=false;
  IHadoopDistributionService hadoopService=getHadoopDistributionService();
  if (hadoopService != null && newHiveDistribution != null) {
    doSupportMapRTicket=hadoopService.doSupportMapRTicket(newHiveDistribution.getDefaultVersion());
  }
  useMaprTForHive.setEnabled(doSupportMapRTicket);
  hideControl(useMaprTForHive,!doSupportMapRTicket);
  hideControl(authenticationMaprTComForHive,!useMaprTForHive.getSelection());
  hideControl(authenticationUserPassComForHive,!useMaprTForHive.getSelection());
  if (originalHiveDistribution == null || !newHiveDistribution.equals(originalHiveDistribution)) {
    updateHiveVersionAndMakeSelection(newHiveDistribution,null);
    setHideVersionInfoWidgets(false);
    updateYarnInfo(newHiveDistribution,null);
    updateHiveModeAndMakeSelection(null);
    doHiveModeModify();
    fillDefaultsWhenHiveVersionChanged();
  }
}
Program: 125785
Project: 125785
Buggy source:
/** 
 * DOC hwang Comment method "getTestCaseParent".
 * @param repositoryObjectType
 * @param path
 * @return
 */
private RepositoryNode getTestCaseParent(List<IRepositoryNode> rootNodes,String originalID){
  for (  IRepositoryNode node : rootNodes) {
    if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
      if (node.getId().equals(originalID)) {
        return (RepositoryNode)node;
      }
    }
 else     if (node.getType() == ENodeType.SIMPLE_FOLDER) {
      return getTestCaseParent(node.getChildren(),originalID);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC hwang Comment method "getTestCaseParent".
 * @param repositoryObjectType
 * @param path
 * @return
 */
private RepositoryNode getTestCaseParent(List<IRepositoryNode> rootNodes,String originalID){
  for (  IRepositoryNode node : rootNodes) {
    if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
      if (node.getId().equals(originalID)) {
        return (RepositoryNode)node;
      }
    }
 else     if (node.getType() == ENodeType.SIMPLE_FOLDER) {
      RepositoryNode pNode=getTestCaseParent(node.getChildren(),originalID);
      if (pNode != null) {
        return pNode;
      }
    }
  }
  return null;
}
Program: 125788
Project: 125788
Buggy source:
private void deleteTestCases(IProxyRepositoryFactory factory,DeleteActionCache deleteActionCache,final IRepositoryNode currentJobNode,Boolean confirm) throws PersistenceException, BusinessException {
  if (currentJobNode.getType() != ENodeType.REPOSITORY_ELEMENT) {
    return;
  }
  if (!(currentJobNode.getObject().getProperty().getItem() instanceof ProcessItem)) {
    return;
  }
  if (currentJobNode.getChildren().isEmpty()) {
    return;
  }
  for (  IRepositoryNode child : currentJobNode.getChildren()) {
    deleteElements(factory,deleteActionCache,(RepositoryNode)child,confirm);
  }
}

Fixed version (ground truth):
private void deleteTestCases(IProxyRepositoryFactory factory,DeleteActionCache deleteActionCache,final IRepositoryNode currentJobNode,Boolean confirm) throws PersistenceException, BusinessException {
  if (currentJobNode.getType() != ENodeType.REPOSITORY_ELEMENT) {
    return;
  }
  if (!(currentJobNode.getObject().getProperty().getItem() instanceof ProcessItem)) {
    return;
  }
  if (!currentJobNode.getChildren().isEmpty()) {
    for (    IRepositoryNode child : currentJobNode.getChildren()) {
      deleteElements(factory,deleteActionCache,(RepositoryNode)child,confirm);
    }
    return;
  }
  if (ERepositoryObjectType.TEST_CONTAINER == null) {
    return;
  }
  IPath path=new Path(currentJobNode.getObjectType().getFolder());
  path=path.append(currentJobNode.getId());
  RootContainer<String,IRepositoryViewObject> junitObjects=ProxyRepositoryFactory.getInstance().getObjectFromFolder(ProjectManager.getInstance().getCurrentProject(),ERepositoryObjectType.TEST_CONTAINER,path.toOSString(),IRepositoryFactory.OPTION_ONLY_LAST_VERSION | IRepositoryFactory.OPTION_DYNAMIC_OBJECTS);
  if (junitObjects.isEmpty() || junitObjects.getMembers().isEmpty()) {
    return;
  }
  for (  IRepositoryViewObject viewNode : junitObjects.getMembers()) {
    if (viewNode.isDeleted()) {
      continue;
    }
    RepositoryNode node=new RepositoryNode(viewNode,(RepositoryNode)currentJobNode,ENodeType.REPOSITORY_ELEMENT);
    node.setProperties(EProperties.CONTENT_TYPE,ERepositoryObjectType.TEST_CONTAINER);
    node.setProperties(EProperties.LABEL,viewNode.getLabel());
    deleteElements(factory,deleteActionCache,node,confirm);
  }
}
Program: 125790
Project: 125790
Buggy source:
@Override public void perspectivePreDeactivate(IWorkbenchPage page,IPerspectiveDescriptor perspective){
  CheatSheetView cheetSheet=CheatSheetUtils.getInstance().findCheetSheet("String_Node_Str");
  if (null != cheetSheet) {
    cheetSheetID=cheetSheet.getCheatSheetID();
    CheatSheetUtils.getInstance().hideCheetSheet(cheetSheet);
  }
  cheetSheetInPerspective.put(perspective.getId(),null != cheetSheet);
  super.perspectivePreDeactivate(page,perspective);
}

Fixed version (ground truth):
@Override public void perspectivePreDeactivate(IWorkbenchPage page,IPerspectiveDescriptor perspective){
  super.perspectivePreDeactivate(page,perspective);
}
Program: 125791
Project: 125791
Buggy source:
@Override public void perspectiveActivated(IWorkbenchPage page,IPerspectiveDescriptor perspective){
  if (null != cheetSheetInPerspective.get(perspective.getId()) && cheetSheetInPerspective.get(perspective.getId())) {
    restoreCheetSheet();
  }
  if (CheatSheetUtils.getInstance().isFirstTime() && perspective.getId().equals(CheatSheetUtils.DQ_PERSPECTIVE_ID)) {
    restoreCheetSheet();
  }
  super.perspectiveActivated(page,perspective);
}

Fixed version (ground truth):
@Override public void perspectiveActivated(IWorkbenchPage page,IPerspectiveDescriptor perspective){
  if (!perspective.getId().equals(CheatSheetUtils.DQ_PERSPECTIVE_ID)) {
    CheatSheetView cheetSheet=CheatSheetUtils.getInstance().findCheetSheet("String_Node_Str");
    if (null != cheetSheet) {
      CheatSheetUtils.getInstance().hideCheetSheet(cheetSheet);
    }
  }
 else   if (CheatSheetUtils.getInstance().isOpenedCheatSheet()) {
    restoreCheetSheet();
  }
  super.perspectiveActivated(page,perspective);
}
Program: 125793
Project: 125793
Buggy source:
@Override public void perspectiveActivated(IWorkbenchPage page,IPerspectiveDescriptor perspective){
  String pId=perspective.getId();
  if (IBrandingConfiguration.PERSPECTIVE_DI_ID.equals(pId)) {
    IRepositoryView view=RepositoryManager.getRepositoryView();
    if (view != null) {
      view.refresh();
      TalendPaletteHelper.checkAndInitToolBar();
    }
  }
 else   if (IBrandingConfiguration.PERSPECTIVE_DQ_ID.equals(pId)) {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
      ITDQRepositoryService tdqRepositoryService=(ITDQRepositoryService)GlobalServiceRegister.getDefault().getService(ITDQRepositoryService.class);
      if (tdqRepositoryService != null) {
        tdqRepositoryService.refresh();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void perspectiveActivated(IWorkbenchPage page,IPerspectiveDescriptor perspective){
  String pId=perspective.getId();
  if (IBrandingConfiguration.PERSPECTIVE_DI_ID.equals(pId)) {
    IRepositoryView view=RepositoryManager.getRepositoryView();
    if (view != null) {
      view.refresh();
      TalendPaletteHelper.checkAndInitToolBar();
    }
  }
 else   if (IBrandingConfiguration.PERSPECTIVE_DQ_ID.equals(pId)) {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQItemService.class)) {
      ITDQItemService tdqItemService=(ITDQItemService)GlobalServiceRegister.getDefault().getService(ITDQItemService.class);
      if (tdqItemService != null) {
        tdqItemService.createDQStructor();
      }
    }
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
      ITDQRepositoryService tdqRepositoryService=(ITDQRepositoryService)GlobalServiceRegister.getDefault().getService(ITDQRepositoryService.class);
      if (tdqRepositoryService != null) {
        tdqRepositoryService.refresh();
      }
    }
  }
}
Program: 125795
Project: 125795
Buggy source:
public ImportExportHandlersManager(){
  registryReader=new ImportExportHandlersRegistryReader();
  registryReader.init();
}

Fixed version (ground truth):
public ImportExportHandlersManager(){
  registryReader=ImportExportHandlersRegistryReader.getInstance();
}
Program: 125796
Project: 125796
Buggy source:
public void init(){
  readRegistry();
  List<BasicRegistry> availableImportItemsProviderRegistries=getAvailableImportProviderRegistries(new HashMap<String,BasicRegistry>(this.imortRegistries));
  List<BasicRegistry> availableImportResourcesProviderRegistries=getAvailableImportProviderRegistries(new HashMap<String,BasicRegistry>(this.resImportResistries));
  final Comparator<BasicRegistry> comparator=new Comparator<BasicRegistry>(){
    @Override public int compare(    BasicRegistry arg0,    BasicRegistry arg1){
      return arg1.getPriority().compareTo(arg0.getPriority());
    }
  }
;
  Collections.sort(availableImportItemsProviderRegistries,comparator);
  Collections.sort(availableImportResourcesProviderRegistries,comparator);
  List<IImportItemsHandler> itemsHanders=new ArrayList<IImportItemsHandler>();
  for (  BasicRegistry reg : availableImportItemsProviderRegistries) {
    if (reg instanceof ImportItemsProviderRegistry) {
      itemsHanders.add(((ImportItemsProviderRegistry)reg).getImportItemsHandler());
    }
  }
  importItemsHandlers=itemsHanders.toArray(new IImportItemsHandler[0]);
  List<IImportResourcesHandler> resourcesHanders=new ArrayList<IImportResourcesHandler>();
  for (  BasicRegistry reg : availableImportResourcesProviderRegistries) {
    if (reg instanceof ImportResourcesProviderRegistry) {
      resourcesHanders.add(((ImportResourcesProviderRegistry)reg).getImportResourcesHandler());
    }
  }
  importResourcesHandlers=resourcesHanders.toArray(new IImportResourcesHandler[0]);
}

Fixed version (ground truth):
public void init(){
  clearCache();
  readRegistry();
  List<BasicRegistry> availableImportItemsProviderRegistries=getAvailableImportProviderRegistries(new HashMap<String,BasicRegistry>(this.imortRegistries));
  List<BasicRegistry> availableImportResourcesProviderRegistries=getAvailableImportProviderRegistries(new HashMap<String,BasicRegistry>(this.resImportResistries));
  final Comparator<BasicRegistry> comparator=new Comparator<BasicRegistry>(){
    @Override public int compare(    BasicRegistry arg0,    BasicRegistry arg1){
      return arg1.getPriority().compareTo(arg0.getPriority());
    }
  }
;
  Collections.sort(availableImportItemsProviderRegistries,comparator);
  Collections.sort(availableImportResourcesProviderRegistries,comparator);
  List<IImportItemsHandler> itemsHanders=new ArrayList<IImportItemsHandler>();
  for (  BasicRegistry reg : availableImportItemsProviderRegistries) {
    if (reg instanceof ImportItemsProviderRegistry) {
      itemsHanders.add(((ImportItemsProviderRegistry)reg).getImportItemsHandler());
    }
  }
  importItemsHandlers=itemsHanders.toArray(new IImportItemsHandler[0]);
  List<IImportResourcesHandler> resourcesHanders=new ArrayList<IImportResourcesHandler>();
  for (  BasicRegistry reg : availableImportResourcesProviderRegistries) {
    if (reg instanceof ImportResourcesProviderRegistry) {
      resourcesHanders.add(((ImportResourcesProviderRegistry)reg).getImportResourcesHandler());
    }
  }
  importResourcesHandlers=resourcesHanders.toArray(new IImportResourcesHandler[0]);
}
Program: 125797
Project: 125797
Buggy source:
public ImportExportHandlersRegistryReader(){
  super("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
private ImportExportHandlersRegistryReader(){
  super("String_Node_Str","String_Node_Str");
}
Program: 125798
Project: 125798
Buggy source:
private void setHidHiveEncryption(boolean hide){
  GridData hadoopData=(GridData)encryptionGrp.getLayoutData();
  hadoopData.exclude=hide;
  encryptionGrp.setVisible(!hide);
  encryptionGrp.setLayoutData(hadoopData);
  encryptionGrp.getParent().layout();
  setHiveTrustStoreParameters(hide);
  if (hide) {
    getConnection().getParameters().removeKey(ConnParameterKeys.CONN_PARA_KEY_USE_SSL);
  }
 else {
    getConnection().getParameters().put(ConnParameterKeys.CONN_PARA_KEY_USE_SSL,String.valueOf(useSSLEncryption.getSelection()));
  }
  String url=getStringConnection();
  urlConnectionStringText.setText(url);
  getConnection().setURL(url);
}

Fixed version (ground truth):
private void setHidHiveEncryption(boolean hide){
  GridData hadoopData=(GridData)encryptionGrp.getLayoutData();
  hadoopData.exclude=hide;
  encryptionGrp.setVisible(!hide);
  encryptionGrp.setLayoutData(hadoopData);
  encryptionGrp.getParent().layout();
  setHiveTrustStoreParameters(hide);
  if (hide) {
    getConnection().getParameters().removeKey(ConnParameterKeys.CONN_PARA_KEY_USE_SSL);
  }
 else {
    getConnection().getParameters().put(ConnParameterKeys.CONN_PARA_KEY_USE_SSL,String.valueOf(useSSLEncryption.getSelection()));
  }
  if (isHiveDBConnSelected()) {
    String url=getStringConnection();
    urlConnectionStringText.setText(url);
    getConnection().setURL(url);
  }
}
Program: 125801
Project: 125801
Buggy source:
public void copyTestCases(Item newItem,RepositoryNode sourceNode,boolean isDuplicate){
  if (!isAllowedToCopyTestCase(newItem,sourceNode)) {
    return;
  }
  final IPath path=getTestCasePath(newItem,sourceNode);
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
    ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
    if (testContainerService != null) {
      testContainerService.copyDataFiles(newItem,sourceNode.getId());
      for (      IRepositoryNode testNode : sourceNode.getChildren()) {
        Item testItem=testNode.getObject().getProperty().getItem();
        if (!(testItem instanceof ProcessItem)) {
          continue;
        }
        testContainerService.copyTestCase(newItem,testItem,path,null,false);
      }
    }
  }
}

Fixed version (ground truth):
public void copyTestCases(Item newItem,RepositoryNode sourceNode,boolean isDuplicate){
  if (!isAllowedToCopyTestCase(newItem,sourceNode)) {
    return;
  }
  final IPath path=getTestCasePath(newItem,sourceNode);
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
    ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
    if (testContainerService != null) {
      testContainerService.copyDataFiles(newItem,sourceNode.getId());
      testContainerService.copyTestCase(newItem,sourceNode.getObject().getProperty().getItem(),path,null,false);
    }
  }
}
Program: 125802
Project: 125802
Buggy source:
private void duplicateTestCases(Item newItem,final CopyObjectAction copyObjectAction){
  if (!copyObjectAction.isAllowedToCopyTestCase(newItem,sourceNode) || !isAllowDuplicateTest) {
    return;
  }
  final IPath path=copyObjectAction.getTestCasePath(newItem,sourceNode);
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
    ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
    if (testContainerService != null) {
      testContainerService.copyDataFiles(newItem,sourceNode.getId());
      for (      IRepositoryNode testNode : this.sourceNode.getChildren()) {
        Item testItem=testNode.getObject().getProperty().getItem();
        if (!(testItem instanceof ProcessItem)) {
          continue;
        }
        String initNameValue="String_Node_Str" + testItem.getProperty().getDisplayName();
        String jobNameValue=null;
        final TreeSelection selectionInClipboard=(TreeSelection)selection;
        ERepositoryObjectType type=((RepositoryNode)selectionInClipboard.toArray()[0]).getObject().getRepositoryObjectType();
        try {
          jobNameValue=getDuplicateName((RepositoryNode)testNode,initNameValue,type,selectionInClipboard);
        }
 catch (        BusinessException e) {
          jobNameValue="String_Node_Str";
        }
        testContainerService.copyTestCase(newItem,testItem,path,jobNameValue,true);
      }
    }
  }
}

Fixed version (ground truth):
private void duplicateTestCases(Item newItem,final CopyObjectAction copyObjectAction){
  if (!copyObjectAction.isAllowedToCopyTestCase(newItem,sourceNode) || !isAllowDuplicateTest) {
    return;
  }
  final IPath path=copyObjectAction.getTestCasePath(newItem,sourceNode);
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
    ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
    if (testContainerService != null) {
      testContainerService.copyDataFiles(newItem,sourceNode.getId());
      testContainerService.copyTestCase(newItem,sourceNode.getObject().getProperty().getItem(),path,null,true);
    }
  }
}
Program: 125803
Project: 125803
Buggy source:
private void setHidHiveEncryption(boolean hide){
  GridData hadoopData=(GridData)encryptionGrp.getLayoutData();
  hadoopData.exclude=hide;
  encryptionGrp.setVisible(!hide);
  encryptionGrp.setLayoutData(hadoopData);
  encryptionGrp.getParent().layout();
  setHiveTrustStoreParameters(hide);
  if (hide) {
    getConnection().getParameters().removeKey(ConnParameterKeys.CONN_PARA_KEY_USE_SSL);
  }
 else {
    getConnection().getParameters().put(ConnParameterKeys.CONN_PARA_KEY_USE_SSL,String.valueOf(useSSLEncryption.getSelection()));
  }
  String url=getStringConnection();
  urlConnectionStringText.setText(url);
  getConnection().setURL(url);
}

Fixed version (ground truth):
private void setHidHiveEncryption(boolean hide){
  GridData hadoopData=(GridData)encryptionGrp.getLayoutData();
  hadoopData.exclude=hide;
  encryptionGrp.setVisible(!hide);
  encryptionGrp.setLayoutData(hadoopData);
  encryptionGrp.getParent().layout();
  setHiveTrustStoreParameters(hide);
  if (hide) {
    getConnection().getParameters().removeKey(ConnParameterKeys.CONN_PARA_KEY_USE_SSL);
  }
 else {
    getConnection().getParameters().put(ConnParameterKeys.CONN_PARA_KEY_USE_SSL,String.valueOf(useSSLEncryption.getSelection()));
  }
  if (isHiveDBConnSelected()) {
    String url=getStringConnection();
    urlConnectionStringText.setText(url);
    getConnection().setURL(url);
  }
}
Program: 125804
Project: 125804
Buggy source:
public ImportExportHandlersManager(){
  registryReader=new ImportExportHandlersRegistryReader();
  registryReader.init();
}

Fixed version (ground truth):
public ImportExportHandlersManager(){
  registryReader=ImportExportHandlersRegistryReader.getInstance();
}
Program: 125805
Project: 125805
Buggy source:
public void init(){
  readRegistry();
  List<BasicRegistry> availableImportItemsProviderRegistries=getAvailableImportProviderRegistries(new HashMap<String,BasicRegistry>(this.imortRegistries));
  List<BasicRegistry> availableImportResourcesProviderRegistries=getAvailableImportProviderRegistries(new HashMap<String,BasicRegistry>(this.resImportResistries));
  final Comparator<BasicRegistry> comparator=new Comparator<BasicRegistry>(){
    @Override public int compare(    BasicRegistry arg0,    BasicRegistry arg1){
      return arg1.getPriority().compareTo(arg0.getPriority());
    }
  }
;
  Collections.sort(availableImportItemsProviderRegistries,comparator);
  Collections.sort(availableImportResourcesProviderRegistries,comparator);
  List<IImportItemsHandler> itemsHanders=new ArrayList<IImportItemsHandler>();
  for (  BasicRegistry reg : availableImportItemsProviderRegistries) {
    if (reg instanceof ImportItemsProviderRegistry) {
      itemsHanders.add(((ImportItemsProviderRegistry)reg).getImportItemsHandler());
    }
  }
  importItemsHandlers=itemsHanders.toArray(new IImportItemsHandler[0]);
  List<IImportResourcesHandler> resourcesHanders=new ArrayList<IImportResourcesHandler>();
  for (  BasicRegistry reg : availableImportResourcesProviderRegistries) {
    if (reg instanceof ImportResourcesProviderRegistry) {
      resourcesHanders.add(((ImportResourcesProviderRegistry)reg).getImportResourcesHandler());
    }
  }
  importResourcesHandlers=resourcesHanders.toArray(new IImportResourcesHandler[0]);
}

Fixed version (ground truth):
public void init(){
  clearCache();
  readRegistry();
  List<BasicRegistry> availableImportItemsProviderRegistries=getAvailableImportProviderRegistries(new HashMap<String,BasicRegistry>(this.imortRegistries));
  List<BasicRegistry> availableImportResourcesProviderRegistries=getAvailableImportProviderRegistries(new HashMap<String,BasicRegistry>(this.resImportResistries));
  final Comparator<BasicRegistry> comparator=new Comparator<BasicRegistry>(){
    @Override public int compare(    BasicRegistry arg0,    BasicRegistry arg1){
      return arg1.getPriority().compareTo(arg0.getPriority());
    }
  }
;
  Collections.sort(availableImportItemsProviderRegistries,comparator);
  Collections.sort(availableImportResourcesProviderRegistries,comparator);
  List<IImportItemsHandler> itemsHanders=new ArrayList<IImportItemsHandler>();
  for (  BasicRegistry reg : availableImportItemsProviderRegistries) {
    if (reg instanceof ImportItemsProviderRegistry) {
      itemsHanders.add(((ImportItemsProviderRegistry)reg).getImportItemsHandler());
    }
  }
  importItemsHandlers=itemsHanders.toArray(new IImportItemsHandler[0]);
  List<IImportResourcesHandler> resourcesHanders=new ArrayList<IImportResourcesHandler>();
  for (  BasicRegistry reg : availableImportResourcesProviderRegistries) {
    if (reg instanceof ImportResourcesProviderRegistry) {
      resourcesHanders.add(((ImportResourcesProviderRegistry)reg).getImportResourcesHandler());
    }
  }
  importResourcesHandlers=resourcesHanders.toArray(new IImportResourcesHandler[0]);
}
Program: 125806
Project: 125806
Buggy source:
public ImportExportHandlersRegistryReader(){
  super("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
private ImportExportHandlersRegistryReader(){
  super("String_Node_Str","String_Node_Str");
}
Program: 125807
Project: 125807
Buggy source:
@Override protected void launchIndividualDownload(final AtomicInteger enabledButtonCount,ModuleToInstall data,final Button button){
  button.setEnabled(false);
  enabledButtonCount.decrementAndGet();
  DownloadModuleRunnableWithLicenseDialog downloadModuleRunnable=new DownloadModuleRunnableWithLicenseDialog(Collections.singletonList(data),getShell());
  try {
    run(downloadModuleRunnable);
  }
 catch (  InvocationTargetException e) {
    individualDownloadFailed(enabledButtonCount,button);
    ExceptionHandler.process(e);
  }
catch (  InterruptedException e) {
    individualDownloadFailed(enabledButtonCount,button);
    ExceptionHandler.process(e);
  }
 finally {
    if (getProgressMonitor().isCanceled()) {
      individualDownloadFailed(enabledButtonCount,button);
    }
 else {
      Display.getDefault().syncExec(new Runnable(){
        @Override public void run(){
          if (!installAllBtn.isDisposed() && enabledButtonCount.get() == 0) {
            installAllBtn.setEnabled(false);
          }
        }
      }
);
    }
  }
}

Fixed version (ground truth):
@Override protected void launchIndividualDownload(final AtomicInteger enabledButtonCount,ModuleToInstall data,final Button button){
  button.setEnabled(false);
  enabledButtonCount.decrementAndGet();
  DownloadModuleRunnableWithLicenseDialog downloadModuleRunnable=new DownloadModuleRunnableWithLicenseDialog(Collections.singletonList(data),getShell());
  try {
    run(downloadModuleRunnable);
  }
 catch (  InvocationTargetException e) {
    individualDownloadFailed(enabledButtonCount,button);
    ExceptionHandler.process(e);
  }
catch (  InterruptedException e) {
    individualDownloadFailed(enabledButtonCount,button);
    ExceptionHandler.process(e);
  }
 finally {
    if (getProgressMonitor().isCanceled()) {
      individualDownloadFailed(enabledButtonCount,button);
    }
 else {
      Display.getDefault().syncExec(new Runnable(){
        @Override public void run(){
          if (!installAllBtn.isDisposed() && enabledButtonCount.get() == 0) {
            installAllBtn.setEnabled(false);
          }
        }
      }
);
    }
    if (enabledButtonCount.get() == 0) {
      close();
    }
  }
}
Program: 125810
Project: 125810
Buggy source:
public Resource getItemResource(Item item,boolean forceLoad){
  URI itemResourceURI=null;
  if (item.getFileExtension() != null) {
    itemResourceURI=getItemResourceURI(getItemURI(item),item.getFileExtension());
  }
 else   if (item instanceof TDQItem) {
    IPath fileName=new Path(((TDQItem)item).getFilename());
    itemResourceURI=getItemResourceURI(getItemURI(item),fileName.getFileExtension());
  }
 else {
    itemResourceURI=getItemResourceURI(getItemURI(item));
  }
  Resource itemResource=getResourceSet().getResource(itemResourceURI,false);
  if (forceLoad && itemResource == null) {
    if (item instanceof FileItem) {
      itemResource=new ByteArrayResource(itemResourceURI);
      getResourceSet().getResources().add(itemResource);
    }
    itemResource=getResourceSet().getResource(itemResourceURI,true);
  }
  return itemResource;
}

Fixed version (ground truth):
public Resource getItemResource(Item item,boolean forceLoad){
  if (item == null)   return null;
  URI itemResourceURI=null;
  if (item.getFileExtension() != null) {
    itemResourceURI=getItemResourceURI(getItemURI(item),item.getFileExtension());
  }
 else   if (item instanceof TDQItem) {
    IPath fileName=new Path(((TDQItem)item).getFilename());
    itemResourceURI=getItemResourceURI(getItemURI(item),fileName.getFileExtension());
  }
 else {
    itemResourceURI=getItemResourceURI(getItemURI(item));
  }
  Resource itemResource=getResourceSet().getResource(itemResourceURI,false);
  if (forceLoad && itemResource == null) {
    if (item instanceof FileItem) {
      itemResource=new ByteArrayResource(itemResourceURI);
      getResourceSet().getResources().add(itemResource);
    }
    itemResource=getResourceSet().getResource(itemResourceURI,true);
  }
  return itemResource;
}
Program: 125813
Project: 125813
Buggy source:
@Override public JSONObject collect() throws Exception {
  JSONObject mergedData=new JSONObject();
  IPreferenceStore preferenceStore=getPreferenceStore();
  String records=preferenceStore.getString(getPreferenceKey());
  JSONObject allProjectRecords=new JSONObject(records);
  Iterator<String> keys=allProjectRecords.keys();
  while (keys.hasNext()) {
    String projectName=keys.next();
    JSONObject object=(JSONObject)allProjectRecords.get(projectName);
    if (object != null) {
      TokenInforUtil.mergeJSON(object,mergedData);
    }
  }
  return getMergedToken(mergedData);
}

Fixed version (ground truth):
@Override public JSONObject collect() throws Exception {
  JSONObject mergedData=new JSONObject();
  IPreferenceStore preferenceStore=getPreferenceStore();
  String records=preferenceStore.getString(getPreferenceKey());
  JSONObject allProjectRecords=null;
  try {
    allProjectRecords=new JSONObject(records);
  }
 catch (  Exception e) {
    allProjectRecords=new JSONObject();
  }
  Iterator<String> keys=allProjectRecords.keys();
  while (keys.hasNext()) {
    String projectName=keys.next();
    JSONObject object=(JSONObject)allProjectRecords.get(projectName);
    if (object != null) {
      TokenInforUtil.mergeJSON(object,mergedData);
    }
  }
  return getMergedToken(mergedData);
}
Program: 125814
Project: 125814
Buggy source:
public void priorCollect() throws Exception {
  if (isActiveAndValid(false)) {
    for (    TokenInforProvider tip : getProviders()) {
      ITokenCollector collector=tip.getCollector();
      if (collector != null) {
        collector.priorCollect();
      }
    }
  }
}

Fixed version (ground truth):
public void priorCollect() throws Exception {
  if (isActiveAndValid(false)) {
    for (    TokenInforProvider tip : getProviders()) {
      try {
        ITokenCollector collector=tip.getCollector();
        if (collector != null) {
          collector.priorCollect();
        }
      }
 catch (      Exception e) {
        ExceptionHandler.process(e);
      }
    }
  }
}
Program: 125815
Project: 125815
Buggy source:
public JSONObject collectTokenInfors() throws Exception {
  JSONObject result=new JSONObject();
  for (  TokenInforProvider tip : getProviders()) {
    ITokenCollector collector=tip.getCollector();
    if (collector != null) {
      JSONObject collectionObject=collector.collect();
      if (collectionObject != null) {
        TokenInforUtil.mergeJSON(collectionObject,result);
      }
    }
  }
  return result;
}

Fixed version (ground truth):
public JSONObject collectTokenInfors() throws Exception {
  JSONObject result=new JSONObject();
  for (  TokenInforProvider tip : getProviders()) {
    ITokenCollector collector=tip.getCollector();
    if (collector != null) {
      try {
        JSONObject collectionObject=collector.collect();
        if (collectionObject != null) {
          TokenInforUtil.mergeJSON(collectionObject,result);
        }
      }
 catch (      Exception e) {
        ExceptionHandler.process(e);
      }
    }
  }
  return result;
}
Program: 125816
Project: 125816
Buggy source:
/** 
 * Performs the zoom with animation.
 * @param zoom
 * @param finalCenter
 * @param animationModel
 */
private void primAnimateSetZoom(double zoom,Point finalCenter,AnimationModel animationModel){
  double initialZoom=getZoom();
  double finalZoom=zoom;
  Point finalCenterRel=finalCenter.getCopy();
  Point originalViewLocation=getViewport().getViewLocation();
  Dimension centerDiff=originalViewLocation.getDifference(getViewport().getClientArea().getCenter());
  Point finalViewLocation=finalCenterRel.scale(finalZoom / initialZoom).getTranslated(centerDiff);
  LineSeg scrollVector=new LineSeg(originalViewLocation,finalViewLocation);
  float progress=1.0f;
  if (animationModel != null) {
    animationModel.animationStarted();
    progress=animationModel.getProgress();
  }
  boolean finished=false;
  fireAnimatedZoomStarted();
  while (!finished) {
    if (animationModel == null || animationModel.isFinished())     finished=true;
    double currentZoom=initialZoom + ((finalZoom - initialZoom) * progress);
    super.primSetZoom(currentZoom);
    Point currentViewLocation=scrollVector.locatePoint(progress,0,LineSeg.Sign.POSITIVE);
    setViewLocation(currentViewLocation);
    getViewport().getUpdateManager().performUpdate();
    if (animationModel != null)     progress=animationModel.getProgress();
  }
  fireAnimatedZoomEnded();
}

Fixed version (ground truth):
/** 
 * Performs the zoom with animation.
 * @param zoom
 * @param finalCenter
 * @param animationModel
 */
private void primAnimateSetZoom(double zoom,Point finalCenter,AnimationModel animationModel){
  double initialZoom=getZoom();
  double finalZoom=zoom;
  currentZoom=finalZoom;
  Point finalCenterRel=finalCenter.getCopy();
  Point originalViewLocation=getViewport().getViewLocation();
  Dimension centerDiff=originalViewLocation.getDifference(getViewport().getClientArea().getCenter());
  Point finalViewLocation=finalCenterRel.scale(finalZoom / initialZoom).getTranslated(centerDiff);
  LineSeg scrollVector=new LineSeg(originalViewLocation,finalViewLocation);
  float progress=1.0f;
  if (animationModel != null) {
    animationModel.animationStarted();
    progress=animationModel.getProgress();
  }
  boolean finished=false;
  fireAnimatedZoomStarted();
  while (!finished) {
    if (animationModel == null || animationModel.isFinished())     finished=true;
    double currentZoom=initialZoom + ((finalZoom - initialZoom) * progress);
    super.primSetZoom(currentZoom);
    Point currentViewLocation=scrollVector.locatePoint(progress,0,LineSeg.Sign.POSITIVE);
    setViewLocation(currentViewLocation);
    getViewport().getUpdateManager().performUpdate();
    if (animationModel != null)     progress=animationModel.getProgress();
  }
  fireAnimatedZoomEnded();
}
Program: 125819
Project: 125819
Buggy source:
@Override public Object evaluate(Property property,Object storedValue){
  if (connection != null && connection.isContextMode() && storedValue != null) {
    ContextType contextType=ConnectionContextHelper.getContextTypeForContextMode(null,connection,true);
    if (contextType != null) {
      return ContextParameterUtils.getOriginalValue(contextType,String.valueOf(storedValue));
    }
  }
  return storedValue;
}

Fixed version (ground truth):
@Override public Object evaluate(Property property,Object storedValue){
  boolean isPropertySupportContext=false;
  if (Boolean.valueOf(String.valueOf(property.getTaggedValue(IComponentConstants.SUPPORT_CONTEXT)))) {
    isPropertySupportContext=true;
  }
  if (connection != null && connection.isContextMode() && isPropertySupportContext && storedValue != null) {
    ContextType contextType=ConnectionContextHelper.getContextTypeForContextMode(null,connection,true);
    if (contextType != null) {
      return ContextParameterUtils.getOriginalValue(contextType,String.valueOf(storedValue));
    }
  }
  return storedValue;
}
Program: 125822
Project: 125822
Buggy source:
@Override public void setupLayout(){
  super.setupLayout();
  Form schemaForm=Form.create(this,Form.MAIN,"String_Node_Str");
  schemaForm.addRow(widget(schema).setWidgetType(WidgetType.SCHEMA_EDITOR));
  Form schemaRefForm=Form.create(this,Form.REFERENCE,"String_Node_Str");
  schemaRefForm.addRow(widget(schema).setWidgetType(WidgetType.SCHEMA_REFERENCE));
}

Fixed version (ground truth):
@Override public void setupLayout(){
  super.setupLayout();
  Form schemaForm=Form.create(this,Form.MAIN);
  schemaForm.addRow(widget(schema).setWidgetType(WidgetType.SCHEMA_EDITOR));
  Form schemaRefForm=Form.create(this,Form.REFERENCE);
  schemaRefForm.addRow(widget(schema).setWidgetType(WidgetType.SCHEMA_REFERENCE));
}
Program: 125823
Project: 125823
Buggy source:
@Override public void setupLayout(){
  super.setupLayout();
  Form form=Form.create(this,Form.MAIN,"String_Node_Str");
  form.addRow(userName);
  form.addRow(widget(userPassword).setWidgetType(WidgetType.HIDDEN_TEXT));
}

Fixed version (ground truth):
@Override public void setupLayout(){
  super.setupLayout();
  Form form=Form.create(this,Form.MAIN);
  form.addRow(userName);
  form.addRow(widget(userPassword).setWidgetType(WidgetType.HIDDEN_TEXT));
}
Program: 125824
Project: 125824
Buggy source:
@Override public void setupLayout(){
  super.setupLayout();
  Form form=Form.create(this,Form.MAIN,"String_Node_Str");
  form.addRow(userId);
  form.addRow(nestedProps.getForm(Form.MAIN));
}

Fixed version (ground truth):
@Override public void setupLayout(){
  super.setupLayout();
  Form form=Form.create(this,Form.MAIN);
  form.addRow(userId);
  form.addRow(nestedProps.getForm(Form.MAIN));
}
Program: 125825
Project: 125825
Buggy source:
public void setCheckedState(){
  List<String> selectedElementLabels=getSelectedElementLabels();
  if (selectedElementLabels != null) {
    List<T> selectedElements=getInitSelectedElements(selectedElementLabels);
    if (selectedElements != null) {
      viewer.setCheckedElements(selectedElements.toArray());
    }
  }
}

Fixed version (ground truth):
public void setCheckedState(){
  List<String> selectedElementLabels=getSelectedElementLabels();
  if (selectedElementLabels != null) {
    List<T> selectedElements=getInitSelectedElements(selectedElementLabels);
    if (selectedElements != null) {
      viewer.setCheckedElements(selectedElements.toArray());
      doSelectionChanged();
    }
  }
}