nus-yam/ex-repair huggingface dataset:
Program: 139860
Project: 139860
Buggy source:
public static boolean isTDQLoaded(){
  return isPluginLoaded(TDQ_ID);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "isTDQLoaded". use it to test if the platform start by TDQ.
 * @return
 */
public static boolean isTDQLoaded(){
  return isPluginLoaded(TDQ_ID);
}
Program: 139861
Project: 139861
Buggy source:
/** 
 * DOC xqliu Comment method "isLibraiesSubfolder".
 * @param folder
 * @param subs
 * @return
 */
public static boolean isLibraiesSubfolder(IFolder folder,String... subs){
  for (  String sub : subs) {
    IProject defaultRootProjectFolder=ResourcesPlugin.getWorkspace().getRoot().getProject(org.talend.dataquality.PluginConstant.getRootProjectName());
    IPath path=defaultRootProjectFolder.getFolder(DQStructureManager.getLibraries()).getFullPath();
    path=path.append(sub);
    IPath fullPath=folder.getFullPath();
    boolean prefixOf=path.isPrefixOf(fullPath);
    if (prefixOf) {
      return prefixOf;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "isLibraiesSubfolder".
 * @param folder
 * @param subs
 * @return
 */
public static boolean isLibraiesSubfolder(IFolder folder,String... subs){
  for (  String sub : subs) {
    IPath path=ResourceManager.getLibrariesFolder().getFullPath();
    path=path.append(sub);
    IPath fullPath=folder.getFullPath();
    boolean prefixOf=path.isPrefixOf(fullPath);
    if (prefixOf) {
      return prefixOf;
    }
  }
  return false;
}
Program: 139862
Project: 139862
Buggy source:
/** 
 * Method "storeIndicator" stores the mapping between the analyzed element name and its indicators.
 * @param elementToAnalyze the element to analyze (column, data provider...)
 * @param indicator the indicator for the given element
 * @return true if ok
 */
public boolean storeIndicator(T elementToAnalyze,Indicator indicator){
  boolean ok=true;
  final List<Indicator> indicatorLeaves=IndicatorHelper.getIndicatorLeaves(indicator);
  this.allIndicators.addAll(indicatorLeaves);
  for (  Indicator leaf : indicatorLeaves) {
    if (!MultiMapHelper.addUniqueObjectToListMap(elementToAnalyze,leaf,elementToIndicators)) {
      ok=false;
    }
  }
  return ok;
}

Fixed version (ground truth):
/** 
 * Method "storeIndicator" stores the mapping between the analyzed element name and its indicators. if needed, this method must be called on the Child indicators of the given indicator.
 * @param elementToAnalyze the element to analyze (column, data provider...)
 * @param indicator the indicator for the given element
 * @return true if ok
 */
public boolean storeIndicator(T elementToAnalyze,Indicator indicator){
  this.allIndicators.add(indicator);
  return MultiMapHelper.addUniqueObjectToListMap(elementToAnalyze,indicator,elementToIndicators);
}
Program: 139864
Project: 139864
Buggy source:
/** 
 * DOC scorreia Comment method "addPatternToDomain".
 * @param domain
 * @param tableFilter
 * @param tablePattern
 */
private static void addPatternToDomain(Domain domain,RegularExpression tableFilter,String tablePattern,PatternType type){
  Pattern pattern=createPattern(tablePattern);
  pattern.setName(type.label);
  pattern.getComponents().add(tableFilter);
  domain.getPatterns().add(pattern);
  domain.getOwnedElement().add(pattern);
}

Fixed version (ground truth):
/** 
 * Method "addPatternToDomain" creates a Pattern object with the given expression and stores it in the given domain. Beware that it is also added to the owned elements of the Domain. This means that is contained in the domain and cannot be shared among several domains.
 * @param domain
 * @param tableFilter
 * @param tablePattern
 */
private static void addPatternToDomain(Domain domain,RegularExpression tableFilter,String tablePattern,PatternType type){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  pattern.setName(type.label);
  pattern.getComponents().add(tableFilter);
  domain.getPatterns().add(pattern);
  domain.getOwnedElement().add(pattern);
}
Program: 139865
Project: 139865
Buggy source:
/** 
 * DOC scorreia Comment method "createPattern".
 * @param tablePattern
 * @return
 */
private static Pattern createPattern(String tablePattern){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  pattern.getComponents().add(BooleanExpressionHelper.createRegularExpression(null,tablePattern));
  return pattern;
}

Fixed version (ground truth):
/** 
 * Method "createPattern".
 * @param language
 * @param regexp
 * @return a new pattern from the given regular expression
 */
public static Pattern createPattern(String language,String regexp){
  Pattern pattern=PatternFactory.eINSTANCE.createPattern();
  pattern.getComponents().add(BooleanExpressionHelper.createRegularExpression(language,regexp));
  return pattern;
}
Program: 139866
Project: 139866
Buggy source:
/** 
 * <!-- begin-user-doc --> Returns the real value if the indicator is a real valued indicator. Can return null. <!-- end-user-doc -->
 * @model kind="operation"
 * @generated
 */
Double getRealValue();

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> Returns the real value if the indicator is a real valued indicator. Can return null. This method must be implemented in order to store the value in the datamart. <!-- end-user-doc -->
 * @model kind="operation"
 * @generated
 */
Double getRealValue();
Program: 139867
Project: 139867
Buggy source:
/** 
 * <!-- begin-user-doc --> Returns the integer value if the indicator is an integer valued indicator. Can return null. <!-- end-user-doc -->
 * @model kind="operation"
 * @generated
 */
Long getIntegerValue();

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> Returns the integer value if the indicator is an integer valued indicator. Can return null. This method must be implemented in order to store the value in the datamart. <!-- end-user-doc -->
 * @model kind="operation"
 * @generated
 */
Long getIntegerValue();
Program: 139868
Project: 139868
Buggy source:
public static IProject getRootProject(){
  IProjectAdapterService projectAdapter=(IProjectAdapterService)GlobalServiceRegister.getDefault().getService(IProjectAdapterService.class);
  IProject rootProject=null;
  if (projectAdapter != null) {
    rootProject=projectAdapter.getRootProject();
  }
 else {
    rootProject=ResourcesPlugin.getWorkspace().getRoot().getProject(DEFAULT_PROJECT_NAME);
  }
  PluginConstant.setRootProjectName(rootProject.getName());
  return rootProject;
}

Fixed version (ground truth):
public static IProject getRootProject(){
  IProject rootProject=null;
  try {
    IProjectAdapterService projectAdapter=(IProjectAdapterService)GlobalServiceRegister.getDefault().getService(IProjectAdapterService.class);
    if (projectAdapter != null) {
      rootProject=projectAdapter.getRootProject();
    }
  }
 catch (  RuntimeException e) {
    Log.warn(e,e);
    rootProject=ResourcesPlugin.getWorkspace().getRoot().getProject(DEFAULT_PROJECT_NAME);
  }
  PluginConstant.setRootProjectName(rootProject.getName());
  return rootProject;
}
Program: 139869
Project: 139869
Buggy source:
public static List<TdTable> getTables(Catalog catalog){
  TaggedValue tv=TaggedValueHelper.getTaggedValue(TaggedValueHelper.TABLE_FILTER,catalog.getTaggedValue());
  String tableFilter=tv == null ? null : tv.getValue();
  return TableHelper.getTables(catalog.getOwnedElement(),tableFilter);
}

Fixed version (ground truth):
public static List<TdTable> getTables(Catalog catalog){
  return TableHelper.getTables(catalog.getOwnedElement());
}
Program: 139870
Project: 139870
Buggy source:
public static List<TdView> getViews(Catalog catalog){
  TaggedValue tv=TaggedValueHelper.getTaggedValue(TaggedValueHelper.VIEW_FILTER,catalog.getTaggedValue());
  String viewFilter=tv == null ? null : tv.getValue();
  return ViewHelper.getViews(catalog.getOwnedElement(),viewFilter);
}

Fixed version (ground truth):
public static List<TdView> getViews(Catalog catalog){
  return ViewHelper.getViews(catalog.getOwnedElement());
}
Program: 139871
Project: 139871
Buggy source:
public static List<TdTable> getTables(Schema schema){
  TaggedValue tv=TaggedValueHelper.getTaggedValue(TaggedValueHelper.TABLE_FILTER,schema.getTaggedValue());
  String tableFilter=tv == null ? null : tv.getValue();
  return TableHelper.getTables(schema.getOwnedElement(),tableFilter);
}

Fixed version (ground truth):
public static List<TdTable> getTables(Schema schema){
  return TableHelper.getTables(schema.getOwnedElement());
}
Program: 139872
Project: 139872
Buggy source:
public static List<TdView> getViews(Schema schema){
  TaggedValue tv=TaggedValueHelper.getTaggedValue(TaggedValueHelper.VIEW_FILTER,schema.getTaggedValue());
  String viewFilter=tv == null ? null : tv.getValue();
  return ViewHelper.getViews(schema.getOwnedElement(),viewFilter);
}

Fixed version (ground truth):
public static List<TdView> getViews(Schema schema){
  return ViewHelper.getViews(schema.getOwnedElement());
}
Program: 139873
Project: 139873
Buggy source:
/** 
 * DOC xqliu Comment method "getTables". ADD xqliu 2009-04-27 bug 6507
 * @param elements
 * @param tableFilter
 * @return
 */
public static List<TdTable> getTables(Collection<? extends EObject> elements,String tableFilter){
  List<TdTable> tables=new ArrayList<TdTable>();
  boolean filter=(tableFilter == null || "String_Node_Str".equals(tableFilter)) ? false : true;
  for (  EObject elt : elements) {
    TdTable table=SwitchHelpers.TABLE_SWITCH.doSwitch(elt);
    if (table != null) {
      if (filter) {
        if (table.getName().toLowerCase().indexOf(tableFilter.toLowerCase()) > -1) {
          tables.add(table);
        }
      }
 else {
        tables.add(table);
      }
    }
  }
  return tables;
}

Fixed version (ground truth):
/** 
 * Method "getTables" extracts the tables from the list.
 * @param elements any elements that could contain TdTables
 * @return the list of TdTables found in the given list (never null, but can be empty).
 */
public static List<TdTable> getTables(Collection<? extends EObject> elements){
  List<TdTable> tables=new ArrayList<TdTable>();
  for (  EObject elt : elements) {
    TdTable table=SwitchHelpers.TABLE_SWITCH.doSwitch(elt);
    if (table != null) {
      tables.add(table);
    }
  }
  return tables;
}
Program: 139874
Project: 139874
Buggy source:
/** 
 * DOC xqliu Comment method "getViews". ADD xqliu 2009-04-27 bug 6507
 * @param elements
 * @param viewFilter
 * @return
 */
public static List<TdView> getViews(Collection<? extends EObject> elements,String viewFilter){
  List<TdView> views=new ArrayList<TdView>();
  boolean filter=(viewFilter == null || "String_Node_Str".equals(viewFilter)) ? false : true;
  for (  EObject elt : elements) {
    TdView view=SwitchHelpers.VIEW_SWITCH.doSwitch(elt);
    if (view != null) {
      if (filter) {
        if (view.getName().toLowerCase().indexOf(viewFilter.toLowerCase()) > -1) {
          views.add(view);
        }
      }
 else {
        views.add(view);
      }
    }
  }
  return views;
}

Fixed version (ground truth):
/** 
 * Method "getViews" extracts the views from the list.
 * @param elements any elements that could contain TdView
 * @return the list of TdView found in the given list (never null, but can be empty).
 */
public static List<TdView> getViews(Collection<? extends EObject> elements){
  List<TdView> views=new ArrayList<TdView>();
  for (  EObject elt : elements) {
    TdView table=SwitchHelpers.VIEW_SWITCH.doSwitch(elt);
    if (table != null) {
      views.add(table);
    }
  }
  return views;
}
Program: 139875
Project: 139875
Buggy source:
/** 
 * Method "getColumnSets" returns tables or views. MOD xqliu 2009-04-27 bug 6507
 * @param catalogName a catalog name; must match the catalog name as it is stored in the database; "" retrievesthose without a catalog; null means that the catalog name should not be used to narrow the search
 * @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; ""retrieves those without a schema; null means that the schema name should not be used to narrow the search
 * @param tablePattern table name patterns separated by a comma; must match the table name as it is stored in thedatabase
 * @return the tables with for the given catalog, schemas, table name pattern.
 * @throws SQLException
 */
public List<T> getColumnSets(String catalogName,String schemaPattern,String tablePattern) throws SQLException {
  if (debug)   incrementCount(catalogName,schemaPattern);
  List<T> tables=new ArrayList<T>();
  if (tablePattern == null) {
    addMatchingColumnSets(catalogName,schemaPattern,tablePattern,tables);
  }
 else {
    String[] patterns=tablePattern.split("String_Node_Str");
    for (    String pattern : patterns) {
      addMatchingColumnSets(catalogName,schemaPattern,pattern,tables);
    }
  }
  return tables;
}

Fixed version (ground truth):
/** 
 * Method "getColumnSets" returns tables or views. MOD xqliu 2009-04-27 bug 6507
 * @param catalogName a catalog name; must match the catalog name as it is stored in the database; "" retrievesthose without a catalog; null means that the catalog name should not be used to narrow the search
 * @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; ""retrieves those without a schema; null means that the schema name should not be used to narrow the search
 * @param tablePattern table name patterns separated by a comma; must match the table name as it is stored in thedatabase
 * @return the tables with for the given catalog, schemas, table name pattern.
 * @throws SQLException
 */
public List<T> getColumnSets(String catalogName,String schemaPattern,String tablePattern) throws SQLException {
  if (debug)   incrementCount(catalogName,schemaPattern);
  List<T> tables=new ArrayList<T>();
  if (tablePattern == null) {
    addMatchingColumnSets(catalogName,schemaPattern,tablePattern,tables);
  }
 else {
    String[] patterns=cleanPatterns(tablePattern.split("String_Node_Str"));
    for (    String pattern : patterns) {
      addMatchingColumnSets(catalogName,schemaPattern,pattern,tables);
    }
  }
  return tables;
}
Program: 139876
Project: 139876
Buggy source:
/** 
 * Method "getColumns". MOD xqliu 2009-04-27 bug 6507
 * @param catalogName a catalog name; must match the catalog name as it is stored in the database; "" retrievesthose without a catalog; null means that the catalog name should not be used to narrow the search
 * @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; ""retrieves those without a schema; null means that the schema name should not be used to narrow the search
 * @param tablePattern a table name pattern; must match the table name as it is stored in the database
 * @param columnPattern a column name pattern; must match the column name as it is stored in the database
 * @throws SQLException
 * @see DatabaseMetaData#getColumns(String,String,String,String)
 */
public List<TdColumn> getColumns(String catalogName,String schemaPattern,String tablePattern,String columnPattern) throws SQLException {
  List<TdColumn> tableColumns=new ArrayList<TdColumn>();
  ResultSet columns=getConnectionMetadata(connection).getColumns(catalogName,schemaPattern,tablePattern,columnPattern);
  int size=0;
  TdColumn column=null;
  while (columns.next()) {
    column=initColumn(columns);
    tableColumns.add(column);
    size++;
    if (size > TaggedValueHelper.COLUMN_MAX) {
      tableColumns.clear();
      column.setName(TaggedValueHelper.TABLE_VIEW_COLUMN_OVER_FLAG);
      tableColumns.add(column);
      break;
    }
  }
  columns.close();
  return tableColumns;
}

Fixed version (ground truth):
/** 
 * Method "getColumns". MOD xqliu 2009-04-27 bug 6507
 * @param catalogName a catalog name; must match the catalog name as it is stored in the database; "" retrievesthose without a catalog; null means that the catalog name should not be used to narrow the search
 * @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; ""retrieves those without a schema; null means that the schema name should not be used to narrow the search
 * @param tablePattern a table name pattern; must match the table name as it is stored in the database
 * @param columnPattern a column name pattern; must match the column name as it is stored in the database
 * @throws SQLException
 * @see DatabaseMetaData#getColumns(String,String,String,String)
 */
public List<TdColumn> getColumns(String catalogName,String schemaPattern,String tablePattern,String columnPattern) throws SQLException {
  List<TdColumn> tableColumns=new ArrayList<TdColumn>();
  if (debug)   incrementCount(catalogName,schemaPattern,tablePattern);
  if (columnPattern == null) {
    addMatchingColumns(catalogName,schemaPattern,tablePattern,columnPattern,tableColumns);
  }
 else {
    String[] patterns=cleanPatterns(columnPattern.split("String_Node_Str"));
    for (    String pattern : patterns) {
      addMatchingColumns(catalogName,schemaPattern,tablePattern,pattern,tableColumns);
    }
  }
  return tableColumns;
}
Program: 139877
Project: 139877
Buggy source:
public ModelElement initCWMResourceBuilder(){
  DataProviderBuilder dpBuilder=new DataProviderBuilder();
  if (driverPathes != null) {
    LinkedList<String> jars=new LinkedList<String>();
    for (    String driverpath : driverPathes.split("String_Node_Str")) {
      jars.add(driverpath);
    }
    String name=connectionParam.getJdbcUrl().substring(0,12);
    driver=dpBuilder.buildDriverForSQLExploer(name,connectionParam.getDriverClassName(),connectionParam.getJdbcUrl(),jars);
  }
  ReturnCode rc=dpBuilder.initializeDataProvider(connectionParam);
  if (rc.isOk()) {
    return dpBuilder.getDataProvider();
  }
 else {
    MessageDialog.openInformation(getShell(),DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str") + rc.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public ModelElement initCWMResourceBuilder(){
  DataProviderBuilder dpBuilder=new DataProviderBuilder();
  String driverPath=connectionParam.getDriverPath();
  if (driverPath != null) {
    LinkedList<String> jars=new LinkedList<String>();
    for (    String driverpath : driverPath.split("String_Node_Str")) {
      jars.add(driverpath);
    }
    String name=connectionParam.getJdbcUrl().substring(0,12);
    driver=dpBuilder.buildDriverForSQLExploer(name,connectionParam.getDriverClassName(),connectionParam.getJdbcUrl(),jars);
  }
  ReturnCode rc=dpBuilder.initializeDataProvider(connectionParam);
  if (rc.isOk()) {
    return dpBuilder.getDataProvider();
  }
 else {
    MessageDialog.openInformation(getShell(),DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str") + rc.getMessage());
  }
  return null;
}
Program: 139878
Project: 139878
Buggy source:
/** 
 * Constructor for DatabaseWizard. Analyse Iselection to extract DatabaseConnection and the pathToSave. Start the Lock Strategy.
 * @param selection
 * @param existingNames
 */
public DatabaseConnectionWizard(DBConnectionParameter connectionParam){
  this.connectionParam=connectionParam;
  this.driverPathes=connectionParam.getDriverPath();
}

Fixed version (ground truth):
/** 
 * Constructor for DatabaseWizard. Analyse Iselection to extract DatabaseConnection and the pathToSave. Start the Lock Strategy.
 * @param selection
 * @param existingNames
 */
public DatabaseConnectionWizard(DBConnectionParameter connectionParam){
  this.connectionParam=connectionParam;
}
Program: 139881
Project: 139881
Buggy source:
@Override public void mouseDown(MouseEvent e){
  deleteIndicatorItems((TableIndicator)treeItem.getData(TABLE_INDICATOR_KEY),unit);
  if (indicatorItem.getParentItem() != null && indicatorItem.getParentItem().getData(INDICATOR_UNIT_KEY) != null) {
    setElements(tableIndicators);
  }
 else {
    removeItemBranch(indicatorItem);
  }
}

Fixed version (ground truth):
@Override public void mouseDown(MouseEvent e){
  deleteIndicatorItems((TableIndicator)treeItem.getData(TABLE_INDICATOR_KEY),unit);
  if (indicatorItem.getParentItem() != null && indicatorItem.getParentItem().getData(INDICATOR_UNIT_KEY) != null) {
    setElements(tableIndicators);
  }
 else {
    removeItemBranch(indicatorItem);
    indicatorTreeItemMap.remove(unit);
  }
}
Program: 139883
Project: 139883
Buggy source:
@Override public boolean canDrop(Object data,List<IFile> files){
  if (data != null && files.size() > 0 && data instanceof TableIndicator) {
    TableIndicator ti=(TableIndicator)data;
    TableIndicatorUnit[] tius=ti.getIndicatorUnits();
    if (tius != null) {
      int i=0, j=0;
      for (      TableIndicatorUnit tiu : tius) {
        i++;
        j=0;
        String name=tiu.getIndicator().getIndicatorDefinition().getName();
        for (        IFile file : files) {
          j++;
          if (DQRuleResourceFileHelper.getInstance().findWhereRule(file).getName().equals(name)) {
            return false;
          }
        }
      }
    }
    System.out.println("String_Node_Str");
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean canDrop(Object data,List<IFile> files){
  if (data != null && files.size() > 0 && data instanceof TableIndicator) {
    TableIndicator ti=(TableIndicator)data;
    TableIndicatorUnit[] tius=ti.getIndicatorUnits();
    if (tius != null) {
      int i=0, j=0;
      for (      TableIndicatorUnit tiu : tius) {
        i++;
        j=0;
        String name=tiu.getIndicator().getIndicatorDefinition().getName();
        for (        IFile file : files) {
          j++;
          if (DQRuleResourceFileHelper.getInstance().findWhereRule(file).getName().equals(name)) {
            return false;
          }
        }
      }
    }
    return true;
  }
  return false;
}
Program: 139884
Project: 139884
Buggy source:
private void removeSelectedElements(Tree newTree){
  TreeItem[] selection=newTree.getSelection();
  if (isRowCountIndicator(selection)) {
    return;
  }
  boolean branchIndicatorExist=false;
  for (  TreeItem item : selection) {
    TableIndicatorUnit indicatorUnit=(TableIndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
    if (indicatorUnit != null) {
      deleteIndicatorItems((TableIndicator)item.getData(TABLE_INDICATOR_KEY),indicatorUnit);
    }
 else {
      deleteTableItems((TableIndicator)item.getData(TABLE_INDICATOR_KEY));
    }
    if (item.getParentItem() != null && item.getParentItem().getData(INDICATOR_UNIT_KEY) != null) {
      branchIndicatorExist=true;
      continue;
    }
 else {
      removeItemBranch(item);
    }
  }
  if (branchIndicatorExist) {
    setElements(tableIndicators);
  }
}

Fixed version (ground truth):
private void removeSelectedElements(Tree newTree){
  TreeItem[] selection=newTree.getSelection();
  if (isRowCountIndicator(selection)) {
    return;
  }
  boolean branchIndicatorExist=false;
  for (  TreeItem item : selection) {
    TableIndicatorUnit indicatorUnit=(TableIndicatorUnit)item.getData(INDICATOR_UNIT_KEY);
    if (indicatorUnit != null) {
      deleteIndicatorItems((TableIndicator)item.getData(TABLE_INDICATOR_KEY),indicatorUnit);
    }
 else {
      deleteTableItems((TableIndicator)item.getData(TABLE_INDICATOR_KEY));
    }
    if (item.getParentItem() != null && item.getParentItem().getData(INDICATOR_UNIT_KEY) != null) {
      branchIndicatorExist=true;
      continue;
    }
 else {
      removeItemBranch(item);
      removeTreeItem(item);
    }
  }
  if (branchIndicatorExist) {
    setElements(tableIndicators);
  }
}
Program: 139885
Project: 139885
Buggy source:
private void deleteIndicatorItems(TableIndicator tableIndicator,TableIndicatorUnit inidicatorUnit){
  tableIndicator.removeIndicatorUnit(inidicatorUnit);
}

Fixed version (ground truth):
private void deleteIndicatorItems(TableIndicator tableIndicator,TableIndicatorUnit inidicatorUnit){
  tableIndicator.removeIndicatorUnit(inidicatorUnit);
  this.indicatorTreeItemMap.remove(inidicatorUnit);
}
Program: 139886
Project: 139886
Buggy source:
private void removeItemBranch(TreeItem item){
  TreeEditor[] editors=(TreeEditor[])item.getData(ITEM_EDITOR_KEY);
  if (editors != null) {
    for (int j=0; j < editors.length; j++) {
      editors[j].getEditor().dispose();
      editors[j].dispose();
    }
  }
  if (item.getItemCount() == 0) {
    item.dispose();
    this.setDirty(true);
    return;
  }
  TreeItem[] items=item.getItems();
  for (int i=0; i < items.length; i++) {
    removeItemBranch(items[i]);
  }
  item.dispose();
  this.setDirty(true);
}

Fixed version (ground truth):
private void removeItemBranch(TreeItem item){
  TreeEditor[] editors=(TreeEditor[])item.getData(ITEM_EDITOR_KEY);
  if (editors != null) {
    for (int j=0; j < editors.length; j++) {
      editors[j].getEditor().dispose();
      editors[j].dispose();
    }
  }
  if (item.getItemCount() == 0) {
    item.dispose();
    this.setDirty(true);
    return;
  }
  TreeItem[] items=item.getItems();
  for (int i=0; i < items.length; i++) {
    removeItemBranch(items[i]);
    removeTreeItem(items[i]);
  }
  item.dispose();
  this.setDirty(true);
}
Program: 139887
Project: 139887
Buggy source:
public Composite[] getPreviewChartCompsites(){
  if (!previewChartList.isEmpty()) {
    this.previewChartCompsites=previewChartList.toArray(new Composite[previewChartList.size()]);
  }
  return previewChartCompsites;
}

Fixed version (ground truth):
public Composite[] getPreviewChartCompsites(){
  if (previewChartList != null && !previewChartList.isEmpty()) {
    this.previewChartCompsites=previewChartList.toArray(new Composite[previewChartList.size()]);
  }
  return previewChartCompsites;
}
Program: 139888
Project: 139888
Buggy source:
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    double value=Double.parseDouble(unit.getValue().toString());
    String label=unit.getIndicatorName();
    customerdataset.addValue(value,label,"String_Node_Str");
    ChartDataEntity entity=new ChartDataEntity();
    entity.setIndicator(unit.getIndicator());
    entity.setLabel(label);
    entity.setValue(String.valueOf(value));
    entity.setPercent(String.valueOf(value / unit.getIndicator().getCount()));
    customerdataset.addDataEntity(entity);
  }
  return customerdataset;
}

Fixed version (ground truth):
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    final Object unitValue=unit.getValue();
    double value=unitValue != null ? Double.parseDouble(unitValue.toString()) : Double.NaN;
    String label=unit.getIndicatorName();
    customerdataset.addValue(value,label,"String_Node_Str");
    ChartDataEntity entity=new ChartDataEntity();
    entity.setIndicator(unit.getIndicator());
    entity.setLabel(label);
    entity.setValue(String.valueOf(value));
    entity.setPercent(String.valueOf(value / unit.getIndicator().getCount()));
    customerdataset.addDataEntity(entity);
  }
  return customerdataset;
}
Program: 139889
Project: 139889
Buggy source:
public static void getIndicatorValue(TableIndicatorUnit indicatorUnit){
  Object tempObject=null;
  IndicatorEnum type=indicatorUnit.getType();
  Indicator indicator=indicatorUnit.getIndicator();
  if (indicatorUnit.isExcuted()) {
switch (type) {
case RowCountIndicatorEnum:
      tempObject=((RowCountIndicator)indicator).getCount();
    break;
case WhereRuleIndicatorEnum:
  tempObject=((WhereRuleIndicator)indicator).getCount();
default :
}
indicatorUnit.setValue(tempObject);
}
}

Fixed version (ground truth):
public static void getIndicatorValue(TableIndicatorUnit indicatorUnit){
  Object tempObject=null;
  IndicatorEnum type=indicatorUnit.getType();
  Indicator indicator=indicatorUnit.getIndicator();
  if (indicatorUnit.isExcuted()) {
switch (type) {
case RowCountIndicatorEnum:
      tempObject=((RowCountIndicator)indicator).getCount();
    break;
case WhereRuleIndicatorEnum:
  tempObject=((WhereRuleIndicator)indicator).getUserCount();
default :
}
indicatorUnit.setValue(tempObject);
}
}
Program: 139890
Project: 139890
Buggy source:
public TypedReturnCode<IFile> createAndSaveCWMFile(ModelElement cwmElement){
  WhereRule whereRule=(WhereRule)cwmElement;
  TaggedValueHelper.setValidStatus(true,whereRule);
  whereRule.setWhereExpression(parameter.getWhereClause());
  whereRule.setCriticalityLevel(CRITICALITY_LEVEL_DEFAULT);
  whereRule.getSqlGenericExpression().add(getExpression());
  IFolder folder=parameter.getFolderProvider().getFolderResource();
  return DqRuleWriter.getInstance().createDqRuleFile(whereRule,folder);
}

Fixed version (ground truth):
public TypedReturnCode<IFile> createAndSaveCWMFile(ModelElement cwmElement){
  WhereRule whereRule=(WhereRule)cwmElement;
  TaggedValueHelper.setValidStatus(true,whereRule);
  whereRule.setWhereExpression(parameter.getWhereClause());
  whereRule.setCriticalityLevel(CRITICALITY_LEVEL_DEFAULT);
  whereRule.getSqlGenericExpression().add(getExpression());
  IndicatorCategory ruleIndicatorCategory=DefinitionHandler.getInstance().getDQRuleIndicatorCategory();
  if (ruleIndicatorCategory != null && !whereRule.getCategories().contains(ruleIndicatorCategory)) {
    whereRule.getCategories().add(ruleIndicatorCategory);
  }
  IFolder folder=parameter.getFolderProvider().getFolderResource();
  return DqRuleWriter.getInstance().createDqRuleFile(whereRule,folder);
}
Program: 139892
Project: 139892
Buggy source:
@Override public void mouseDoubleClick(MouseEvent e){
  TreeItem[] selection=tree.getSelection();
  if (selection.length == 0) {
    return;
  }
  TreeItem item=selection[0];
  if (item != null) {
    Object indicatorobj=item.getData(INDICATOR_UNIT_KEY);
    Object columnobj=item.getData(COLUMN_INDICATOR_KEY);
    if (columnobj != null && indicatorobj == null) {
      openIndicatorSelectDialog(null);
    }
 else     if (columnobj != null && indicatorobj != null) {
      openIndicatorOptionDialog(null,item);
    }
  }
}

Fixed version (ground truth):
@Override public void mouseDoubleClick(MouseEvent e){
  TreeItem[] treeSelection=tree.getSelection();
  if (treeSelection.length > 0) {
    TreeItem item=treeSelection[0];
    Object indicatorobj=item.getData(INDICATOR_UNIT_KEY);
    Object columnobj=item.getData(COLUMN_INDICATOR_KEY);
    if (columnobj != null && indicatorobj == null) {
      openIndicatorSelectDialog(null);
    }
 else     if (columnobj != null && indicatorobj != null) {
      openIndicatorOptionDialog(null,item);
    }
  }
}
Program: 139894
Project: 139894
Buggy source:
@Override public void mouseDoubleClick(MouseEvent e){
  TreeItem item=tree.getSelection()[0];
  if (item != null) {
    Object indicatorobj=item.getData(INDICATOR_UNIT_KEY);
    Object tableobj=item.getData(TABLE_INDICATOR_KEY);
    if (tableobj != null && indicatorobj == null) {
      showAddDQRuleDialog(item,(TableIndicator)tableobj);
    }
 else     if (tableobj != null && indicatorobj != null) {
      openIndicatorOptionDialog(null,item);
    }
  }
}

Fixed version (ground truth):
@Override public void mouseDoubleClick(MouseEvent e){
  TreeItem[] treeSelection=tree.getSelection();
  if (treeSelection.length > 0) {
    TreeItem item=treeSelection[0];
    Object indicatorobj=item.getData(INDICATOR_UNIT_KEY);
    Object tableobj=item.getData(TABLE_INDICATOR_KEY);
    if (tableobj != null && indicatorobj == null) {
      showAddDQRuleDialog(item,(TableIndicator)tableobj);
    }
 else     if (tableobj != null && indicatorobj != null) {
      openIndicatorOptionDialog(null,item);
    }
  }
}
Program: 139896
Project: 139896
Buggy source:
@Override protected Object[] createItemArray(XYZDataset dset,int series,int item){
  final Comparable<?> seriesKey=dset.getSeriesKey(series);
  final String seriesK=String.valueOf(seriesKey);
  final ValueAggregator valueAggregator=createXYZDatasets.get(seriesKey);
  String label=valueAggregator.getLabels(seriesK).get(item);
  final Object[] itemArray=super.createItemArray(dset,series,item);
  itemArray[0]=label;
  return itemArray;
}

Fixed version (ground truth):
@Override protected Object[] createItemArray(XYZDataset dset,int series,int item){
  final Comparable<?> seriesKey=dset.getSeriesKey(series);
  final String seriesK=String.valueOf(seriesKey);
  final ValueAggregator valueAggregator=createXYZDatasets.get(seriesKey);
  String label=valueAggregator.getLabels(seriesK).get(item);
  final Object[] itemArray=super.createItemArray(dset,series,item);
  itemArray[0]=label;
  itemArray[1]="String_Node_Str" + itemArray[1];
  itemArray[2]="String_Node_Str" + itemArray[2];
  itemArray[3]="String_Node_Str" + itemArray[3];
  return itemArray;
}
Program: 139897
Project: 139897
Buggy source:
/** 
 * DOC scorreia Comment method "addPatternToDomain".
 * @param domain
 * @param tableFilter
 * @param tablePattern
 */
private static void addPatternToDomain(Domain domain,RegularExpression tableFilter,String tablePattern,PatternType type){
  Pattern pattern=createPattern(tablePattern);
  pattern.setName(type.label);
  pattern.getComponents().add(tableFilter);
  domain.getPatterns().add(pattern);
  if (PatternType.EXPECTED_VALUE.compareTo(type) == 0) {
    domain.getOwnedElement().add(pattern);
  }
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "addPatternToDomain".
 * @param domain
 * @param tableFilter
 * @param tablePattern
 */
private static void addPatternToDomain(Domain domain,RegularExpression tableFilter,String tablePattern,PatternType type){
  Pattern pattern=createPattern(tablePattern);
  pattern.setName(type.label);
  pattern.getComponents().add(tableFilter);
  domain.getPatterns().add(pattern);
  domain.getOwnedElement().add(pattern);
}
Program: 139898
Project: 139898
Buggy source:
public static List<TdTable> getTables(Catalog catalog){
  return TableHelper.getTables(catalog.getOwnedElement());
}

Fixed version (ground truth):
public static List<TdTable> getTables(Catalog catalog){
  TaggedValue tv=TaggedValueHelper.getTaggedValue(TaggedValueHelper.TABLE_FILTER,catalog.getTaggedValue());
  String tableFilter=tv == null ? null : tv.getValue();
  return TableHelper.getTables(catalog.getOwnedElement(),tableFilter);
}
Program: 139899
Project: 139899
Buggy source:
public static List<TdView> getViews(Catalog catalog){
  return ViewHelper.getViews(catalog.getOwnedElement());
}

Fixed version (ground truth):
public static List<TdView> getViews(Catalog catalog){
  TaggedValue tv=TaggedValueHelper.getTaggedValue(TaggedValueHelper.VIEW_FILTER,catalog.getTaggedValue());
  String viewFilter=tv == null ? null : tv.getValue();
  return ViewHelper.getViews(catalog.getOwnedElement(),viewFilter);
}
Program: 139900
Project: 139900
Buggy source:
public static List<TdColumn> getColumns(ColumnSet columnSet){
  return ColumnHelper.getColumns(columnSet.getFeature());
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "getColumns". ADD xqliu 2009-04-27 bug 6507
 * @param columnSet
 * @param filter
 * @return
 */
public static List<TdColumn> getColumns(ColumnSet columnSet,boolean filter){
  if (filter) {
    return ColumnHelper.getColumnsWithFilter(columnSet,filter);
  }
 else {
    return getColumns(columnSet);
  }
}
Program: 139901
Project: 139901
Buggy source:
public static List<TdTable> getTables(Schema schema){
  return TableHelper.getTables(schema.getOwnedElement());
}

Fixed version (ground truth):
public static List<TdTable> getTables(Schema schema){
  TaggedValue tv=TaggedValueHelper.getTaggedValue(TaggedValueHelper.TABLE_FILTER,schema.getTaggedValue());
  String tableFilter=tv == null ? null : tv.getValue();
  return TableHelper.getTables(schema.getOwnedElement(),tableFilter);
}
Program: 139902
Project: 139902
Buggy source:
public static List<TdView> getViews(Schema schema){
  return ViewHelper.getViews(schema.getOwnedElement());
}

Fixed version (ground truth):
public static List<TdView> getViews(Schema schema){
  TaggedValue tv=TaggedValueHelper.getTaggedValue(TaggedValueHelper.VIEW_FILTER,schema.getTaggedValue());
  String viewFilter=tv == null ? null : tv.getValue();
  return ViewHelper.getViews(schema.getOwnedElement(),viewFilter);
}
Program: 139903
Project: 139903
Buggy source:
/** 
 * Method "getTables" extracts the tables from the list.
 * @param elements any elements that could contain TdTables
 * @return the list of TdTables found in the given list (never null, but can be empty).
 */
public static List<TdTable> getTables(Collection<? extends EObject> elements){
  List<TdTable> tables=new ArrayList<TdTable>();
  for (  EObject elt : elements) {
    TdTable table=SwitchHelpers.TABLE_SWITCH.doSwitch(elt);
    if (table != null) {
      tables.add(table);
    }
  }
  return tables;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "getTables". ADD xqliu 2009-04-27 bug 6507
 * @param elements
 * @param tableFilter
 * @return
 */
public static List<TdTable> getTables(Collection<? extends EObject> elements,String tableFilter){
  List<TdTable> tables=new ArrayList<TdTable>();
  boolean filter=(tableFilter == null || "String_Node_Str".equals(tableFilter)) ? false : true;
  for (  EObject elt : elements) {
    TdTable table=SwitchHelpers.TABLE_SWITCH.doSwitch(elt);
    if (table != null) {
      if (filter) {
        if (table.getName().toLowerCase().indexOf(tableFilter.toLowerCase()) > -1) {
          tables.add(table);
        }
      }
 else {
        tables.add(table);
      }
    }
  }
  return tables;
}
Program: 139904
Project: 139904
Buggy source:
/** 
 * Method "getViews" extracts the views from the list.
 * @param elements any elements that could contain TdView
 * @return the list of TdView found in the given list (never null, but can be empty).
 */
public static List<TdView> getViews(Collection<? extends EObject> elements){
  List<TdView> views=new ArrayList<TdView>();
  for (  EObject elt : elements) {
    TdView table=SwitchHelpers.VIEW_SWITCH.doSwitch(elt);
    if (table != null) {
      views.add(table);
    }
  }
  return views;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "getViews". ADD xqliu 2009-04-27 bug 6507
 * @param elements
 * @param viewFilter
 * @return
 */
public static List<TdView> getViews(Collection<? extends EObject> elements,String viewFilter){
  List<TdView> views=new ArrayList<TdView>();
  boolean filter=(viewFilter == null || "String_Node_Str".equals(viewFilter)) ? false : true;
  for (  EObject elt : elements) {
    TdView view=SwitchHelpers.VIEW_SWITCH.doSwitch(elt);
    if (view != null) {
      if (filter) {
        if (view.getName().toLowerCase().indexOf(viewFilter.toLowerCase()) > -1) {
          views.add(view);
        }
      }
 else {
        views.add(view);
      }
    }
  }
  return views;
}
Program: 139905
Project: 139905
Buggy source:
/** 
 * Method "getColumnSets" returns tables or views.
 * @param catalogName a catalog name; must match the catalog name as it is stored in the database; "" retrievesthose without a catalog; null means that the catalog name should not be used to narrow the search
 * @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; ""retrieves those without a schema; null means that the schema name should not be used to narrow the search
 * @param tablePattern a table name pattern; must match the table name as it is stored in the database
 * @return the tables with for the given catalog, schemas, table name pattern.
 * @throws SQLException
 */
public List<T> getColumnSets(String catalogName,String schemaPattern,String tablePattern) throws SQLException {
  List<T> tables=new ArrayList<T>();
  ResultSet tablesSet=getConnectionMetadata(connection).getTables(catalogName,schemaPattern,tablePattern,this.tableType);
  while (tablesSet.next()) {
    T table=createTable(catalogName,schemaPattern,tablesSet);
    tables.add(table);
  }
  tablesSet.close();
  return tables;
}

Fixed version (ground truth):
/** 
 * Method "getColumnSets" returns tables or views. MOD xqliu 2009-04-27 bug 6507
 * @param catalogName a catalog name; must match the catalog name as it is stored in the database; "" retrievesthose without a catalog; null means that the catalog name should not be used to narrow the search
 * @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; ""retrieves those without a schema; null means that the schema name should not be used to narrow the search
 * @param tablePattern a table name pattern; must match the table name as it is stored in the database
 * @return the tables with for the given catalog, schemas, table name pattern.
 * @throws SQLException
 */
public List<T> getColumnSets(String catalogName,String schemaPattern,String tablePattern) throws SQLException {
  List<T> tables=new ArrayList<T>();
  ResultSet tablesSet=getConnectionMetadata(connection).getTables(catalogName,schemaPattern,null,this.tableType);
  boolean filter=(tablePattern == null || "String_Node_Str".equals(tablePattern)) ? false : true;
  int size=0;
  while (tablesSet.next()) {
    if (filter) {
      String tableName=tablesSet.getString(GetTable.TABLE_NAME.name()).toLowerCase();
      tablePattern=tablePattern.toLowerCase();
      if (tableName.indexOf(tablePattern) > -1) {
        T table=createTable(catalogName,schemaPattern,tablesSet);
        tables.add(table);
        size++;
      }
    }
 else {
      T table=createTable(catalogName,schemaPattern,tablesSet);
      tables.add(table);
      size++;
    }
    if (size > TaggedValueHelper.TABLE_VIEW_MAX) {
      tables.clear();
      T table=createTable();
      table.setName(TaggedValueHelper.TABLE_VIEW_COLUMN_OVER_FLAG);
      tables.add(table);
      break;
    }
  }
  tablesSet.close();
  return tables;
}
Program: 139906
Project: 139906
Buggy source:
@Override public boolean performFinish(){
  if (StringUtils.equals(numberTxt.getText(),String.valueOf(parameters.getTopN()))) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  if (!StringUtils.equals(numberTxt.getText(),String.valueOf(parameters.getTopN()))) {
    return false;
  }
  return true;
}
Program: 139907
Project: 139907
Buggy source:
@Override public String getTopNQuery(String query,int n){
  return super.getTopNQuery(query,n);
}

Fixed version (ground truth):
@Override public String getTopNQuery(String query,int n){
  Matcher m=selectPattern.matcher(query);
  return m.replaceFirst("String_Node_Str" + n + "String_Node_Str");
}
Program: 139919
Project: 139919
Buggy source:
private void addMenuOnGantChart(ChartEntity chartEntity,Menu menu){
  CategoryItemEntity itemEntity=(CategoryItemEntity)chartEntity;
  String seriesK=itemEntity.getRowKey().toString();
  String seriesLabel=itemEntity.getColumnKey().toString();
  EList<Column> nominalList=indicator.getNominalColumns();
  final String sql=MultiColumnSetValueExplorer.getInstance().getQueryStirng(column,analysis,nominalList,seriesK,seriesLabel);
  MenuItem item=new MenuItem(menu,SWT.PUSH);
  item.setText("String_Node_Str");
  item.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          TdDataProvider tdDataProvider=SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(analysis.getContext().getConnection());
          String query=sql;
          String editorName=ColumnHelper.getColumnSetOwner(column).getName();
          CorePlugin.getDefault().runInDQViewer(tdDataProvider,query,editorName);
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
private void addMenuOnGantChart(ChartEntity chartEntity,Menu menu){
  if (chartEntity instanceof CategoryItemEntity) {
    CategoryItemEntity itemEntity=(CategoryItemEntity)chartEntity;
    String seriesK=itemEntity.getRowKey().toString();
    String seriesLabel=itemEntity.getColumnKey().toString();
    EList<Column> nominalList=indicator.getNominalColumns();
    final String sql=MultiColumnSetValueExplorer.getInstance().getQueryStirng(column,analysis,nominalList,seriesK,seriesLabel);
    MenuItem item=new MenuItem(menu,SWT.PUSH);
    item.setText("String_Node_Str");
    item.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        Display.getDefault().asyncExec(new Runnable(){
          public void run(){
            TdDataProvider tdDataProvider=SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(analysis.getContext().getConnection());
            String query=sql;
            String editorName=ColumnHelper.getColumnSetOwner(column).getName();
            CorePlugin.getDefault().runInDQViewer(tdDataProvider,query,editorName);
          }
        }
);
      }
    }
);
  }
}
Program: 139921
Project: 139921
Buggy source:
@Override public void dropColumns(List<Column> columns,int index){
  this.columnSetMultiValueList.addAll(index,columns);
  this.addElements(columns,index);
}

Fixed version (ground truth):
@Override public void dropColumns(List<Column> columns,int index){
  this.addElements(columns,index);
}
Program: 139923
Project: 139923
Buggy source:
public void setElements(final List<Column> columns){
  this.tree.dispose();
  this.tree=createTree(this.parentComp);
  tree.setData(this);
  this.columnSetMultiValueList=columns;
  addItemElements(columns,0);
}

Fixed version (ground truth):
public void setElements(final List<Column> columns){
  this.tree.dispose();
  this.tree=createTree(this.parentComp);
  tree.setData(this);
  addItemElements(columns,0);
}
Program: 139925
Project: 139925
Buggy source:
private void showHelp(){
  getShell().setFocus();
  IContext context=HelpSystem.getContext(HelpPlugin.getDefault().getIndicatorHelpContextID());
  IWorkbenchHelpSystem helpSystem=PlatformUI.getWorkbench().getHelpSystem();
  helpSystem.displayHelp(context);
  ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
  if (lastActiveInstance != null) {
    lastActiveInstance.showURL(href);
  }
}

Fixed version (ground truth):
private void showHelp(){
  getShell().setFocus();
  IContext context=HelpSystem.getContext(HelpPlugin.getDefault().getIndicatorHelpContextID());
  IWorkbenchHelpSystem helpSystem=PlatformUI.getWorkbench().getHelpSystem();
  if (href.endsWith(HelpPlugin.HELP_FILE_SUFFIX)) {
    helpSystem.displayHelp(context);
    ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
    if (lastActiveInstance != null) {
      lastActiveInstance.showURL(href);
    }
  }
}
Program: 139926
Project: 139926
Buggy source:
public void showHelp(){
  String href=getFormEnum().getHelpHref();
  ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
  if (lastActiveInstance != null) {
    lastActiveInstance.showURL(href);
  }
}

Fixed version (ground truth):
public void showHelp(){
  String href=getFormEnum().getHelpHref();
  ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
  if (lastActiveInstance != null && href.endsWith(HelpPlugin.HELP_FILE_SUFFIX)) {
    lastActiveInstance.showURL(href);
  }
}