nus-yam/ex-repair huggingface dataset:
Program: 136644
Project: 136644
Buggy source:
/** 
 * Test method for  {@link org.talend.dataquality.indicators.columnset.impl.ColumnSetMultiValueIndicatorImpl#getColumnHeaders()}.
 */
@Test public void testGetColumnHeaders(){
  ColumnSetMultiValueIndicatorImpl columnSetMultiValueIndicatorImpl=new ColumnSetMultiValueIndicatorImpl();
  EList<ModelElement> analyzedColumns=columnSetMultiValueIndicatorImpl.getAnalyzedColumns();
  EList<String> columnHeaders=columnSetMultiValueIndicatorImpl.getColumnHeaders();
  Assert.assertFalse(columnHeaders.isEmpty());
  Assert.assertTrue(columnHeaders.size() == 1);
  Assert.assertTrue(COUNT_STAR.equals(columnHeaders.get(0)));
  analyzedColumns.add(createColumn11());
  analyzedColumns.add(createColumn12());
  analyzedColumns.add(createColumn2());
  analyzedColumns.add(createColumn3());
  columnHeaders=columnSetMultiValueIndicatorImpl.getColumnHeaders();
  Assert.assertFalse(columnHeaders.isEmpty());
  Assert.assertTrue(columnHeaders.size() == 6);
  Assert.assertTrue(COLUMN_NAME_11.equals(columnHeaders.get(0)));
  Assert.assertTrue(COLUMN_NAME_12.equals(columnHeaders.get(1)));
  Assert.assertTrue(COLUMN_NAME_2.equals(columnHeaders.get(2)));
  Assert.assertTrue(COLUMN_NAME_3.equals(columnHeaders.get(3)));
  Assert.assertTrue(COLUMN_NAME_4.equals(columnHeaders.get(4)));
  Assert.assertTrue(COUNT_STAR.equals(columnHeaders.get(5)));
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.talend.dataquality.indicators.columnset.impl.ColumnSetMultiValueIndicatorImpl#getColumnHeaders()}.
 */
@Test public void testGetColumnHeaders(){
  ColumnSetMultiValueIndicatorImpl columnSetMultiValueIndicatorImpl=new ColumnSetMultiValueIndicatorImpl();
  EList<ModelElement> analyzedColumns=columnSetMultiValueIndicatorImpl.getAnalyzedColumns();
  EList<String> columnHeaders=columnSetMultiValueIndicatorImpl.getColumnHeaders();
  Assert.assertFalse(columnHeaders.isEmpty());
  Assert.assertTrue(columnHeaders.size() == 1);
  Assert.assertTrue(COUNT_STAR.equals(columnHeaders.get(0)));
  analyzedColumns.add(createColumn11());
  analyzedColumns.add(createColumn12());
  analyzedColumns.add(createColumn2());
  analyzedColumns.add(createColumn3());
  analyzedColumns.add(createColumn4());
  columnHeaders=columnSetMultiValueIndicatorImpl.getColumnHeaders();
  Assert.assertFalse(columnHeaders.isEmpty());
  Assert.assertTrue(columnHeaders.size() == 6);
  Assert.assertTrue(COLUMN_NAME_11.equals(columnHeaders.get(0)));
  Assert.assertTrue(COLUMN_NAME_12.equals(columnHeaders.get(1)));
  Assert.assertTrue(COLUMN_NAME_2.equals(columnHeaders.get(2)));
  Assert.assertTrue(COLUMN_NAME_3.equals(columnHeaders.get(3)));
  Assert.assertTrue(COLUMN_NAME_4.equals(columnHeaders.get(4)));
  Assert.assertTrue(COUNT_STAR.equals(columnHeaders.get(5)));
}
Program: 136645
Project: 136645
Buggy source:
public DQRespositoryView(){
  super();
  try {
    manager=DQStructureManager.getInstance();
    if (manager.isNeedCreateStructure()) {
      ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(new RepositoryWorkUnit<Object>("String_Node_Str"){
        @Override protected void run(){
          manager.createDQStructure();
        }
      }
);
    }
    if (manager.isNeedMigration()) {
      IRunnableWithProgress op=new IRunnableWithProgress(){
        public void run(        IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
          ProductVersion wVersion=WorkspaceVersionHelper.getVesion();
          new MigrationTaskManager(wVersion).doMigrationTask(monitor);
        }
      }
;
      ProgressUI.popProgressDialog(op);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
public DQRespositoryView(){
  super();
  try {
    manager=DQStructureManager.getInstance();
    if (manager.isNeedCreateStructure()) {
      RepositoryWorkUnit<Object> dQRepositoryWorkUnit=new RepositoryWorkUnit<Object>("String_Node_Str"){
        @Override protected void run(){
          final IWorkspaceRunnable op=new IWorkspaceRunnable(){
            public void run(            IProgressMonitor monitor) throws CoreException {
              manager.createDQStructure();
            }
          }
;
          IRunnableWithProgress iRunnableWithProgress=new IRunnableWithProgress(){
            public void run(            final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
              IWorkspace workspace=ResourcesPlugin.getWorkspace();
              try {
                ISchedulingRule schedulingRule=workspace.getRoot();
                workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
              }
 catch (              CoreException e) {
                throw new InvocationTargetException(e);
              }
            }
          }
;
          try {
            iRunnableWithProgress.run(new NullProgressMonitor());
          }
 catch (          Exception e) {
            ExceptionHandler.process(e);
          }
        }
      }
;
      dQRepositoryWorkUnit.setForceTransaction(true);
      ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(dQRepositoryWorkUnit);
    }
    if (manager.isNeedMigration()) {
      IRunnableWithProgress op=new IRunnableWithProgress(){
        public void run(        IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
          ProductVersion wVersion=WorkspaceVersionHelper.getVesion();
          new MigrationTaskManager(wVersion).doMigrationTask(monitor);
        }
      }
;
      ProgressUI.popProgressDialog(op);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}
Program: 136648
Project: 136648
Buggy source:
@Override public void doRun(){
  if (deleteElements.length == 0) {
    return;
  }
  setSpecialSelection(deletionSelProv);
  deleteElements=checkSourceFilesEditorOpening(deleteElements);
  for (  Object obj : deleteElements) {
    RepositoryNode node=(RepositoryNode)obj;
    selectedNodes.add(node);
  }
  if (DQRepositoryNode.isOnFilterring()) {
    setPreviousFilteredNode(selectedNodes.get(0));
  }
  if (selectedNodes.size() > 0) {
    IRepositoryNode firstNode=selectedNodes.get(0);
    boolean isStateDeleted=RepositoryNodeHelper.isStateDeleted(firstNode);
    if (!isStateDeleted) {
      logicDelete();
    }
 else {
      Collection<IRepositoryNode> shownNodes=null;
      Collection<IRepositoryNode> allDeleteNodes=null;
      if (DQRepositoryNode.isOnFilterring()) {
        shownNodes=RepositoryNodeHelper.findAllChildrenNodes(selectedNodes);
        selectedNodes=rebuildNodes(selectedNodes);
        allDeleteNodes=RepositoryNodeHelper.findAllChildrenNodes(selectedNodes);
      }
      if (DQRepositoryNode.isOnFilterring() && isShowFilteredOutWarning()) {
        setShowFilteredOutWarning(false);
        if (!RepositoryNodeHelper.canDeleteWhenFiltering(allDeleteNodes,shownNodes)) {
          return;
        }
      }
      if (showConfirmDialog()) {
        sortNodesBeforePhysicalDelete();
        physicalDelete();
      }
    }
  }
  if (DQRepositoryNode.isOnFilterring()) {
    RepositoryNodeHelper.regainRecycleBinFilteredNode();
  }
  refreshWorkspaceAndRecycleBinNodes();
}

Fixed version (ground truth):
@Override public void doRun(){
  repositoryObjectCRUD.refreshDQViewForRemoteProject();
  if (deleteElements.length == 0) {
    return;
  }
  setSpecialSelection(deletionSelProv);
  deleteElements=checkSourceFilesEditorOpening(deleteElements);
  for (  Object obj : deleteElements) {
    RepositoryNode node=(RepositoryNode)obj;
    selectedNodes.add(node);
  }
  if (DQRepositoryNode.isOnFilterring()) {
    setPreviousFilteredNode(selectedNodes.get(0));
  }
  if (selectedNodes.size() > 0) {
    IRepositoryNode firstNode=selectedNodes.get(0);
    boolean isStateDeleted=RepositoryNodeHelper.isStateDeleted(firstNode);
    if (!isStateDeleted) {
      logicDelete();
    }
 else {
      Collection<IRepositoryNode> shownNodes=null;
      Collection<IRepositoryNode> allDeleteNodes=null;
      if (DQRepositoryNode.isOnFilterring()) {
        shownNodes=RepositoryNodeHelper.findAllChildrenNodes(selectedNodes);
        selectedNodes=rebuildNodes(selectedNodes);
        allDeleteNodes=RepositoryNodeHelper.findAllChildrenNodes(selectedNodes);
      }
      if (DQRepositoryNode.isOnFilterring() && isShowFilteredOutWarning()) {
        setShowFilteredOutWarning(false);
        if (!RepositoryNodeHelper.canDeleteWhenFiltering(allDeleteNodes,shownNodes)) {
          return;
        }
      }
      if (showConfirmDialog()) {
        sortNodesBeforePhysicalDelete();
        physicalDelete();
      }
    }
  }
  if (DQRepositoryNode.isOnFilterring()) {
    RepositoryNodeHelper.regainRecycleBinFilteredNode();
  }
  refreshWorkspaceAndRecycleBinNodes();
}
Program: 136649
Project: 136649
Buggy source:
@Override protected void doRun(){
  try {
    String newLabel=null;
    Item lastDuplicateItem=null;
    for (    final IRepositoryNode node : nodeArray) {
      IRepositoryViewObject viewObject=node.getObject();
      validateOriginalObject(viewObject);
      final IDuplicateHandle handle=ActionHandleFactory.getInstance().createDuplicateHandle(node);
      if (handle != null) {
        String initLabel=generateInitialLabel(node);
        InputDialog dialog=createInputNewNameDialog(node,initLabel);
        if (dialog.open() == Window.OK) {
          newLabel=dialog.getValue().trim();
          lastDuplicateItem=handle.duplicateItem(viewObject.getProperty().getItem(),newLabel);
        }
      }
 else {
        log.error(DefaultMessagesImpl.getString("String_Node_Str",node.getLabel()));
      }
    }
    if (lastDuplicateItem != null) {
      CorePlugin.getDefault().refreshWorkSpace();
      selectAndReveal(newLabel,lastDuplicateItem);
    }
  }
 catch (  BusinessException e) {
    ExceptionHandler.process(e,Level.FATAL);
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  repositoryObjectCRUD.refreshDQViewForRemoteProject();
  try {
    String newLabel=null;
    Item lastDuplicateItem=null;
    for (    final IRepositoryNode node : nodeArray) {
      IRepositoryViewObject viewObject=node.getObject();
      validateOriginalObject(viewObject);
      final IDuplicateHandle handle=ActionHandleFactory.getInstance().createDuplicateHandle(node);
      if (handle != null) {
        String initLabel=generateInitialLabel(node);
        InputDialog dialog=createInputNewNameDialog(node,initLabel);
        if (dialog.open() == Window.OK) {
          newLabel=dialog.getValue().trim();
          lastDuplicateItem=handle.duplicateItem(viewObject.getProperty().getItem(),newLabel);
        }
      }
 else {
        log.error(DefaultMessagesImpl.getString("String_Node_Str",node.getLabel()));
      }
    }
    if (lastDuplicateItem != null) {
      CorePlugin.getDefault().refreshWorkSpace();
      selectAndReveal(newLabel,lastDuplicateItem);
    }
  }
 catch (  BusinessException e) {
    ExceptionHandler.process(e,Level.FATAL);
  }
}
Program: 136650
Project: 136650
Buggy source:
@Override public ISelection getSelection(){
  return getRepositorySelection();
}

Fixed version (ground truth):
@Override public ISelection getSelection(){
  repositoryObjectCRUD.refreshDQViewForRemoteProject();
  return repositoryObjectCRUD.getUISelection();
}
Program: 136651
Project: 136651
Buggy source:
@Override public void run(){
  ProxyRepositoryManager.getInstance().refresh();
  getCommonViewer().refresh();
  super.run();
}

Fixed version (ground truth):
@Override protected void run() throws LoginException, PersistenceException {
  CorePlugin.getDefault().refreshWorkSpace();
  ProxyRepositoryManager.getInstance().refresh();
  getCommonViewer().refresh();
}
Program: 136652
Project: 136652
Buggy source:
public void refresh(){
  RefreshDQReponsitoryViewAction refresh=new RefreshDQReponsitoryViewAction();
  refresh.run();
}

Fixed version (ground truth):
public void refresh(){
  new RefreshDQReponsitoryViewAction().run();
}
Program: 136653
Project: 136653
Buggy source:
/** 
 * refresh Workspace and DQView.
 */
protected void refreshWorkspaceDQView(){
  IWorkbenchPart activePart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
  if (activePart instanceof DQRespositoryView) {
    ((DQRespositoryView)activePart).refresh();
  }
  CorePlugin.getDefault().refreshWorkSpace();
}

Fixed version (ground truth):
/** 
 * refresh Workspace and DQView.
 */
protected void refreshWorkspaceDQView(){
  IWorkbenchPart activePart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
  if (activePart instanceof DQRespositoryView) {
    ((DQRespositoryView)activePart).refresh();
  }
}
Program: 136654
Project: 136654
Buggy source:
public Map<IPath,IPath> mapping(ItemRecord record){
  Map<IPath,IPath> toExportMap=new HashMap<IPath,IPath>();
  IPath itemResPath=new Path(record.getFile().getAbsolutePath());
  Property property=record.getProperty();
  IPath itemDesPath=null;
  if (property != null) {
    itemDesPath=PropertyHelper.getItemPath(property).makeRelative();
  }
 else {
    itemDesPath=record.getFullPath();
  }
  IPath propResPath=record.getPropertyPath();
  IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  toExportMap.put(itemResPath,itemDesPath);
  if (!propResPath.toFile().exists()) {
    return toExportMap;
  }
  toExportMap.put(propResPath,propDesPath);
  return toExportMap;
}

Fixed version (ground truth):
public Map<IPath,IPath> mapping(ItemRecord record){
  Map<IPath,IPath> toExportMap=new HashMap<IPath,IPath>();
  IPath itemResPath=new Path(record.getFile().getAbsolutePath());
  Property property=record.getProperty();
  IPath itemDesPath=null;
  if (property != null) {
    itemDesPath=PropertyHelper.getItemPath(property).makeRelative();
  }
 else {
    itemDesPath=itemResPath.makeRelativeTo(ResourceManager.getRootProject().getLocation().removeLastSegments(1));
  }
  IPath propResPath=record.getPropertyPath();
  IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  toExportMap.put(itemResPath,itemDesPath);
  if (!propResPath.toFile().exists()) {
    return toExportMap;
  }
  toExportMap.put(propResPath,propDesPath);
  return toExportMap;
}
Program: 136655
Project: 136655
Buggy source:
@Override public void doRun(){
  if (deleteElements.length == 0) {
    return;
  }
  setSpecialSelection(deletionSelProv);
  deleteElements=checkSourceFilesEditorOpening(deleteElements);
  for (  Object obj : deleteElements) {
    RepositoryNode node=(RepositoryNode)obj;
    selectedNodes.add(node);
  }
  if (DQRepositoryNode.isOnFilterring()) {
    setPreviousFilteredNode(selectedNodes.get(0));
  }
  if (selectedNodes.size() > 0) {
    IRepositoryNode firstNode=selectedNodes.get(0);
    boolean isStateDeleted=RepositoryNodeHelper.isStateDeleted(firstNode);
    if (!isStateDeleted) {
      logicDelete();
    }
 else {
      Collection<IRepositoryNode> shownNodes=null;
      Collection<IRepositoryNode> allDeleteNodes=null;
      if (DQRepositoryNode.isOnFilterring()) {
        shownNodes=RepositoryNodeHelper.findAllChildrenNodes(selectedNodes);
        selectedNodes=rebuildNodes(selectedNodes);
        allDeleteNodes=RepositoryNodeHelper.findAllChildrenNodes(selectedNodes);
      }
      if (DQRepositoryNode.isOnFilterring() && isShowFilteredOutWarning()) {
        setShowFilteredOutWarning(false);
        if (!RepositoryNodeHelper.canDeleteWhenFiltering(allDeleteNodes,shownNodes)) {
          return;
        }
      }
      if (showConfirmDialog()) {
        sortNodesBeforePhysicalDelete();
        physicalDelete();
      }
    }
  }
  if (DQRepositoryNode.isOnFilterring()) {
    RepositoryNodeHelper.regainRecycleBinFilteredNode();
  }
  refreshWorkspaceAndRecycleBinNodes();
}

Fixed version (ground truth):
@Override public void doRun(){
  repositoryObjectCRUD.refreshDQViewForRemoteProject();
  if (deleteElements.length == 0) {
    return;
  }
  setSpecialSelection(deletionSelProv);
  deleteElements=checkSourceFilesEditorOpening(deleteElements);
  for (  Object obj : deleteElements) {
    RepositoryNode node=(RepositoryNode)obj;
    selectedNodes.add(node);
  }
  if (DQRepositoryNode.isOnFilterring()) {
    setPreviousFilteredNode(selectedNodes.get(0));
  }
  if (selectedNodes.size() > 0) {
    IRepositoryNode firstNode=selectedNodes.get(0);
    boolean isStateDeleted=RepositoryNodeHelper.isStateDeleted(firstNode);
    if (!isStateDeleted) {
      logicDelete();
    }
 else {
      Collection<IRepositoryNode> shownNodes=null;
      Collection<IRepositoryNode> allDeleteNodes=null;
      if (DQRepositoryNode.isOnFilterring()) {
        shownNodes=RepositoryNodeHelper.findAllChildrenNodes(selectedNodes);
        selectedNodes=rebuildNodes(selectedNodes);
        allDeleteNodes=RepositoryNodeHelper.findAllChildrenNodes(selectedNodes);
      }
      if (DQRepositoryNode.isOnFilterring() && isShowFilteredOutWarning()) {
        setShowFilteredOutWarning(false);
        if (!RepositoryNodeHelper.canDeleteWhenFiltering(allDeleteNodes,shownNodes)) {
          return;
        }
      }
      if (showConfirmDialog()) {
        sortNodesBeforePhysicalDelete();
        physicalDelete();
      }
    }
  }
  if (DQRepositoryNode.isOnFilterring()) {
    RepositoryNodeHelper.regainRecycleBinFilteredNode();
  }
  refreshWorkspaceAndRecycleBinNodes();
}
Program: 136656
Project: 136656
Buggy source:
@Override protected void doRun(){
  try {
    String newLabel=null;
    Item lastDuplicateItem=null;
    for (    final IRepositoryNode node : nodeArray) {
      IRepositoryViewObject viewObject=node.getObject();
      validateOriginalObject(viewObject);
      final IDuplicateHandle handle=ActionHandleFactory.getInstance().createDuplicateHandle(node);
      if (handle != null) {
        String initLabel=generateInitialLabel(node);
        InputDialog dialog=createInputNewNameDialog(node,initLabel);
        if (dialog.open() == Window.OK) {
          newLabel=dialog.getValue().trim();
          lastDuplicateItem=handle.duplicateItem(viewObject.getProperty().getItem(),newLabel);
        }
      }
 else {
        log.error(DefaultMessagesImpl.getString("String_Node_Str",node.getLabel()));
      }
    }
    if (lastDuplicateItem != null) {
      CorePlugin.getDefault().refreshWorkSpace();
      selectAndReveal(newLabel,lastDuplicateItem);
    }
  }
 catch (  BusinessException e) {
    ExceptionHandler.process(e,Level.FATAL);
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  repositoryObjectCRUD.refreshDQViewForRemoteProject();
  try {
    String newLabel=null;
    Item lastDuplicateItem=null;
    for (    final IRepositoryNode node : nodeArray) {
      IRepositoryViewObject viewObject=node.getObject();
      validateOriginalObject(viewObject);
      final IDuplicateHandle handle=ActionHandleFactory.getInstance().createDuplicateHandle(node);
      if (handle != null) {
        String initLabel=generateInitialLabel(node);
        InputDialog dialog=createInputNewNameDialog(node,initLabel);
        if (dialog.open() == Window.OK) {
          newLabel=dialog.getValue().trim();
          lastDuplicateItem=handle.duplicateItem(viewObject.getProperty().getItem(),newLabel);
        }
      }
 else {
        log.error(DefaultMessagesImpl.getString("String_Node_Str",node.getLabel()));
      }
    }
    if (lastDuplicateItem != null) {
      CorePlugin.getDefault().refreshWorkSpace();
      selectAndReveal(newLabel,lastDuplicateItem);
    }
  }
 catch (  BusinessException e) {
    ExceptionHandler.process(e,Level.FATAL);
  }
}
Program: 136657
Project: 136657
Buggy source:
@Override public ISelection getSelection(){
  return getRepositorySelection();
}

Fixed version (ground truth):
@Override public ISelection getSelection(){
  repositoryObjectCRUD.refreshDQViewForRemoteProject();
  return repositoryObjectCRUD.getUISelection();
}
Program: 136658
Project: 136658
Buggy source:
@Override public void run(){
  ProxyRepositoryManager.getInstance().refresh();
  getCommonViewer().refresh();
  super.run();
}

Fixed version (ground truth):
@Override protected void run() throws LoginException, PersistenceException {
  CorePlugin.getDefault().refreshWorkSpace();
  ProxyRepositoryManager.getInstance().refresh();
  getCommonViewer().refresh();
}
Program: 136659
Project: 136659
Buggy source:
public void refresh(){
  RefreshDQReponsitoryViewAction refresh=new RefreshDQReponsitoryViewAction();
  refresh.run();
}

Fixed version (ground truth):
public void refresh(){
  new RefreshDQReponsitoryViewAction().run();
}
Program: 136660
Project: 136660
Buggy source:
/** 
 * refresh Workspace and DQView.
 */
protected void refreshWorkspaceDQView(){
  IWorkbenchPart activePart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
  if (activePart instanceof DQRespositoryView) {
    ((DQRespositoryView)activePart).refresh();
  }
  CorePlugin.getDefault().refreshWorkSpace();
}

Fixed version (ground truth):
/** 
 * refresh Workspace and DQView.
 */
protected void refreshWorkspaceDQView(){
  IWorkbenchPart activePart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
  if (activePart instanceof DQRespositoryView) {
    ((DQRespositoryView)activePart).refresh();
  }
}
Program: 136661
Project: 136661
Buggy source:
@Override public boolean reset(){
  if (this.isUsedMapDBMode()) {
    if (needReconnect((AbstractDB<?>)distinctMap)) {
      distinctMap=initValueForDBMap(StandardDBName.computeProcess.name());
    }
    distinctMap.clear();
    if (needReconnect((AbstractDB<?>)duplicateObjects)) {
      duplicateObjects=initValueForSet(StandardDBName.computeProcessSet.name());
    }
    duplicateObjects.clear();
    drillDownValueCount=0l;
  }
 else {
    distinctMap=initValueForDBMap(StandardDBName.computeProcess.name());
    duplicateObjects=initValueForSet(StandardDBName.computeProcessSet.name());
    distinctMap.clear();
    duplicateObjects.clear();
  }
  return super.reset();
}

Fixed version (ground truth):
@Override public boolean reset(){
  if (this.isUsedMapDBMode()) {
    if (needReconnect((AbstractDB<?>)distinctMap)) {
      distinctMap=initValueForDBMap(StandardDBName.computeProcess.name());
    }
    distinctMap.clear();
    if (needReconnect((AbstractDB<?>)duplicateObjects)) {
      duplicateObjects=initValueForSet(StandardDBName.computeProcessSet.name());
    }
    duplicateObjects.clear();
    drillDownValueCount=0l;
  }
 else {
    distinctMap=new HashMap<>();
    duplicateObjects=new HashSet<>();
    distinctMap.clear();
    duplicateObjects.clear();
  }
  return super.reset();
}
Program: 136662
Project: 136662
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void setDuplicateValueCount(Long newDuplicateValueCount){
  Long oldDuplicateValueCount=duplicateValueCount;
  duplicateValueCount=newDuplicateValueCount;
  if (eNotificationRequired())   eNotify(new ENotificationImpl(this,Notification.SET,IndicatorsPackage.DUPLICATE_COUNT_INDICATOR__DUPLICATE_VALUE_COUNT,oldDuplicateValueCount,duplicateValueCount));
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void setDuplicateValueCount(Long newDuplicateValueCount){
  Long oldDuplicateValueCount=duplicateValueCount;
  duplicateValueCount=newDuplicateValueCount;
  if (eNotificationRequired()) {
    eNotify(new ENotificationImpl(this,Notification.SET,IndicatorsPackage.DUPLICATE_COUNT_INDICATOR__DUPLICATE_VALUE_COUNT,oldDuplicateValueCount,duplicateValueCount));
  }
}
Program: 136664
Project: 136664
Buggy source:
@Before public void setUp() throws Exception {
  possiblePhoneCountIndicatorImpl=new PossiblePhoneCountIndicatorImpl();
  IndicatorParameters createIndicatorParameters=IndicatorsFactory.eINSTANCE.createIndicatorParameters();
  TextParameters textParameters=IndicatorsFactory.eINSTANCE.createTextParameters();
  textParameters.setCountryCode(java.util.Locale.getDefault().getCountry());
  createIndicatorParameters.setTextParameter(textParameters);
  possiblePhoneCountIndicatorImpl.setParameters(createIndicatorParameters);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  possiblePhoneCountIndicatorImpl=new PossiblePhoneCountIndicatorImpl();
  IndicatorParameters createIndicatorParameters=IndicatorsFactory.eINSTANCE.createIndicatorParameters();
  TextParameters textParameters=IndicatorsFactory.eINSTANCE.createTextParameters();
  textParameters.setCountryCode(java.util.Locale.CHINA.getCountry());
  createIndicatorParameters.setTextParameter(textParameters);
  possiblePhoneCountIndicatorImpl.setParameters(createIndicatorParameters);
}
Program: 136665
Project: 136665
Buggy source:
public Map<IPath,IPath> mapping(ItemRecord record){
  Map<IPath,IPath> toExportMap=new HashMap<IPath,IPath>();
  IPath itemResPath=new Path(record.getFile().getAbsolutePath());
  Property property=record.getProperty();
  IPath itemDesPath=null;
  if (property != null) {
    itemDesPath=PropertyHelper.getItemPath(property).makeRelative();
  }
 else {
    itemDesPath=record.getFullPath();
  }
  IPath propResPath=record.getPropertyPath();
  IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  toExportMap.put(itemResPath,itemDesPath);
  if (!propResPath.toFile().exists()) {
    return toExportMap;
  }
  toExportMap.put(propResPath,propDesPath);
  return toExportMap;
}

Fixed version (ground truth):
public Map<IPath,IPath> mapping(ItemRecord record){
  Map<IPath,IPath> toExportMap=new HashMap<IPath,IPath>();
  IPath itemResPath=new Path(record.getFile().getAbsolutePath());
  Property property=record.getProperty();
  IPath itemDesPath=null;
  if (property != null) {
    itemDesPath=PropertyHelper.getItemPath(property).makeRelative();
  }
 else {
    itemDesPath=itemResPath.makeRelativeTo(ResourceManager.getRootProject().getLocation().removeLastSegments(1));
  }
  IPath propResPath=record.getPropertyPath();
  IPath propDesPath=itemDesPath.removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
  toExportMap.put(itemResPath,itemDesPath);
  if (!propResPath.toFile().exists()) {
    return toExportMap;
  }
  toExportMap.put(propResPath,propDesPath);
  return toExportMap;
}
Program: 136668
Project: 136668
Buggy source:
@Override protected boolean doExecute() throws Exception {
  File oldFolder=ResourceManager.getSystemIndicatorFolder().getRawLocation().append(PATTERN_FINDER).toFile();
  File newFolder=WorkspaceUtils.ifolderToFile(ResourceManager.getSysIndicatorPatternFinderFolder());
  boolean result=oldFolder.renameTo(newFolder);
  try {
    String[] indicatorProFileExtentionName={FactoriesUtil.PROPERTIES_EXTENSION};
    result&=FilesUtils.migrateFolder(newFolder,indicatorProFileExtentionName,initIndicatorReplaceMap(),log);
    File analysisFolder=WorkspaceUtils.ifolderToFile(ResourceManager.getAnalysisFolder());
    String[] analysisFileExtentionName={FactoriesUtil.ANA};
    result&=FilesUtils.migrateFolder(analysisFolder,analysisFileExtentionName,initIndicatorReplaceMap(),log);
    ResourceService.refreshStructure();
  }
 catch (  Exception e) {
    result=false;
    log.error(e,e);
  }
  IFile file=ResourceManager.getLibrariesFolder().getFile(DefinitionHandler.FILENAME);
  file.delete(true,new NullProgressMonitor());
  DefinitionHandler.getInstance().copyDefinitionsIntoFolder(ResourceManager.getLibrariesFolder());
  URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
  EMFSharedResources.getInstance().reloadResource(uri);
  DefinitionHandler.getInstance().reloadIndicatorsDefinitions();
  return result;
}

Fixed version (ground truth):
@Override protected boolean doExecute() throws Exception {
  boolean result=true;
  File newFolder=WorkspaceUtils.ifolderToFile(ResourceManager.getSysIndicatorPatternFrequnceyStatisticsFolder());
  if (!ResourceManager.getSysIndicatorPatternFrequnceyStatisticsFolder().exists()) {
    File oldFolder=ResourceManager.getSystemIndicatorFolder().getRawLocation().append(PATTERN_FINDER).toFile();
    result&=oldFolder.renameTo(newFolder);
  }
  try {
    String[] indicatorProFileExtentionName={FactoriesUtil.PROPERTIES_EXTENSION};
    result&=FilesUtils.migrateFolder(newFolder,indicatorProFileExtentionName,initIndicatorReplaceMap(),log);
    File analysisFolder=WorkspaceUtils.ifolderToFile(ResourceManager.getAnalysisFolder());
    String[] analysisFileExtentionName={FactoriesUtil.ANA};
    result&=FilesUtils.migrateFolder(analysisFolder,analysisFileExtentionName,initIndicatorReplaceMap(),log);
    ResourceService.refreshStructure();
  }
 catch (  Exception e) {
    result=false;
    log.error(e,e);
  }
  IFile file=ResourceManager.getLibrariesFolder().getFile(DefinitionHandler.FILENAME);
  file.delete(true,new NullProgressMonitor());
  DefinitionHandler.getInstance().copyDefinitionsIntoFolder(ResourceManager.getLibrariesFolder());
  URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
  EMFSharedResources.getInstance().reloadResource(uri);
  DefinitionHandler.getInstance().reloadIndicatorsDefinitions();
  return result;
}
Program: 136672
Project: 136672
Buggy source:
public void postFinish() throws IOException {
  for (  IPath path : this.allDeletedItems) {
    IFile desIFile=ResourceService.file2IFile(path.toFile());
    if (desIFile != null && desIFile.getFileExtension().equals(FactoriesUtil.PROPERTIES_EXTENSION)) {
      Property property=PropertyHelper.getProperty(desIFile,true);
      if (property != null) {
        try {
          ProxyRepositoryFactory.getInstance().save(property.getItem(),true);
        }
 catch (        PersistenceException e) {
          log.error(e);
        }
      }
    }
  }
  if (!need2MergeModelElementMap.isEmpty()) {
    for (    TDQItem item : need2MergeModelElementMap.keySet()) {
      ModelElement recordMe=need2MergeModelElementMap.get(item);
      mergeClientDependency2PatternOrUdi(item,recordMe);
    }
  }
  ItemRecord.clear();
  deleteTempProjectFolder();
}

Fixed version (ground truth):
public void postFinish() throws IOException {
  for (  IPath path : this.allImportItems) {
    IFile desIFile=ResourceService.file2IFile(path.toFile());
    if (desIFile != null && desIFile.getFileExtension().equals(FactoriesUtil.PROPERTIES_EXTENSION)) {
      Property property=PropertyHelper.getProperty(desIFile,true);
      if (property != null) {
        try {
          ProxyRepositoryFactory.getInstance().reload(property,desIFile);
        }
 catch (        PersistenceException e) {
          log.error(e);
        }
      }
    }
  }
  if (!need2MergeModelElementMap.isEmpty()) {
    for (    TDQItem item : need2MergeModelElementMap.keySet()) {
      ModelElement recordMe=need2MergeModelElementMap.get(item);
      mergeClientDependency2PatternOrUdi(item,recordMe);
    }
  }
  ItemRecord.clear();
  deleteTempProjectFolder();
}
Program: 136673
Project: 136673
Buggy source:
@Override public Boolean handleDrop(final IRepositoryNode targetNode){
  boolean result=Boolean.FALSE;
  RepositoryWorkUnit<Object> repositoryWorkUnit=new RepositoryWorkUnit<Object>("String_Node_Str",this){
    @Override protected void run() throws LoginException, PersistenceException {
      String[] pathBeforeRefresh=getSelectedNodePaths();
      if (pathBeforeRefresh.length == 0) {
        showWarningDialog();
        return;
      }
      refreshDQViewForRemoteProject();
      String[] pathAfterRefresh=getSelectedNodePaths();
      if (pathAfterRefresh.length == 0) {
        showWarningDialog();
        return;
      }
      IRepositoryNode[] selectedRepositoryNodes=getSelectedRepositoryNodes();
      if (selectedRepositoryNodes.length == 0) {
        showWarningDialog();
        return;
      }
      for (int i=0; i < getSelectedRepositoryNodes().length; i++) {
        if (!pathBeforeRefresh[i].equals(pathAfterRefresh[i])) {
          showWarningDialog();
          return;
        }
      }
      result=superHandle(targetNode);
    }
  }
;
  repositoryWorkUnit.setAvoidUnloadResources(true);
  CoreRuntimePlugin.getInstance().getProxyRepositoryFactory().executeRepositoryWorkUnit(repositoryWorkUnit);
  return result;
}

Fixed version (ground truth):
@Override public Boolean handleDrop(final IRepositoryNode targetNode){
  RepositoryWorkUnit<Object> repositoryWorkUnit=new RepositoryWorkUnit<Object>("String_Node_Str",this){
    @Override protected void run() throws LoginException, PersistenceException {
      String[] pathBeforeRefresh=getSelectedNodePaths();
      if (pathBeforeRefresh.length == 0) {
        showWarningDialog();
        return;
      }
      refreshDQViewForRemoteProject();
      String[] pathAfterRefresh=getSelectedNodePaths();
      if (pathAfterRefresh.length == 0) {
        showWarningDialog();
        return;
      }
      IRepositoryNode[] selectedRepositoryNodes=getSelectedRepositoryNodes();
      if (selectedRepositoryNodes.length == 0) {
        showWarningDialog();
        return;
      }
      for (int i=0; i < getSelectedRepositoryNodes().length; i++) {
        if (!pathBeforeRefresh[i].equals(pathAfterRefresh[i])) {
          showWarningDialog();
          return;
        }
      }
      result=superHandle(targetNode);
    }
  }
;
  repositoryWorkUnit.setAvoidUnloadResources(true);
  CoreRuntimePlugin.getInstance().getProxyRepositoryFactory().executeRepositoryWorkUnit(repositoryWorkUnit);
  return (Boolean)repositoryWorkUnit.getResult();
}
Program: 136675
Project: 136675
Buggy source:
@Override protected boolean doExecute() throws Exception {
  File oldFolder=ResourceManager.getSystemIndicatorFolder().getRawLocation().append(PATTERN_FINDER).toFile();
  File newFolder=WorkspaceUtils.ifolderToFile(ResourceManager.getSysIndicatorPatternFinderFolder());
  boolean result=oldFolder.renameTo(newFolder);
  try {
    String[] indicatorProFileExtentionName={FactoriesUtil.PROPERTIES_EXTENSION};
    result&=FilesUtils.migrateFolder(newFolder,indicatorProFileExtentionName,initIndicatorReplaceMap(),log);
    File analysisFolder=WorkspaceUtils.ifolderToFile(ResourceManager.getAnalysisFolder());
    String[] analysisFileExtentionName={FactoriesUtil.ANA};
    result&=FilesUtils.migrateFolder(analysisFolder,analysisFileExtentionName,initIndicatorReplaceMap(),log);
    ResourceService.refreshStructure();
  }
 catch (  Exception e) {
    result=false;
    log.error(e,e);
  }
  IFile file=ResourceManager.getLibrariesFolder().getFile(DefinitionHandler.FILENAME);
  file.delete(true,new NullProgressMonitor());
  DefinitionHandler.getInstance().copyDefinitionsIntoFolder(ResourceManager.getLibrariesFolder());
  URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
  EMFSharedResources.getInstance().reloadResource(uri);
  DefinitionHandler.getInstance().reloadIndicatorsDefinitions();
  return result;
}

Fixed version (ground truth):
@Override protected boolean doExecute() throws Exception {
  boolean result=true;
  File newFolder=WorkspaceUtils.ifolderToFile(ResourceManager.getSysIndicatorPatternFrequnceyStatisticsFolder());
  if (!ResourceManager.getSysIndicatorPatternFrequnceyStatisticsFolder().exists()) {
    File oldFolder=ResourceManager.getSystemIndicatorFolder().getRawLocation().append(PATTERN_FINDER).toFile();
    result&=oldFolder.renameTo(newFolder);
  }
  try {
    String[] indicatorProFileExtentionName={FactoriesUtil.PROPERTIES_EXTENSION};
    result&=FilesUtils.migrateFolder(newFolder,indicatorProFileExtentionName,initIndicatorReplaceMap(),log);
    File analysisFolder=WorkspaceUtils.ifolderToFile(ResourceManager.getAnalysisFolder());
    String[] analysisFileExtentionName={FactoriesUtil.ANA};
    result&=FilesUtils.migrateFolder(analysisFolder,analysisFileExtentionName,initIndicatorReplaceMap(),log);
    ResourceService.refreshStructure();
  }
 catch (  Exception e) {
    result=false;
    log.error(e,e);
  }
  IFile file=ResourceManager.getLibrariesFolder().getFile(DefinitionHandler.FILENAME);
  file.delete(true,new NullProgressMonitor());
  DefinitionHandler.getInstance().copyDefinitionsIntoFolder(ResourceManager.getLibrariesFolder());
  URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
  EMFSharedResources.getInstance().reloadResource(uri);
  DefinitionHandler.getInstance().reloadIndicatorsDefinitions();
  return result;
}
Program: 136679
Project: 136679
Buggy source:
public void postFinish() throws IOException {
  for (  IPath path : this.allDeletedItems) {
    IFile desIFile=ResourceService.file2IFile(path.toFile());
    if (desIFile != null && desIFile.getFileExtension().equals(FactoriesUtil.PROPERTIES_EXTENSION)) {
      Property property=PropertyHelper.getProperty(desIFile,true);
      if (property != null) {
        try {
          ProxyRepositoryFactory.getInstance().save(property.getItem(),true);
        }
 catch (        PersistenceException e) {
          log.error(e);
        }
      }
    }
  }
  if (!need2MergeModelElementMap.isEmpty()) {
    for (    TDQItem item : need2MergeModelElementMap.keySet()) {
      ModelElement recordMe=need2MergeModelElementMap.get(item);
      mergeClientDependency2PatternOrUdi(item,recordMe);
    }
  }
  ItemRecord.clear();
  deleteTempProjectFolder();
}

Fixed version (ground truth):
public void postFinish() throws IOException {
  for (  IPath path : this.allImportItems) {
    IFile desIFile=ResourceService.file2IFile(path.toFile());
    if (desIFile != null && desIFile.getFileExtension().equals(FactoriesUtil.PROPERTIES_EXTENSION)) {
      Property property=PropertyHelper.getProperty(desIFile,true);
      if (property != null) {
        try {
          ProxyRepositoryFactory.getInstance().reload(property,desIFile);
        }
 catch (        PersistenceException e) {
          log.error(e);
        }
      }
    }
  }
  if (!need2MergeModelElementMap.isEmpty()) {
    for (    TDQItem item : need2MergeModelElementMap.keySet()) {
      ModelElement recordMe=need2MergeModelElementMap.get(item);
      mergeClientDependency2PatternOrUdi(item,recordMe);
    }
  }
  ItemRecord.clear();
  deleteTempProjectFolder();
}
Program: 136680
Project: 136680
Buggy source:
@Override public Boolean handleDrop(final IRepositoryNode targetNode){
  boolean result=Boolean.FALSE;
  RepositoryWorkUnit<Object> repositoryWorkUnit=new RepositoryWorkUnit<Object>("String_Node_Str",this){
    @Override protected void run() throws LoginException, PersistenceException {
      String[] pathBeforeRefresh=getSelectedNodePaths();
      if (pathBeforeRefresh.length == 0) {
        showWarningDialog();
        return;
      }
      refreshDQViewForRemoteProject();
      String[] pathAfterRefresh=getSelectedNodePaths();
      if (pathAfterRefresh.length == 0) {
        showWarningDialog();
        return;
      }
      IRepositoryNode[] selectedRepositoryNodes=getSelectedRepositoryNodes();
      if (selectedRepositoryNodes.length == 0) {
        showWarningDialog();
        return;
      }
      for (int i=0; i < getSelectedRepositoryNodes().length; i++) {
        if (!pathBeforeRefresh[i].equals(pathAfterRefresh[i])) {
          showWarningDialog();
          return;
        }
      }
      result=superHandle(targetNode);
    }
  }
;
  repositoryWorkUnit.setAvoidUnloadResources(true);
  CoreRuntimePlugin.getInstance().getProxyRepositoryFactory().executeRepositoryWorkUnit(repositoryWorkUnit);
  return result;
}

Fixed version (ground truth):
@Override public Boolean handleDrop(final IRepositoryNode targetNode){
  RepositoryWorkUnit<Object> repositoryWorkUnit=new RepositoryWorkUnit<Object>("String_Node_Str",this){
    @Override protected void run() throws LoginException, PersistenceException {
      String[] pathBeforeRefresh=getSelectedNodePaths();
      if (pathBeforeRefresh.length == 0) {
        showWarningDialog();
        return;
      }
      refreshDQViewForRemoteProject();
      String[] pathAfterRefresh=getSelectedNodePaths();
      if (pathAfterRefresh.length == 0) {
        showWarningDialog();
        return;
      }
      IRepositoryNode[] selectedRepositoryNodes=getSelectedRepositoryNodes();
      if (selectedRepositoryNodes.length == 0) {
        showWarningDialog();
        return;
      }
      for (int i=0; i < getSelectedRepositoryNodes().length; i++) {
        if (!pathBeforeRefresh[i].equals(pathAfterRefresh[i])) {
          showWarningDialog();
          return;
        }
      }
      result=superHandle(targetNode);
    }
  }
;
  repositoryWorkUnit.setAvoidUnloadResources(true);
  CoreRuntimePlugin.getInstance().getProxyRepositoryFactory().executeRepositoryWorkUnit(repositoryWorkUnit);
  return (Boolean)repositoryWorkUnit.getResult();
}
Program: 136681
Project: 136681
Buggy source:
/** 
 * DOC talend Comment method "getCurrentColorList".
 * @param columnKeys
 * @return
 */
private static List<Color> getCurrentColorList(List<?> columnKeys){
  List<Color> colorList=new ArrayList<>();
  int colorSize=ChartDecorator.COLOR_LIST.size();
  for (  Object columnKey : columnKeys) {
    int groupSize=Integer.parseInt(columnKey.toString());
    colorList.add(ChartDecorator.COLOR_LIST.get(groupSize % colorSize));
  }
  return colorList;
}

Fixed version (ground truth):
/** 
 * DOC talend Comment method "getCurrentColorList".
 * @param columnKeys
 * @return
 */
private static List<Color> getCurrentColorList(List<?> columnKeys){
  List<Color> colorList=new ArrayList<>();
  int colorSize=ChartDecorator.COLOR_LIST.size();
  for (  Object columnKey : columnKeys) {
    int groupSize=Integer.parseInt(columnKey.toString());
    colorList.add(ChartDecorator.COLOR_LIST.get(Math.abs((groupSize - 1) % colorSize)));
  }
  return colorList;
}
Program: 136682
Project: 136682
Buggy source:
@Override protected Color getBackgroundColour(ILayerCell cell,IConfigRegistry configRegistry){
  int grpSizeValue=getGrpSize(cell);
  if (grpSizeValue == 0) {
    return GUIHelper.COLOR_LIST_BACKGROUND;
  }
  return COLOR_LIST[grpSizeValue % COLOR_LIST.length];
}

Fixed version (ground truth):
@Override protected Color getBackgroundColour(ILayerCell cell,IConfigRegistry configRegistry){
  int grpSizeValue=getGrpSize(cell);
  if (grpSizeValue == 0) {
    return GUIHelper.COLOR_LIST_BACKGROUND;
  }
  return COLOR_LIST[Math.abs((grpSizeValue - 1) % COLOR_LIST.length)];
}
Program: 136683
Project: 136683
Buggy source:
@Override public org.eclipse.swt.graphics.Color getBackground(Object element,int columnIndex){
  int grpSizeValue=getGrpSize(((String[])element)[gidColumn]);
  return COLOR_LIST[grpSizeValue % COLOR_LIST.length];
}

Fixed version (ground truth):
@Override public org.eclipse.swt.graphics.Color getBackground(Object element,int columnIndex){
  int grpSizeValue=getGrpSize(((String[])element)[gidColumn]);
  return COLOR_LIST[Math.abs((grpSizeValue - 1) % COLOR_LIST.length)];
}
Program: 136684
Project: 136684
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void initializeDefaultPreferences(){
  String migrationPreference=MarkerSupportInternalUtilities.MIGRATE_TASK_FILTERS;
  if (IDEWorkbenchPlugin.getDefault().getPreferenceStore().getBoolean(migrationPreference)) {
    return;
  }
  IDEWorkbenchPlugin.getDefault().getPreferenceStore().setValue(migrationPreference,true);
  String writer="String_Node_Str";
  IDEWorkbenchPlugin.getDefault().getPreferenceStore().putValue("String_Node_Str",writer);
  IDEWorkbenchPlugin.getDefault().savePluginPreferences();
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void initializeDefaultPreferences(){
  if (CommonUIPlugin.isFullyHeadless()) {
    return;
  }
  String migrationPreference=MarkerSupportInternalUtilities.MIGRATE_TASK_FILTERS;
  if (IDEWorkbenchPlugin.getDefault().getPreferenceStore().getBoolean(migrationPreference)) {
    return;
  }
  IDEWorkbenchPlugin.getDefault().getPreferenceStore().setValue(migrationPreference,true);
  String writer="String_Node_Str";
  IDEWorkbenchPlugin.getDefault().getPreferenceStore().putValue("String_Node_Str",writer);
  IDEWorkbenchPlugin.getDefault().savePluginPreferences();
}
Program: 136685
Project: 136685
Buggy source:
protected void init(){
  try {
    in=new Scanner(new FileReader(parameters[0]));
    while (in.hasNext()) {
      StringTokens.add(in.next().trim());
    }
    in.close();
  }
 catch (  FileNotFoundException|NullPointerException e) {
  }
}

Fixed version (ground truth):
protected void init(){
  try {
    in=new BufferedReader(new FileReader(parameters[0]));
    while (in.ready()) {
      StringTokens.add(in.readLine().trim());
    }
    in.close();
  }
 catch (  IOException|NullPointerException e) {
  }
}
Program: 136686
Project: 136686
Buggy source:
/** 
 * DOC zshen Comment method "getClassName".
 * @param classPathParameter
 * @return
 */
public static String getClassName(String classPathParameter){
  return CustomAttributeMatcherClassNameConvert.getClassName(classPathParameter);
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "getClassName".
 * @param classPathParameter like "CustomMatcherTest.jar||MycustomMatch.jar||testCustomMatcher.myCustomMatcher" lastone is fully qualified name("testCustomMatcher" is package name and "myCustomMatcher" is class name).
 * @return the class name as the demo will return testCustomMatcher.myCustomMatcher
 */
public static String getClassName(String classPathParameter){
  return CustomAttributeMatcherClassNameConvert.getClassName(classPathParameter);
}
Program: 136687
Project: 136687
Buggy source:
/** 
 * DOC zshen Comment method "getClassName".
 * @param classPathParameter
 * @return
 */
public static String getClassName(String classPathParameter){
  String[] allElements=classPathParameter.split(REGEXKEY);
  if (allElements.length > 0) {
    return allElements[allElements.length - 1];
  }
 else {
    return classPathParameter;
  }
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "getClassName".
 * @param classPathParameter like "CustomMatcherTest.jar||MycustomMatch.jar||testCustomMatcher.myCustomMatcher" lastone is fully qualified name("testCustomMatcher" is package name and "myCustomMatcher" is class name).
 * @return the class name as the demo will return testCustomMatcher.myCustomMatcher
 */
public static String getClassName(String classPathParameter){
  String[] allElements=classPathParameter.split(REGEXKEY);
  if (allElements.length > 0) {
    return allElements[allElements.length - 1];
  }
 else {
    return classPathParameter;
  }
}
Program: 136688
Project: 136688
Buggy source:
private void updateColor(ISourceViewer viewer){
  if (fColor != null)   fColor.dispose();
  StyledText text=viewer.getTextWidget();
  if (text == null || text.isDisposed())   return;
  Display display=text.getDisplay();
  fColor=new Color(display,new RGB(0,0,255));
}

Fixed version (ground truth):
private void updateColor(ISourceViewer viewer){
  if (fColor != null)   fColor.dispose();
  StyledText text=viewer.getTextWidget();
  if (text == null || text.isDisposed())   return;
  Display display=text.getDisplay();
  fColor=display.getSystemColor(SWT.COLOR_BLUE);
}
Program: 136689
Project: 136689
Buggy source:
/** 
 * Creates the text editor in the top half
 * @param parent
 * @return
 */
private Composite createEditor(Composite parent){
  final Composite editorParent=new Composite(parent,SWT.NONE);
  editorParent.setLayout(new FillLayout());
  textEditor.createPartControl(editorParent);
  textEditor.addPropertyListener(new IPropertyListener(){
    public void propertyChanged(    Object source,    int propertyId){
      SQLEditor.this.firePropertyChange(propertyId);
    }
  }
);
  return editorParent;
}

Fixed version (ground truth):
/** 
 * Creates the text editor in the top half
 * @param parent
 * @return
 */
private Composite createEditor(Composite parent){
  final Composite editorParent=new Composite(parent,SWT.NONE);
  editorParent.setLayout(new FillLayout());
  textEditor.createPartControl(editorParent);
  textEditor.addPropertyListener(new IPropertyListener(){
    @Override public void propertyChanged(    Object source,    int propertyId){
      SQLEditor.this.firePropertyChange(propertyId);
    }
  }
);
  return editorParent;
}
Program: 136690
Project: 136690
Buggy source:
public void widgetDefaultSelected(SelectionEvent e){
  widgetSelected(e);
}

Fixed version (ground truth):
@Override public void widgetDefaultSelected(SelectionEvent e){
  widgetSelected(e);
}
Program: 136691
Project: 136691
Buggy source:
public void controlMoved(ControlEvent e){
}

Fixed version (ground truth):
@Override public void controlMoved(ControlEvent e){
}
Program: 136692
Project: 136692
Buggy source:
public void refreshToolbars(){
  getEditorToolBar().refresh();
}

Fixed version (ground truth):
@Override public void refreshToolbars(){
  getEditorToolBar().refresh();
}