nus-yam/ex-repair huggingface dataset:
Program: 137432
Project: 137432
Buggy source:
/** 
 * Returns the connection from the pool, assuming the connection is currently in the pool
 * @param connection
 * @return true if the connection was in the and has been removed
 */
public synchronized boolean releaseFromPool(SQLConnection connection){
  try {
    connection.close();
  }
 catch (  SQLException e) {
    SQLExplorerPlugin.error(e);
  }
  if (unused.remove(connection)) {
    SQLExplorerPlugin.getDefault().getAliasManager().modelChanged();
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns the connection from the pool, assuming the connection is currently in the pool
 * @param connection
 * @return true if the connection was in the and has been removed
 */
public synchronized boolean releaseFromPool(SQLConnection connection){
  try {
    closeConnection(connection);
  }
 catch (  SQLException e) {
    SQLExplorerPlugin.error(e);
  }
  if (unused.remove(connection)) {
    SQLExplorerPlugin.getDefault().getAliasManager().modelChanged();
    return true;
  }
  return false;
}
Program: 137434
Project: 137434
Buggy source:
private TdTable createTdTable(){
  Connection conn=ConnectionFactory.eINSTANCE.createConnection();
  Catalog catalog=CatalogHelper.createCatalog("String_Node_Str");
  ConnectionHelper.addCatalog(catalog,conn);
  List<TdTable> tables=new ArrayList<TdTable>();
  TdTable tdTable=RelationalFactory.eINSTANCE.createTdTable();
  tdTable.setName("String_Node_Str");
  tables.add(tdTable);
  CatalogHelper.addTables(tables,catalog);
  return tdTable;
}

Fixed version (ground truth):
private TdTable createTdTable(){
  Connection conn=ConnectionFactory.eINSTANCE.createDatabaseConnection();
  Catalog catalog=CatalogHelper.createCatalog("String_Node_Str");
  ConnectionHelper.addCatalog(catalog,conn);
  List<TdTable> tables=new ArrayList<TdTable>();
  TdTable tdTable=RelationalFactory.eINSTANCE.createTdTable();
  tdTable.setName("String_Node_Str");
  tables.add(tdTable);
  CatalogHelper.addTables(tables,catalog);
  return tdTable;
}
Program: 137435
Project: 137435
Buggy source:
/** 
 * get Internationalization Label of indicatorDefinition
 * @param originalName
 * @return
 */
public static String getDefinitionInternationalizationLabel(Property property){
  if (property == null) {
    return StringUtils.EMPTY;
  }
  String originalName=property.getLabel();
  return getDefinitionInternationalizationLabel(originalName);
}

Fixed version (ground truth):
/** 
 * get Internationalization Label of SystemIndicatorDefinition
 * @param property the property of indicatorDefinition
 * @return if property is null or label of property is null we will return EMPTY string else will returninternationalization string
 */
public static String getDefinitionInternationalizationLabel(Property property){
  if (property == null) {
    return StringUtils.EMPTY;
  }
  String originalName=property.getLabel();
  return getDefinitionInternationalizationLabel(originalName);
}
Program: 137436
Project: 137436
Buggy source:
/** 
 * get Internationalization Label of indicatorDefinition
 * @param originalName the value of parameter should be lable of property
 * @return
 */
public static String getCategoryInternationalizationLabel(String originalName){
  String getInternationalizationLabel=originalName == null ? StringUtils.EMPTY : Messages.getString(originalName.replace(PluginConstant.SPACE_STRING,PluginConstant.UNDER_LINE));
  return getInternationalizationLabel;
}

Fixed version (ground truth):
/** 
 * get Internationalization Label of Category. We must do a replace operation is because of we can only get "Advanced Statistics" from frequency indicatorDefinition but we can not use it to do a interational key.So we replace it from "Advanced Statistics" to "Advanced_Statistics" then do international operation. It will be used on Category of User Definition Indicator and presistence report file by now.
 * @param originalName the value of parameter should be lable of category(for"Bin_Low_Frequency_Table_0.1.definition" indicatorDefinition it should be "Advanced Statistics")
 * @return if originalName is null we will return EMPTY string else will return internationalization string
 */
public static String getCategoryInternationalizationLabel(String originalName){
  return getInternationalizationLabel(originalName.replace(PluginConstant.SPACE_STRING,PluginConstant.UNDER_LINE));
}
Program: 137438
Project: 137438
Buggy source:
/** 
 * return List for ModelMatcher which Score more than 1.
 */
public List<Object> getRealModelMatcherList();

Fixed version (ground truth):
/** 
 * return List for ModelMatcher which Score more than 1.
 * @deprecated use {@link #getResult()} instead
 */
@Deprecated public List<Object> getRealModelMatcherList();
Program: 137439
Project: 137439
Buggy source:
public List<ModelMatcher> getModelMatcherList(){
  return dateRetriever.getModelMatchers();
}

Fixed version (ground truth):
@Override public List<ModelMatcher> getModelMatcherList(){
  return dateRetriever.getModelMatchers();
}
Program: 137440
Project: 137440
Buggy source:
public String getModel(Object matcher){
  if (matcher instanceof ModelMatcher) {
    return ((ModelMatcher)matcher).getModel();
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public String getModel(Object matcher){
  if (matcher instanceof ModelMatcher) {
    return ((ModelMatcher)matcher).getModel();
  }
 else {
    return null;
  }
}
Program: 137441
Project: 137441
Buggy source:
/** 
 * DOC zshen Comment method "getRegex".
 * @param model the model of matcher.
 * @return if can find corresponding to matcher return it's the Regex of matcher else return null;
 */
public String getRegex(String model){
  return this.dateRetriever.getRegex(model);
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "getRegex".
 * @param model the model of matcher.
 * @return if can find corresponding to matcher return it's the Regex of matcher else return null;
 */
@Override public String getRegex(String model){
  return this.dateRetriever.getRegex(model);
}
Program: 137442
Project: 137442
Buggy source:
/** 
 * return List for ModelMatcher which Score more than 1.
 */
public List<Object> getRealModelMatcherList(){
  List<Object> realModelMatcherList=new ArrayList<Object>();
  for (  ModelMatcher matcher : dateRetriever.getModelMatchers()) {
    if (matcher.getScore() > 0) {
      realModelMatcherList.add(matcher);
    }
  }
  return realModelMatcherList;
}

Fixed version (ground truth):
/** 
 * return List for ModelMatcher which Score more than 1.
 * @deprecated use {@link #getResult()} instead
 */
@Deprecated @Override public List<Object> getRealModelMatcherList(){
  List<Object> realModelMatcherList=new ArrayList<Object>();
  for (  ModelMatcher matcher : dateRetriever.getModelMatchers()) {
    if (matcher.getScore() > 0) {
      realModelMatcherList.add(matcher);
    }
  }
  return realModelMatcherList;
}
Program: 137443
Project: 137443
Buggy source:
public int getScore(Object matcher){
  if (matcher instanceof ModelMatcher) {
    return ((ModelMatcher)matcher).getScore();
  }
 else {
    return -1;
  }
}

Fixed version (ground truth):
@Override public int getScore(Object matcher){
  if (matcher instanceof ModelMatcher) {
    return ((ModelMatcher)matcher).getScore();
  }
 else {
    return -1;
  }
}
Program: 137445
Project: 137445
Buggy source:
/** 
 * return List for ModelMatcher which Score more than 1.
 */
public List<Object> getRealModelMatcherList();

Fixed version (ground truth):
/** 
 * return List for ModelMatcher which Score more than 1.
 * @deprecated use {@link #getResult()} instead
 */
@Deprecated public List<Object> getRealModelMatcherList();
Program: 137446
Project: 137446
Buggy source:
/** 
 * return List for ModelMatcher which Score more than 1.
 */
@Override public List<Object> getRealModelMatcherList(){
  List<Object> realModelMatcherList=new ArrayList<Object>();
  for (  ModelMatcher matcher : dateRetriever.getModelMatchers()) {
    if (matcher.getScore() > 0) {
      realModelMatcherList.add(matcher);
    }
  }
  return realModelMatcherList;
}

Fixed version (ground truth):
/** 
 * return List for ModelMatcher which Score more than 1.
 * @deprecated use {@link #getResult()} instead
 */
@Deprecated @Override public List<Object> getRealModelMatcherList(){
  List<Object> realModelMatcherList=new ArrayList<Object>();
  for (  ModelMatcher matcher : dateRetriever.getModelMatchers()) {
    if (matcher.getScore() > 0) {
      realModelMatcherList.add(matcher);
    }
  }
  return realModelMatcherList;
}
Program: 137447
Project: 137447
Buggy source:
/** 
 * Establishes a JDBC connection
 * @param user
 * @return
 * @throws ExplorerException
 * @throws SQLException
 */
public SQLConnection getConnection(User user) throws SQLException {
  Properties props=new Properties();
  if (user.getUserName() != null) {
    props.put(Messages.getString("String_Node_Str"),user.getUserName());
  }
  if (user.getPassword() != null) {
    props.put(Messages.getString("String_Node_Str"),user.getPassword());
  }
  if (!isDriverClassLoaded()) {
    try {
      registerSQLDriver();
    }
 catch (    ClassNotFoundException e) {
      throw new SQLException(Messages.getString("String_Node_Str",driverClassName) + "String_Node_Str" + Messages.getString("String_Node_Str"));
    }
  }
  if (!isDriverClassLoaded()) {
    throw new SQLException(Messages.getString("String_Node_Str",driverClassName));
  }
  Connection jdbcConn=null;
  try {
    jdbcConn=jdbcDriver.connect(user.getAlias().getUrl(),props);
  }
 catch (  SQLException e) {
    throw new SQLCannotConnectException(user,e);
  }
  if (jdbcConn == null) {
    throw new SQLCannotConnectException(user);
  }
  return new SQLConnection(user,jdbcConn,this,getDatabaseProduct().describeConnection(jdbcConn));
}

Fixed version (ground truth):
/** 
 * Establishes a JDBC connection
 * @param user
 * @return
 * @throws ExplorerException
 * @throws SQLException
 */
public SQLConnection getConnection(User user) throws SQLException {
  Properties props=new Properties();
  if (user.getUserName() != null) {
    props.put("String_Node_Str",user.getUserName());
  }
  if (user.getPassword() != null) {
    props.put("String_Node_Str",user.getPassword());
  }
  if (!isDriverClassLoaded()) {
    try {
      registerSQLDriver();
    }
 catch (    ClassNotFoundException e) {
      throw new SQLException(Messages.getString("String_Node_Str",driverClassName) + "String_Node_Str" + Messages.getString("String_Node_Str"));
    }
  }
  if (!isDriverClassLoaded()) {
    throw new SQLException(Messages.getString("String_Node_Str",driverClassName));
  }
  Connection jdbcConn=null;
  try {
    jdbcConn=jdbcDriver.connect(user.getAlias().getUrl(),props);
  }
 catch (  SQLException e) {
    throw new SQLCannotConnectException(user,e);
  }
  if (jdbcConn == null) {
    throw new SQLCannotConnectException(user);
  }
  return new SQLConnection(user,jdbcConn,this,getDatabaseProduct().describeConnection(jdbcConn));
}
Program: 137448
Project: 137448
Buggy source:
/** 
 * get Internationalization Label of indicatorDefinition
 * @param originalName
 * @return
 */
public static String getDefinitionInternationalizationLabel(Property property){
  if (property == null) {
    return StringUtils.EMPTY;
  }
  String originalName=property.getLabel();
  return getDefinitionInternationalizationLabel(originalName);
}

Fixed version (ground truth):
/** 
 * get Internationalization Label of SystemIndicatorDefinition
 * @param property the property of indicatorDefinition
 * @return if property is null or label of property is null we will return EMPTY string else will returninternationalization string
 */
public static String getDefinitionInternationalizationLabel(Property property){
  if (property == null) {
    return StringUtils.EMPTY;
  }
  String originalName=property.getLabel();
  return getDefinitionInternationalizationLabel(originalName);
}
Program: 137449
Project: 137449
Buggy source:
/** 
 * get Internationalization Label of indicatorDefinition
 * @param originalName the value of parameter should be lable of property
 * @return
 */
public static String getCategoryInternationalizationLabel(String originalName){
  String getInternationalizationLabel=originalName == null ? StringUtils.EMPTY : Messages.getString(originalName.replace(PluginConstant.SPACE_STRING,PluginConstant.UNDER_LINE));
  return getInternationalizationLabel;
}

Fixed version (ground truth):
/** 
 * get Internationalization Label of Category. We must do a replace operation is because of we can only get "Advanced Statistics" from frequency indicatorDefinition but we can not use it to do a interational key.So we replace it from "Advanced Statistics" to "Advanced_Statistics" then do international operation. It will be used on Category of User Definition Indicator and presistence report file by now.
 * @param originalName the value of parameter should be lable of category(for"Bin_Low_Frequency_Table_0.1.definition" indicatorDefinition it should be "Advanced Statistics")
 * @return if originalName is null we will return EMPTY string else will return internationalization string
 */
public static String getCategoryInternationalizationLabel(String originalName){
  return getInternationalizationLabel(originalName.replace(PluginConstant.SPACE_STRING,PluginConstant.UNDER_LINE));
}
Program: 137450
Project: 137450
Buggy source:
/** 
 * get the RepositoryNode according to the ERepositoryObjectType(the ERepositoryObjectType should not be RECYCLE_BIN, because there doesn't exist a physical folder, so there will return null and log an error message; use getRecycleBinRepNode() to get the RecycleBinNode).
 * @param nodeType the node's ERepositoryObjectType
 * @param open if the DQView is not show, show it or not
 * @return
 */
public static RepositoryNode getRootNode(ERepositoryObjectType nodeType,boolean open){
  FolderItem folderItem=ProxyRepositoryFactory.getInstance().getFolderItem(ProjectManager.getInstance().getCurrentProject(),nodeType,Path.EMPTY);
  RepositoryNode node=null;
  CommonViewer commonViewer=getDQCommonViewer(open);
  if (commonViewer != null) {
    TreeItem[] items=commonViewer.getTree().getItems();
    for (    TreeItem item : items) {
      node=(RepositoryNode)item.getData();
      if (node.isBin()) {
        continue;
      }
      if (folderItem != null) {
        boolean isSysFolder=ENodeType.SYSTEM_FOLDER == node.getType() && FolderType.SYSTEM_FOLDER_LITERAL == folderItem.getType();
        if (isSysFolder) {
          String viewFolderLabel=folderItem.getProperty().getLabel();
          String folderLabel=node.getObject().getProperty().getLabel();
          if (viewFolderLabel.equals(folderLabel)) {
            return node;
          }
        }
      }
    }
  }
  log.error(Messages.getString("String_Node_Str") + nodeType.getLabel());
  return node;
}

Fixed version (ground truth):
/** 
 * get the RepositoryNode according to the ERepositoryObjectType(the ERepositoryObjectType should not be RECYCLE_BIN, because there doesn't exist a physical folder, so there will return null and log an error message; use getRecycleBinRepNode() to get the RecycleBinNode).
 * @param nodeType the node's ERepositoryObjectType
 * @param open if the DQView is not show, show it or not
 * @return
 */
public static RepositoryNode getRootNode(ERepositoryObjectType nodeType,boolean open){
  FolderItem folderItem=ProxyRepositoryFactory.getInstance().getFolderItem(ProjectManager.getInstance().getCurrentProject(),nodeType,Path.EMPTY);
  RepositoryNode node=null;
  CommonViewer commonViewer=getDQCommonViewer(open);
  if (commonViewer != null) {
    TreeItem[] items=commonViewer.getTree().getItems();
    for (    TreeItem item : items) {
      node=(RepositoryNode)item.getData();
      if (node.isBin()) {
        continue;
      }
      if (folderItem != null) {
        boolean isSysFolder=ENodeType.SYSTEM_FOLDER == node.getType() && FolderType.SYSTEM_FOLDER_LITERAL == folderItem.getType();
        if (isSysFolder) {
          String viewFolderLabel=folderItem.getProperty().getLabel();
          String folderLabel=node.getObject().getProperty().getLabel();
          if (viewFolderLabel.equals(folderLabel)) {
            return node;
          }
        }
      }
    }
    log.error(Messages.getString("String_Node_Str") + nodeType.getLabel());
  }
  return node;
}
Program: 137452
Project: 137452
Buggy source:
/** 
 * Sort the selected nodes with special order: - first report type, - then (jrxml, analysis) type, - then (connection, DQ Rule, Pattern) type. - finally : the type which has no dependency,
 */
private void sortNodesBeforePhysicalDelete(){
  List<IRepositoryNode> anaOrJrxml=new ArrayList<IRepositoryNode>();
  List<IRepositoryNode> finalLevel=new ArrayList<IRepositoryNode>();
  List<IRepositoryNode> reportNodes=new ArrayList<IRepositoryNode>();
  for (  IRepositoryNode node : selectedNodes) {
    if (isReport(node)) {
      reportNodes.add(node);
    }
 else     if (isAna(node) || isJrxml(node)) {
      anaOrJrxml.add(node);
    }
 else {
      finalLevel.add(node);
    }
  }
  selectedNodes.clear();
  selectedNodes.addAll(finalLevel);
  selectedNodes.addAll(anaOrJrxml);
  selectedNodes.addAll(reportNodes);
}

Fixed version (ground truth):
/** 
 * Sort the selected nodes with special order: - first report type, - then (jrxml, analysis) type, - then (connection, DQ Rule, Pattern) type. - finally : the type which has no dependency,
 */
private void sortNodesBeforePhysicalDelete(){
  List<IRepositoryNode> reportNodes=new ArrayList<IRepositoryNode>();
  List<IRepositoryNode> anaOrJrxml=new ArrayList<IRepositoryNode>();
  List<IRepositoryNode> files=new ArrayList<IRepositoryNode>();
  List<IRepositoryNode> folders=new ArrayList<IRepositoryNode>();
  for (  IRepositoryNode node : selectedNodes) {
    if (isReport(node)) {
      reportNodes.add(node);
    }
 else     if (isAna(node) || isJrxml(node)) {
      anaOrJrxml.add(node);
    }
 else     if (node.getType() == ENodeType.SIMPLE_FOLDER) {
      folders.add(node);
    }
 else {
      files.add(node);
    }
  }
  selectedNodes.clear();
  selectedNodes.addAll(folders);
  selectedNodes.addAll(files);
  selectedNodes.addAll(anaOrJrxml);
  selectedNodes.addAll(reportNodes);
}
Program: 137453
Project: 137453
Buggy source:
protected boolean isPatternTextEditable(){
  return false;
}

Fixed version (ground truth):
@Override protected boolean isPatternTextEditable(){
  return false;
}
Program: 137454
Project: 137454
Buggy source:
public void updateLineAndOtherCombos(final CCombo combo,TdExpression expression,String oldLanguage){
  if (combo.getText().equals(PatternLanguageType.JAVA.getName())) {
    updateLineForJava(combo);
  }
 else {
    updateLineForExpression(combo,expression,oldLanguage);
  }
  updateOtherCombos(combo);
}

Fixed version (ground truth):
@Override public void updateLineAndOtherCombos(final CCombo combo,TdExpression expression,String oldLanguage){
  if (combo.getText().equals(PatternLanguageType.JAVA.getName())) {
    updateLineForJava(combo);
  }
 else {
    updateLineForExpression(combo,expression,oldLanguage);
  }
  updateOtherCombos(combo);
}
Program: 137455
Project: 137455
Buggy source:
protected void handleSelectExpression(final CCombo combo,final ExpressionEditDialog editDialog){
  super.handleSelectExpression(combo,editDialog);
  if (IndicatorCategoryHelper.isUserDefMatching(category)) {
    tempViewValidRowsExpressionMap.put(combo,editDialog.getTempViewValidRowsExp());
    tempViewInvalidRowsExpressionMap.put(combo,editDialog.getTempViewInvalidRowsExp());
    tempViewValidValuesExpressionMap.put(combo,editDialog.getTempViewValidValuesExp());
    tempViewInvalidValuesExpressionMap.put(combo,editDialog.getTempViewInvalidValuesExp());
  }
 else {
    tempViewRowsExpressionMap.put(combo,editDialog.getTempViewRowsExp());
  }
}

Fixed version (ground truth):
@Override protected void handleSelectExpression(final CCombo combo,final ExpressionEditDialog editDialog){
  super.handleSelectExpression(combo,editDialog);
  if (IndicatorCategoryHelper.isUserDefMatching(category)) {
    tempViewValidRowsExpressionMap.put(combo,editDialog.getTempViewValidRowsExp());
    tempViewInvalidRowsExpressionMap.put(combo,editDialog.getTempViewInvalidRowsExp());
    tempViewValidValuesExpressionMap.put(combo,editDialog.getTempViewValidValuesExp());
    tempViewInvalidValuesExpressionMap.put(combo,editDialog.getTempViewInvalidValuesExp());
  }
 else {
    tempViewRowsExpressionMap.put(combo,editDialog.getTempViewRowsExp());
  }
}
Program: 137456
Project: 137456
Buggy source:
protected void disposeExpressionChild(){
  int languageLength=javaLanguageComp == null ? 0 : javaLanguageComp.getChildren().length;
  int dataBaseLength=dataBaseComp == null ? 0 : dataBaseComp.getChildren().length;
  if (languageLength == 0 && dataBaseLength == 0) {
    addTitleComp(dataBaseComp);
  }
  if (languageLength == 1) {
    Control[] children=javaLanguageComp.getChildren();
    children[0].dispose();
  }
}

Fixed version (ground truth):
@Override protected void disposeExpressionChild(){
  int languageLength=javaLanguageComp == null ? 0 : javaLanguageComp.getChildren().length;
  int dataBaseLength=dataBaseComp == null ? 0 : dataBaseComp.getChildren().length;
  if (languageLength == 0 && dataBaseLength == 0) {
    addTitleComp(dataBaseComp);
  }
  if (languageLength == 1) {
    Control[] children=javaLanguageComp.getChildren();
    children[0].dispose();
  }
}
Program: 137458
Project: 137458
Buggy source:
@Override public void initialize(FormEditor editor){
  super.initialize(editor);
  category=DefinitionHandler.getInstance().getUserDefinedCountIndicatorCategory();
  initTempIndicatorDefinitionParameter(definition);
}

Fixed version (ground truth):
@Override public void initialize(FormEditor editor){
  super.initialize(editor);
  if (definition != null && definition.getCategories().size() > 0) {
    category=definition.getCategories().get(0);
  }
 else {
    category=DefinitionHandler.getInstance().getUserDefinedCountIndicatorCategory();
  }
  initTempIndicatorDefinitionParameter(definition);
}
Program: 137459
Project: 137459
Buggy source:
/** 
 * judge if has connection in recycle bin which depended by DQ analysis.
 */
@Override public List<IRepositoryNode> getDependentConnNodesInRecycleBin(List<IRepositoryNode> firstLevelRecyNodes){
  List<IRepositoryNode> canBeDependedNodes=new ArrayList<IRepositoryNode>();
  for (  IRepositoryNode node : firstLevelRecyNodes) {
    canBeDependedNodes=getCanBeDependedNodes(node);
  }
  return DQDeleteHelper.getCanNotDeletedNodes(canBeDependedNodes,false);
}

Fixed version (ground truth):
/** 
 * judge if has connection in recycle bin which depended by DQ analysis.
 */
@Override public List<IRepositoryNode> getDependentConnNodesInRecycleBin(List<IRepositoryNode> firstLevelRecyNodes){
  List<IRepositoryNode> canBeDependedNodes=new ArrayList<IRepositoryNode>();
  for (  IRepositoryNode node : firstLevelRecyNodes) {
    canBeDependedNodes.addAll(getCanBeDependedNodes(node));
  }
  return DQDeleteHelper.getCanNotDeletedNodes(canBeDependedNodes,false);
}
Program: 137461
Project: 137461
Buggy source:
public String getLabel(){
  String displayLabel=label;
  if (indicatorEnum != null) {
    displayLabel=this.indicatorEnum.getLabel();
  }
  return displayLabel;
}

Fixed version (ground truth):
/** 
 * the label should be a Internationalized string
 */
@Override public String getLabel(){
  String displayLabel=label;
  if (StringUtil.isEmpty(displayLabel) && indicatorEnum != null) {
    displayLabel=this.indicatorEnum.getLabel();
  }
  return displayLabel;
}
Program: 137462
Project: 137462
Buggy source:
/** 
 * the label should be a Internationalized string
 */
@Override public String getLabel(){
  String displayLabel=label;
  if (StringUtil.isEmpty(displayLabel) && indicatorEnum != null) {
    displayLabel=this.indicatorEnum.getLabel();
  }
  return displayLabel;
}

Fixed version (ground truth):
/** 
 * the label should be a Internationalized string
 */
@Override public String getLabel(){
  String displayLabel=label;
  if (StringUtils.isEmpty(displayLabel) && indicatorEnum != null) {
    displayLabel=this.indicatorEnum.getLabel();
  }
  return displayLabel;
}
Program: 137466
Project: 137466
Buggy source:
/** 
 * remove invalid client depenedences before migration.
 */
private void removeInvalidDependency(Property property){
  ModelElement modelElement=PropertyHelper.getModelElement(property);
  if (modelElement != null) {
    EList<Dependency> clientDependencys=modelElement.getSupplierDependency();
    for (    Dependency dependency : clientDependencys) {
      EList<ModelElement> clients=dependency.getClient();
      Iterator<ModelElement> dependencyIterator=clients.iterator();
      while (dependencyIterator.hasNext()) {
        ModelElement client=dependencyIterator.next();
        if (client == null || client.eIsProxy()) {
          dependencyIterator.remove();
        }
      }
    }
    Resource modEResource=modelElement.eResource();
    if (!clientDependencys.isEmpty() && modEResource != null) {
      EMFUtil.saveSingleResource(modEResource);
    }
  }
}

Fixed version (ground truth):
private void removeInvalidDependency(ModelElement modelElement){
  EList<Dependency> clientDependencys=modelElement.getSupplierDependency();
  for (  Dependency dependency : clientDependencys) {
    EList<ModelElement> clients=dependency.getClient();
    Iterator<ModelElement> dependencyIterator=clients.iterator();
    while (dependencyIterator.hasNext()) {
      ModelElement client=dependencyIterator.next();
      if (client == null || client.eIsProxy()) {
        dependencyIterator.remove();
      }
    }
  }
  Resource modEResource=modelElement.eResource();
  if (!clientDependencys.isEmpty() && modEResource != null) {
    EMFUtil.saveSingleResource(modEResource);
  }
}
Program: 137467
Project: 137467
Buggy source:
public boolean isVirtualFolder(){
  return this.getObject() == null;
}

Fixed version (ground truth):
@Override public boolean isVirtualFolder(){
  return this.getObject() == null;
}
Program: 137469
Project: 137469
Buggy source:
private void initializedCatalogRepNode(List<IRepositoryNode> nodes,Package pack){
  if (pack instanceof Catalog) {
    MetadataCatalogRepositoryObject metadataCatalog=new MetadataCatalogRepositoryObject(getObject(),(Catalog)pack);
    RepositoryNode catalogNode=new DBCatalogRepNode(metadataCatalog,this,ENodeType.TDQ_REPOSITORY_ELEMENT);
    catalogNode.setProperties(EProperties.LABEL,ERepositoryObjectType.METADATA_CON_CATALOG);
    catalogNode.setProperties(EProperties.CONTENT_TYPE,ERepositoryObjectType.METADATA_CON_CATALOG);
    metadataCatalog.setRepositoryNode(catalogNode);
    nodes.add(catalogNode);
  }
}

Fixed version (ground truth):
private void initializedCatalogRepNode(List<IRepositoryNode> nodes,Package pack){
  if (pack instanceof Catalog) {
    MetadataCatalogRepositoryObject metadataCatalog=new MetadataCatalogRepositoryObject(getObject(),(Catalog)pack);
    RepositoryNode catalogNode=DQRepNodeCreateFactory.createDBCatalogRepNode(metadataCatalog,this,ENodeType.TDQ_REPOSITORY_ELEMENT);
    catalogNode.setProperties(EProperties.LABEL,ERepositoryObjectType.METADATA_CON_CATALOG);
    catalogNode.setProperties(EProperties.CONTENT_TYPE,ERepositoryObjectType.METADATA_CON_CATALOG);
    metadataCatalog.setRepositoryNode(catalogNode);
    nodes.add(catalogNode);
  }
}
Program: 137470
Project: 137470
Buggy source:
/** 
 * create the node of parent.
 * @param object
 * @return
 */
private RepositoryNode createParentNode(){
  RepositoryNode dbParentRepNode=null;
  Package parentPackage=PackageHelper.getParentPackage(getSchema());
  if (parentPackage == null) {
    dbParentRepNode=new DBConnectionRepNode(getParentViewObject(),null,ENodeType.TDQ_REPOSITORY_ELEMENT);
  }
 else   if (parentPackage instanceof Catalog) {
    dbParentRepNode=new DBCatalogRepNode(getParentViewObject(),null,ENodeType.TDQ_REPOSITORY_ELEMENT);
  }
  return dbParentRepNode;
}

Fixed version (ground truth):
/** 
 * create the node of parent.
 * @param object
 * @return
 */
private RepositoryNode createParentNode(){
  RepositoryNode dbParentRepNode=null;
  Package parentPackage=PackageHelper.getParentPackage(getSchema());
  if (parentPackage == null) {
    dbParentRepNode=new DBConnectionRepNode(getParentViewObject(),null,ENodeType.TDQ_REPOSITORY_ELEMENT);
  }
 else   if (parentPackage instanceof Catalog) {
    dbParentRepNode=DQRepNodeCreateFactory.createDBCatalogRepNode(getParentViewObject(),null,ENodeType.TDQ_REPOSITORY_ELEMENT);
  }
  return dbParentRepNode;
}
Program: 137471
Project: 137471
Buggy source:
/** 
 * create the node of parent.
 * @param object
 * @return
 */
private RepositoryNode createParentNode(IRepositoryViewObject object){
  RepositoryNode dbParentRepNode=null;
  if (object instanceof MetadataCatalogRepositoryObject) {
    dbParentRepNode=new DBCatalogRepNode(object,null,ENodeType.TDQ_REPOSITORY_ELEMENT);
  }
 else   if (object instanceof MetadataSchemaRepositoryObject) {
    dbParentRepNode=new DBSchemaRepNode(object,null,ENodeType.TDQ_REPOSITORY_ELEMENT);
  }
  object.setRepositoryNode(dbParentRepNode);
  return dbParentRepNode;
}

Fixed version (ground truth):
/** 
 * create the node of parent.
 * @param object
 * @return
 */
private RepositoryNode createParentNode(IRepositoryViewObject object){
  RepositoryNode dbParentRepNode=null;
  if (object instanceof MetadataCatalogRepositoryObject) {
    dbParentRepNode=DQRepNodeCreateFactory.createDBCatalogRepNode(object,null,ENodeType.TDQ_REPOSITORY_ELEMENT);
  }
 else   if (object instanceof MetadataSchemaRepositoryObject) {
    dbParentRepNode=new DBSchemaRepNode(object,null,ENodeType.TDQ_REPOSITORY_ELEMENT);
  }
  object.setRepositoryNode(dbParentRepNode);
  return dbParentRepNode;
}
Program: 137472
Project: 137472
Buggy source:
/** 
 * create the node of parent.
 * @param object
 * @return
 */
private RepositoryNode createParentNode(){
  RepositoryNode dbParentRepNode=null;
  if (viewObject instanceof MetadataCatalogRepositoryObject) {
    dbParentRepNode=new DBCatalogRepNode(viewObject,null,ENodeType.TDQ_REPOSITORY_ELEMENT);
  }
 else   if (viewObject instanceof MetadataSchemaRepositoryObject) {
    dbParentRepNode=new DBSchemaRepNode(viewObject,null,ENodeType.TDQ_REPOSITORY_ELEMENT);
  }
  viewObject.setRepositoryNode(dbParentRepNode);
  return dbParentRepNode;
}

Fixed version (ground truth):
/** 
 * create the node of parent.
 * @param object
 * @return
 */
private RepositoryNode createParentNode(){
  RepositoryNode dbParentRepNode=null;
  if (viewObject instanceof MetadataCatalogRepositoryObject) {
    dbParentRepNode=DQRepNodeCreateFactory.createDBCatalogRepNode(viewObject,null,ENodeType.TDQ_REPOSITORY_ELEMENT);
  }
 else   if (viewObject instanceof MetadataSchemaRepositoryObject) {
    dbParentRepNode=new DBSchemaRepNode(viewObject,null,ENodeType.TDQ_REPOSITORY_ELEMENT);
  }
  viewObject.setRepositoryNode(dbParentRepNode);
  return dbParentRepNode;
}
Program: 137474
Project: 137474
Buggy source:
/** 
 * Test method for   {@link org.talend.dataprofiler.core.ui.action.actions.DQEmptyRecycleBinAction#run()}. there is a dependce for a node in recycle bin,and this depence is not in recycle bin.
 * @throws Exception
 */
@Test public void testRun_2() throws Exception {
  PowerMockito.doNothing().when(dqEmptyAction_mock,"String_Node_Str");
  IRepositoryNode node1=mock(IRepositoryNode.class);
  List<IRepositoryNode> seleLs=new ArrayList<IRepositoryNode>();
  ISelection selecetion=new StructuredSelection(seleLs);
  PowerMockito.doReturn(selecetion).when(dqEmptyAction_mock).getSelection();
  seleLs.add(node1);
  PowerMockito.mockStatic(DQDeleteHelper.class);
  List<IRepositoryNode> ls=new ArrayList<IRepositoryNode>();
  when(DQDeleteHelper.getCanNotDeletedNodes(seleLs,false)).thenReturn(ls);
  RecycleBinRepNode recyBin=mock(RecycleBinRepNode.class);
  PowerMockito.mockStatic(RepositoryNodeHelper.class);
  when(RepositoryNodeHelper.getRecycleBinRepNode()).thenReturn(recyBin);
  when(RepositoryNodeHelper.findAllChildrenNodes(seleLs)).thenReturn(seleLs);
  when(recyBin.getChildren()).thenReturn(seleLs);
  dqEmptyAction_mock.run();
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.talend.dataprofiler.core.ui.action.actions.DQEmptyRecycleBinAction#run()}. there is a dependce for a node in recycle bin,and this depence is not in recycle bin.
 * @throws Exception
 */
@Test public void testRun_2() throws Exception {
  PowerMockito.doNothing().when(dqEmptyAction_mock,"String_Node_Str");
  IRepositoryNode node1=mock(IRepositoryNode.class);
  Set<IRepositoryNode> seleLs=new HashSet<IRepositoryNode>();
  ISelection selecetion=new StructuredSelection(seleLs);
  PowerMockito.doReturn(selecetion).when(dqEmptyAction_mock).getSelection();
  seleLs.add(node1);
  PowerMockito.mockStatic(DQDeleteHelper.class);
  List<IRepositoryNode> ls=new ArrayList<IRepositoryNode>();
  when(DQDeleteHelper.getCanNotDeletedNodes(seleLs,false)).thenReturn(ls);
  RecycleBinRepNode recyBin=mock(RecycleBinRepNode.class);
  PowerMockito.mockStatic(RepositoryNodeHelper.class);
  when(RepositoryNodeHelper.getRecycleBinRepNode()).thenReturn(recyBin);
  when(RepositoryNodeHelper.findAllChildrenNodes(seleLs)).thenReturn(seleLs);
  List<IRepositoryNode> repsList=new ArrayList<IRepositoryNode>();
  repsList.addAll(seleLs);
  when(recyBin.getChildren()).thenReturn(repsList);
  dqEmptyAction_mock.run();
}
Program: 137475
Project: 137475
Buggy source:
/** 
 * if these items in recycle bin are depended by others which is not in recycle bin,show a warning and return.
 * @param allNodes
 * @param isCurrentPerspectiveDQ
 * @return these list will be used to pop a dialog and display the detail nodes which are depended by others.
 */
public static List<IRepositoryNode> getCanNotDeletedNodes(List<IRepositoryNode> allNodes,boolean isCurrentPerspectiveDQ){
  List<IRepositoryNode> canNotDeletedNodes=new ArrayList<IRepositoryNode>();
  if (allNodes == null) {
    return canNotDeletedNodes;
  }
  for (  IRepositoryNode node : allNodes) {
    List<ModelElement> dependencies=EObjectHelper.getDependencyClients(node);
    if (node.getObject() != null && ERepositoryObjectType.TDQ_JRAXML_ELEMENT.equals(node.getObject().getRepositoryObjectType())) {
      dependencies=getDependedReportOfJrxml(node);
    }
    if (dependencies == null || dependencies.isEmpty()) {
      continue;
    }
    if (!isCurrentPerspectiveDQ) {
      canNotDeletedNodes.add(node);
      continue;
    }
    for (    ModelElement mod : dependencies) {
      Property property=PropertyHelper.getProperty(mod);
      if (property == null) {
        continue;
      }
      Item item=property.getItem();
      if (item != null && !item.getState().isDeleted()) {
        canNotDeletedNodes.add(node);
      }
    }
  }
  return canNotDeletedNodes;
}

Fixed version (ground truth):
/** 
 * if these items in recycle bin are depended by others which is not in recycle bin,show a warning and return.
 * @param allNodes
 * @param isCurrentPerspectiveDQ
 * @return these list will be used to pop a dialog and display the detail nodes which are depended by others.
 */
public static List<IRepositoryNode> getCanNotDeletedNodes(Collection<IRepositoryNode> allNodes,boolean isCurrentPerspectiveDQ){
  List<IRepositoryNode> canNotDeletedNodes=new ArrayList<IRepositoryNode>();
  if (allNodes == null) {
    return canNotDeletedNodes;
  }
  for (  IRepositoryNode node : allNodes) {
    List<ModelElement> dependencies=EObjectHelper.getDependencyClients(node);
    if (node.getObject() != null && ERepositoryObjectType.TDQ_JRAXML_ELEMENT.equals(node.getObject().getRepositoryObjectType())) {
      dependencies=getDependedReportOfJrxml(node);
    }
    if (dependencies == null || dependencies.isEmpty()) {
      continue;
    }
    if (!isCurrentPerspectiveDQ) {
      canNotDeletedNodes.add(node);
      continue;
    }
    for (    ModelElement mod : dependencies) {
      Property property=PropertyHelper.getProperty(mod);
      if (property == null) {
        continue;
      }
      Item item=property.getItem();
      if (item != null && !item.getState().isDeleted()) {
        canNotDeletedNodes.add(node);
      }
    }
  }
  return canNotDeletedNodes;
}
Program: 137476
Project: 137476
Buggy source:
/** 
 * DOC gdbu Comment method "fillTreeList". Filter's entry method.
 * @param monitor
 */
public static void fillTreeList(IProgressMonitor monitor){
  allFilteredNodeList.clear();
  DQRepositoryNode.setIsReturnAllNodesWhenFiltering(false);
  List<IRepositoryNode> list=new ArrayList<IRepositoryNode>();
  list.add(getRootNode(ERepositoryObjectType.TDQ_DATA_PROFILING,true));
  list.add(getRootNode(ERepositoryObjectType.TDQ_LIBRARIES,true));
  list.add(getRootNode(ERepositoryObjectType.METADATA,true));
  list.add(getRootNode(ERepositoryObjectType.RECYCLE_BIN,true));
  for (  IRepositoryNode iRepositoryNode : list) {
    allFilteredNodeList.addAll(getTreeList(iRepositoryNode));
    if (null != monitor) {
      monitor.worked(2);
    }
  }
  DQRepositoryNode.setIsReturnAllNodesWhenFiltering(true);
}

Fixed version (ground truth):
/** 
 * DOC gdbu Comment method "fillTreeList". Filter's entry method.
 * @param monitor
 */
public static void fillTreeList(IProgressMonitor monitor){
  allFilteredNodeList.clear();
  DQRepositoryNode.setIsReturnAllNodesWhenFiltering(false);
  List<IRepositoryNode> list=new ArrayList<IRepositoryNode>();
  list.add(getRootNode(ERepositoryObjectType.TDQ_DATA_PROFILING,true));
  list.add(getRootNode(ERepositoryObjectType.TDQ_LIBRARIES,true));
  list.add(getRootNode(ERepositoryObjectType.METADATA,true));
  list.add(getRecycleBinRepNode());
  for (  IRepositoryNode iRepositoryNode : list) {
    allFilteredNodeList.addAll(getTreeList(iRepositoryNode));
    if (null != monitor) {
      monitor.worked(2);
    }
  }
  DQRepositoryNode.setIsReturnAllNodesWhenFiltering(true);
}
Program: 137477
Project: 137477
Buggy source:
/** 
 * ADD gdbu 2011-11-15 TDQ-3969 DOC gdbu Comment method "getRecycleBinFilteredNodes". This method could return a list contains recycle bin node and all of it's children.
 * @return
 */
private static List<IRepositoryNode> getRecycleBinFilteredNodes(){
  return getTreeList(getRootNode(ERepositoryObjectType.RECYCLE_BIN,true));
}

Fixed version (ground truth):
/** 
 * ADD gdbu 2011-11-15 TDQ-3969 DOC gdbu Comment method "getRecycleBinFilteredNodes". This method could return a list contains recycle bin node and all of it's children.
 * @return
 */
private static List<IRepositoryNode> getRecycleBinFilteredNodes(){
  return getTreeList(getRecycleBinRepNode());
}
Program: 137478
Project: 137478
Buggy source:
/** 
 * get recycle bin node.
 * @return
 */
public static RepositoryNode getRecycleBinRootNode(){
  RepositoryNode node=null;
  CommonViewer commonViewer=getDQCommonViewer(true);
  if (commonViewer != null) {
    TreeItem[] items=commonViewer.getTree().getItems();
    for (    TreeItem item : items) {
      node=(RepositoryNode)item.getData();
      if (node.isBin()) {
        break;
      }
    }
  }
  return node;
}

Fixed version (ground truth):
/** 
 * get recycle bin node.
 * @return
 * @deprecated use {@link #getRecycleBinRepNode()} instead
 */
@Deprecated public static RepositoryNode getRecycleBinRootNode(){
  RepositoryNode node=null;
  CommonViewer commonViewer=getDQCommonViewer(true);
  if (commonViewer != null) {
    TreeItem[] items=commonViewer.getTree().getItems();
    for (    TreeItem item : items) {
      node=(RepositoryNode)item.getData();
      if (node.isBin()) {
        break;
      }
    }
  }
  return node;
}
Program: 137479
Project: 137479
Buggy source:
/** 
 * ADD gdbu 2011-11-24 TDQ-4068 To get all children nodes. DOC gdbu Comment method "findRecycleBinNodeWhenFiltering".
 * @param recycleBinNodes
 * @return
 */
public static List<IRepositoryNode> findAllChildrenNodes(List<IRepositoryNode> recycleBinNodes){
  List<IRepositoryNode> findAllRecycleBinNode=new ArrayList<IRepositoryNode>();
  findAllRecycleBinNode.addAll(recycleBinNodes);
  for (  IRepositoryNode iRepositoryNode : recycleBinNodes) {
    findAllRecycleBinNode.addAll(findAllChildrenNodes(iRepositoryNode.getChildren()));
  }
  return findAllRecycleBinNode;
}

Fixed version (ground truth):
/** 
 * ADD gdbu 2011-11-24 TDQ-4068 To get all children nodes. DOC gdbu Comment method "findRecycleBinNodeWhenFiltering".
 * @param recycleBinNodes
 * @return
 */
public static Collection<IRepositoryNode> findAllChildrenNodes(Collection<IRepositoryNode> recycleBinNodes){
  Set<IRepositoryNode> allChindrenNode=new HashSet<IRepositoryNode>();
  allChindrenNode.addAll(recycleBinNodes);
  for (  IRepositoryNode iRepositoryNode : recycleBinNodes) {
    allChindrenNode.addAll(findAllChildrenNodes(iRepositoryNode.getChildren()));
  }
  return allChindrenNode;
}
Program: 137480
Project: 137480
Buggy source:
/** 
 * get the RepositoryNode according to the nodeName.
 * @param nodeName the node name
 * @param open if the DQView is not show, show it or not
 * @return
 */
public static RepositoryNode getRootNode(ERepositoryObjectType nodeName,boolean open){
  FolderItem folderItem=ProxyRepositoryFactory.getInstance().getFolderItem(ProjectManager.getInstance().getCurrentProject(),nodeName,Path.EMPTY);
  RepositoryNode node=null;
  CommonViewer commonViewer=getDQCommonViewer(open);
  if (commonViewer != null) {
    TreeItem[] items=commonViewer.getTree().getItems();
    for (    TreeItem item : items) {
      node=(RepositoryNode)item.getData();
      if (node.isBin()) {
        continue;
      }
      if (folderItem != null) {
        boolean isSysFolder=ENodeType.SYSTEM_FOLDER == node.getType() && FolderType.SYSTEM_FOLDER_LITERAL == folderItem.getType();
        if (isSysFolder) {
          String viewFolderLabel=folderItem.getProperty().getLabel();
          String folderLabel=node.getObject().getProperty().getLabel();
          if (viewFolderLabel.equals(folderLabel)) {
            return node;
          }
        }
      }
    }
  }
  log.error(Messages.getString("String_Node_Str") + nodeName.getLabel());
  return node;
}

Fixed version (ground truth):
/** 
 * get the RepositoryNode according to the ERepositoryObjectType(the ERepositoryObjectType should not be RECYCLE_BIN, because there doesn't exist a physical folder, so there will return null and log an error message; use getRecycleBinRepNode() to get the RecycleBinNode).
 * @param nodeType the node's ERepositoryObjectType
 * @param open if the DQView is not show, show it or not
 * @return
 */
public static RepositoryNode getRootNode(ERepositoryObjectType nodeType,boolean open){
  FolderItem folderItem=ProxyRepositoryFactory.getInstance().getFolderItem(ProjectManager.getInstance().getCurrentProject(),nodeType,Path.EMPTY);
  RepositoryNode node=null;
  CommonViewer commonViewer=getDQCommonViewer(open);
  if (commonViewer != null) {
    TreeItem[] items=commonViewer.getTree().getItems();
    for (    TreeItem item : items) {
      node=(RepositoryNode)item.getData();
      if (node.isBin()) {
        continue;
      }
      if (folderItem != null) {
        boolean isSysFolder=ENodeType.SYSTEM_FOLDER == node.getType() && FolderType.SYSTEM_FOLDER_LITERAL == folderItem.getType();
        if (isSysFolder) {
          String viewFolderLabel=folderItem.getProperty().getLabel();
          String folderLabel=node.getObject().getProperty().getLabel();
          if (viewFolderLabel.equals(folderLabel)) {
            return node;
          }
        }
      }
    }
  }
  log.error(Messages.getString("String_Node_Str") + nodeType.getLabel());
  return node;
}
Program: 137481
Project: 137481
Buggy source:
/** 
 * find a node from recycle bin.
 * @param modelElement
 * @return
 */
public static RepositoryNode recursiveFindRecycleBin(ModelElement modelElement){
  if (modelElement == null) {
    return null;
  }
  String uuid=getUUID(modelElement);
  RepositoryNode recyBinNode=getRecycleBinRootNode();
  if (uuid == null || recyBinNode == null) {
    return null;
  }
  List<IRepositoryNode> children=recyBinNode.getChildren();
  return recursiveFindByUuid(uuid,children);
}

Fixed version (ground truth):
/** 
 * find a node from recycle bin.
 * @param modelElement
 * @return
 */
public static RepositoryNode recursiveFindRecycleBin(ModelElement modelElement){
  if (modelElement == null) {
    return null;
  }
  String uuid=getUUID(modelElement);
  RepositoryNode recyBinNode=getRecycleBinRepNode();
  if (uuid == null || recyBinNode == null) {
    return null;
  }
  List<IRepositoryNode> children=recyBinNode.getChildren();
  return recursiveFindByUuid(uuid,children);
}
Program: 137482
Project: 137482
Buggy source:
/** 
 * DOC xqliu Comment method "addDataEntity2CustomerDataset". ADD xqliu 2010-03-10 feature 10834
 * @param customerDataset
 * @param unit
 */
private void addDataEntity2CustomerDataset(CustomerDefaultCategoryDataset customerDataset,TableIndicatorUnit unit){
  if (IndicatorEnum.WhereRuleIndicatorEnum.equals(unit.getType())) {
    String columnKey=unit.getIndicatorName();
    double value=Double.parseDouble(unit.getValue().toString());
    customerDataset.addValue(unit.geIndicatorCount() - value,ROW_KEY_NOT_PASS,columnKey);
    customerDataset.addValue(value,ROW_KEY_PASS,columnKey);
    WhereRuleChartDataEntity entity=new WhereRuleChartDataEntity();
    entity.setIndicator(unit.getIndicator());
    entity.setLabel(columnKey);
    entity.setNumMatch(String.valueOf(value));
    entity.setNumNoMatch(String.valueOf(unit.geIndicatorCount() - value));
    entity.setToolTip(getUnitToolTip(unit));
    customerDataset.addDataEntity(entity);
  }
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "addDataEntity2CustomerDataset". ADD xqliu 2010-03-10 feature 10834
 * @param customerDataset
 * @param unit
 */
private void addDataEntity2CustomerDataset(CustomerDefaultCategoryDataset customerDataset,TableIndicatorUnit unit){
  if (IndicatorEnum.WhereRuleIndicatorEnum.equals(unit.getType())) {
    if (unit.getValue() == null) {
      return;
    }
    String columnKey=unit.getIndicatorName();
    double value=Double.parseDouble(unit.getValue().toString());
    customerDataset.addValue(unit.geIndicatorCount() - value,ROW_KEY_NOT_PASS,columnKey);
    customerDataset.addValue(value,ROW_KEY_PASS,columnKey);
    WhereRuleChartDataEntity entity=new WhereRuleChartDataEntity();
    entity.setIndicator(unit.getIndicator());
    entity.setLabel(columnKey);
    entity.setNumMatch(String.valueOf(value));
    entity.setNumNoMatch(String.valueOf(unit.geIndicatorCount() - value));
    entity.setToolTip(getUnitToolTip(unit));
    customerDataset.addDataEntity(entity);
  }
}
Program: 137484
Project: 137484
Buggy source:
@Override public void end() throws IOException, InterruptedException {
  for (  String[] mst : masterRecords) {
    outputRow(StringUtilities.join(mst,columnDelimiter,escapeCharacter));
  }
}

Fixed version (ground truth):
@Override public void end() throws IOException, InterruptedException {
  for (  String[] mst : masterRecords) {
    outputRow(StringUtilities.join(mst,columnDelimiter,StringUtilities.ESCAPE_CHARACTER));
  }
}