nus-yam/ex-repair huggingface dataset:
Program: 138123
Project: 138123
Buggy source:
/** 
 * DOC qiongli :excute super method run().
 * @param currentNode:null for logical delete a selected element by UI.none-null for physical delete or logicaldelete dependecy.
 */
private void excuteSuperRun(RepositoryNode currentNode){
  this.currentNode=currentNode;
  if (currentNode != null) {
    deleteConnectionForSQL(currentNode);
  }
  super.setAvoidUnloadResources(true);
  IRepositoryNode node=getCurrentRepositoryNode();
  super.run();
  if (currentNode != null) {
    RepositoryNode parent=currentNode.getParent();
    if (parent != null && (parent.getType() == ENodeType.SIMPLE_FOLDER || parent.getLabel().equalsIgnoreCase(ERepositoryObjectType.RECYCLE_BIN.name().replaceAll("String_Node_Str",PluginConstant.SPACE_STRING)))) {
      parent.getChildren(true).remove(currentNode);
    }
  }
  if (null != node) {
    CorePlugin.getDefault().refreshDQView(node.getParent());
  }
}

Fixed version (ground truth):
/** 
 * DOC qiongli :excute super method run().
 * @param currentNode:null for logical delete a selected element by UI.none-null for physical delete or logicaldelete dependecy.
 */
private void excuteSuperRun(RepositoryNode currentNode){
  this.currentNode=currentNode;
  if (currentNode != null) {
    deleteConnectionForSQL(currentNode);
  }
  super.setAvoidUnloadResources(true);
  IRepositoryNode node=getCurrentRepositoryNode();
  super.run();
  if (currentNode != null) {
    RepositoryNode parent=currentNode.getParent();
    if (parent != null && (parent.getType() == ENodeType.SIMPLE_FOLDER || parent.getLabel().equalsIgnoreCase(ERepositoryObjectType.RECYCLE_BIN.name().replaceAll("String_Node_Str",PluginConstant.SPACE_STRING)))) {
      parent.getChildren(true).remove(currentNode);
    }
  }
}
Program: 138124
Project: 138124
Buggy source:
/** 
 * DOC klliu ColumnFilterAction constructor comment.
 * @param node
 */
public ColumnFilterAction(IRepositoryNode node){
  this();
  this.node=node;
  if (node.getObject() instanceof TdTableRepositoryObject) {
    TdTableRepositoryObject tableObject=(TdTableRepositoryObject)node.getObject();
    this.namedColumnSet=tableObject.getTdTable();
  }
 else   if (node.getObject() instanceof TdViewRepositoryObject) {
    TdViewRepositoryObject viewObject=(TdViewRepositoryObject)node.getObject();
    this.namedColumnSet=viewObject.getTdView();
  }
}

Fixed version (ground truth):
/** 
 * DOC klliu ColumnFilterAction constructor comment.
 * @param node
 */
public ColumnFilterAction(IRepositoryNode node){
  this();
  this.node=node;
  if (node instanceof DBTableRepNode) {
    this.namedColumnSet=((DBTableRepNode)node).getTdTable();
  }
 else   if (node instanceof DBViewRepNode) {
    this.namedColumnSet=((DBViewRepNode)node).getTdView();
  }
}
Program: 138125
Project: 138125
Buggy source:
@Override public void run(){
  ColumnFilterWizard wizard=new ColumnFilterWizard(this.namedColumnSet);
  WizardDialog dialog=new WizardDialog(null,wizard);
  dialog.setPageSize(WIDTH,HEIGHT);
  dialog.open();
  CorePlugin.getDefault().refreshDQView(node);
}

Fixed version (ground truth):
@Override public void run(){
  ColumnFilterWizard wizard=new ColumnFilterWizard(this.namedColumnSet);
  WizardDialog dialog=new WizardDialog(null,wizard);
  dialog.setPageSize(WIDTH,HEIGHT);
  if (dialog.open() == Dialog.OK) {
    CorePlugin.getDefault().refreshDQView(node);
  }
}
Program: 138126
Project: 138126
Buggy source:
/** 
 * DOC Administrator Comment method "initializedConnection". for 6560
 * @param indicators
 */
private void initializedConnection(ModelElementIndicator[] indicators){
  Analysis analysis=masterPage.getAnalysisHandler().getAnalysis();
  DataManager connection=analysis.getContext().getConnection();
  Connection tdDataProvider=null;
  boolean enableWhereClauseFlag=true;
  boolean enableExecuteLanguageFlag=true;
  String execLang=analysis.getParameters().getExecutionLanguage().getLiteral();
  if (execLang != null && ExecutionLanguage.JAVA.getLiteral().equals(execLang)) {
    enableExecuteLanguageFlag=false;
  }
  if (indicators != null && indicators.length > 0) {
    if (connection == null) {
      tdDataProvider=ModelElementIndicatorHelper.getTdDataProvider(indicators[0]);
      analysis.getContext().setConnection(tdDataProvider);
      if (tdDataProvider != null && masterPage.getExecCombo() != null) {
        if (ConnectionUtils.isDelimitedFileConnection(tdDataProvider)) {
          masterPage.setWhereClauseDisabled();
          masterPage.changeExecuteLanguageToJava(true);
          enableWhereClauseFlag=false;
          enableExecuteLanguageFlag=false;
        }
 else         if (ConnectionUtils.isMdmConnection(tdDataProvider)) {
          masterPage.setWhereClauseDisabled();
          enableWhereClauseFlag=false;
        }
      }
    }
  }
  if (enableWhereClauseFlag) {
    masterPage.setWhereClauseEnable();
  }
  if (enableExecuteLanguageFlag) {
    masterPage.changeExecuteLanguageToSql(true);
  }
}

Fixed version (ground truth):
/** 
 * DOC Administrator Comment method "initializedConnection". for 6560
 * @param indicators
 */
private void initializedConnection(ModelElementIndicator[] indicators){
  Analysis analysis=masterPage.getAnalysisHandler().getAnalysis();
  DataManager connection=analysis.getContext().getConnection();
  boolean enableWhereClauseFlag=true;
  boolean enableExecuteLanguageFlag=true;
  if (indicators != null && indicators.length > 0) {
    if (connection == null) {
      connection=ModelElementIndicatorHelper.getTdDataProvider(indicators[0]);
      analysis.getContext().setConnection(connection);
    }
    if (connection != null && masterPage.getExecCombo() != null) {
      if (ConnectionUtils.isDelimitedFileConnection((DataProvider)connection)) {
        masterPage.setWhereClauseDisabled();
        masterPage.changeExecuteLanguageToJava(true);
        enableWhereClauseFlag=false;
        enableExecuteLanguageFlag=false;
      }
 else       if (ConnectionUtils.isMdmConnection(connection)) {
        masterPage.setWhereClauseDisabled();
        enableWhereClauseFlag=false;
      }
    }
  }
  String execLang=analysis.getParameters().getExecutionLanguage().getLiteral();
  if (execLang != null && ExecutionLanguage.JAVA.getLiteral().equals(execLang) && (ConnectionUtils.isDelimitedFileConnection((DataProvider)connection) || ConnectionUtils.isMdmConnection(connection))) {
    enableExecuteLanguageFlag=false;
  }
  if (enableWhereClauseFlag) {
    masterPage.setWhereClauseEnable();
  }
  if (enableExecuteLanguageFlag) {
    masterPage.changeExecuteLanguageToSql(true);
  }
}
Program: 138127
Project: 138127
Buggy source:
/** 
 * DOC Administrator Comment method "initializedConnection". for 6560
 * @param indicators
 */
private void initializedConnection(ModelElementIndicator[] indicators){
  Analysis analysis=masterPage.getAnalysisHandler().getAnalysis();
  DataManager connection=analysis.getContext().getConnection();
  Connection tdDataProvider=null;
  boolean enableWhereClauseFlag=true;
  boolean enableExecuteLanguageFlag=true;
  if (indicators != null && indicators.length > 0) {
    if (connection == null) {
      tdDataProvider=ModelElementIndicatorHelper.getTdDataProvider(indicators[0]);
      connection=tdDataProvider;
      if (tdDataProvider != null && masterPage.getExecCombo() != null) {
        if (ConnectionUtils.isDelimitedFileConnection(tdDataProvider)) {
          masterPage.setWhereClauseDisabled();
          masterPage.changeExecuteLanguageToJava(true);
          enableWhereClauseFlag=false;
          enableExecuteLanguageFlag=false;
        }
 else         if (ConnectionUtils.isMdmConnection(tdDataProvider)) {
          masterPage.setWhereClauseDisabled();
          enableWhereClauseFlag=false;
        }
      }
    }
  }
  if (enableWhereClauseFlag) {
    masterPage.setWhereClauseEnable();
  }
  if (enableExecuteLanguageFlag) {
    masterPage.changeExecuteLanguageToSql(true);
  }
}

Fixed version (ground truth):
/** 
 * DOC Administrator Comment method "initializedConnection". for 6560
 * @param indicators
 */
private void initializedConnection(ModelElementIndicator[] indicators){
  Analysis analysis=masterPage.getAnalysisHandler().getAnalysis();
  DataManager connection=analysis.getContext().getConnection();
  Connection tdDataProvider=null;
  boolean enableWhereClauseFlag=true;
  boolean enableExecuteLanguageFlag=true;
  CCombo execCombo=masterPage.getExecCombo();
  String execLang=execCombo.getText();
  if (ExecutionLanguage.JAVA.getLiteral().equals(execLang)) {
    enableExecuteLanguageFlag=false;
  }
  if (indicators != null && indicators.length > 0) {
    if (connection == null) {
      tdDataProvider=ModelElementIndicatorHelper.getTdDataProvider(indicators[0]);
      connection=tdDataProvider;
      if (tdDataProvider != null && masterPage.getExecCombo() != null) {
        if (ConnectionUtils.isDelimitedFileConnection(tdDataProvider)) {
          masterPage.setWhereClauseDisabled();
          masterPage.changeExecuteLanguageToJava(true);
          enableWhereClauseFlag=false;
          enableExecuteLanguageFlag=false;
        }
 else         if (ConnectionUtils.isMdmConnection(tdDataProvider)) {
          masterPage.setWhereClauseDisabled();
          enableWhereClauseFlag=false;
        }
      }
    }
  }
  if (enableWhereClauseFlag) {
    masterPage.setWhereClauseEnable();
  }
  if (enableExecuteLanguageFlag) {
    masterPage.changeExecuteLanguageToSql(true);
  }
}
Program: 138130
Project: 138130
Buggy source:
/** 
 * Get the version number as specified in plugin.xml
 * @return version number of SQL Explorer plugin
 */
public String getVersion(){
  String version=(String)plugin.getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
  return version;
}

Fixed version (ground truth):
/** 
 * Get the version number as specified in plugin.xml
 * @return version number of SQL Explorer plugin
 */
public String getVersion(){
  String version=System.getProperty("String_Node_Str");
  if (version == null || "String_Node_Str".equals(version.trim())) {
    version=(String)plugin.getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
  }
  return version;
}
Program: 138131
Project: 138131
Buggy source:
/** 
 * DOC bzhou Comment method "getProductVersion".
 * @return
 */
public ProductVersion getProductVersion(){
  Object obj=plugin.getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
  ProductVersion currentVersion=ProductVersion.fromString(obj.toString());
  return currentVersion;
}

Fixed version (ground truth):
/** 
 * DOC bzhou Comment method "getProductVersion".
 * @return
 */
public ProductVersion getProductVersion(){
  ProductVersion currentVersion=ProductVersion.fromString(VersionUtils.getVersion());
  return currentVersion;
}
Program: 138132
Project: 138132
Buggy source:
/** 
 * DOC hcheng Comment method "getCurrentVersion".
 * @param normalize
 * @return
 */
public static String getCurrentVersion(boolean normalize){
  String version=(String)CorePlugin.getDefault().getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
  if (normalize) {
    version=normalizeVersion(version);
  }
  return version;
}

Fixed version (ground truth):
/** 
 * DOC hcheng Comment method "getCurrentVersion".
 * @param normalize
 * @return
 */
public static String getCurrentVersion(boolean normalize){
  String version=VersionUtils.getVersion();
  if (normalize) {
    version=normalizeVersion(version);
  }
  return version;
}
Program: 138133
Project: 138133
Buggy source:
/** 
 * DOC bzhou Comment method "getProductVersion".
 * @return
 */
public ProductVersion getProductVersion(){
  Object obj=bundle.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
  ProductVersion currentVersion=ProductVersion.fromString(obj.toString());
  return currentVersion;
}

Fixed version (ground truth):
/** 
 * DOC bzhou Comment method "getProductVersion".
 * @return
 */
public ProductVersion getProductVersion(){
  String version=System.getProperty("String_Node_Str");
  if (version == null || "String_Node_Str".equals(version.trim())) {
    version=(String)bundle.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
  }
  ProductVersion currentVersion=ProductVersion.fromString(version);
  return currentVersion;
}
Program: 138134
Project: 138134
Buggy source:
public void preWindowOpen(){
  IWorkbenchWindowConfigurer configurer=getWindowConfigurer();
  configurer.setInitialSize(new Point(1024,768));
  configurer.setShowCoolBar(true);
  configurer.setShowStatusLine(false);
  String buildId=CorePlugin.getDefault().getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION).toString();
  IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getBrandingService(IBrandingService.class);
  configurer.setTitle(brandingService.getFullProductName() + "String_Node_Str" + buildId+ "String_Node_Str");
}

Fixed version (ground truth):
public void preWindowOpen(){
  IWorkbenchWindowConfigurer configurer=getWindowConfigurer();
  configurer.setInitialSize(new Point(1024,768));
  configurer.setShowCoolBar(true);
  configurer.setShowStatusLine(false);
  String buildId=VersionUtils.getVersion();
  IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getBrandingService(IBrandingService.class);
  configurer.setTitle(brandingService.getFullProductName() + "String_Node_Str" + buildId+ "String_Node_Str");
}
Program: 138137
Project: 138137
Buggy source:
protected void initMetaTextFied(){
  Property property=getProperty();
  if (property != null) {
    String name=property.getLabel();
    String purpose=property.getPurpose();
    String description=property.getDescription();
    String author=property.getAuthor().getLogin();
    String devStatus=property.getStatusCode();
    nameText.setText(name == null ? PluginConstant.EMPTY_STRING : name);
    setOldDataproviderName(nameText.getText());
    purposeText.setText(purpose == null ? PluginConstant.EMPTY_STRING : purpose);
    descriptionText.setText(description == null ? PluginConstant.EMPTY_STRING : description);
    authorText.setText(author == null ? PluginConstant.EMPTY_STRING : author);
    authorText.setEnabled(false);
    statusCombo.setText(devStatus == null ? PluginConstant.EMPTY_STRING : devStatus);
  }
}

Fixed version (ground truth):
protected void initMetaTextFied(){
  Property property=getProperty();
  if (property != null) {
    String name=property.getLabel();
    String purpose=property.getPurpose();
    String description=property.getDescription();
    String author=property.getAuthor().getLogin();
    String devStatus=property.getStatusCode();
    nameText.setText(name == null ? PluginConstant.EMPTY_STRING : name);
    setOldDataproviderName(nameText.getText());
    purposeText.setText(purpose == null ? PluginConstant.EMPTY_STRING : purpose);
    descriptionText.setText(description == null ? PluginConstant.EMPTY_STRING : description);
    TaggedValue tv=TaggedValueHelper.getTaggedValue(TaggedValueHelper.AUTHOR,currentModelElement.getTaggedValue());
    authorText.setText(author == null ? (tv == null ? PluginConstant.EMPTY_STRING : (tv.getValue() == null ? PluginConstant.EMPTY_STRING : tv.getValue())) : author);
    authorText.setEnabled(false);
    statusCombo.setText(devStatus == null ? PluginConstant.EMPTY_STRING : devStatus);
  }
}
Program: 138138
Project: 138138
Buggy source:
/** 
 * @return true if any text fields with validates contains whitespace. 
 */
public boolean checkWhithspace(){
  return 0 == getWhitespaceFields().size();
}

Fixed version (ground truth):
/** 
 * @return true if any text fields with validates contains whitespace.
 */
public boolean checkWhithspace(){
  return 0 == getWhitespaceFields().size();
}
Program: 138139
Project: 138139
Buggy source:
protected void saveReloadResult(){
  ElementWriterFactory.getInstance().createDataProviderWriter().save(oldDataProvider,true);
}

Fixed version (ground truth):
protected void saveReloadResult(){
  if (oldDataProvider.getName() == null) {
    oldDataProvider.setName(PropertyHelper.getProperty(oldDataProvider).getLabel());
  }
  ElementWriterFactory.getInstance().createDataProviderWriter().save(oldDataProvider,true);
}
Program: 138140
Project: 138140
Buggy source:
@Override protected Connection findDataProvider(){
  Connection provider=null;
  if (selectedObj instanceof RepositoryNode) {
    if (selectedObj instanceof DBTableFolderRepNode || selectedObj instanceof DBViewFolderRepNode) {
      provider=ConnectionHelper.getTdDataProvider(getPackageFromObject(selectedObj));
    }
    Item connItem=null;
    IRepositoryViewObject object=((RepositoryNode)selectedObj).getObject();
    if (null != object) {
      connItem=object.getProperty().getItem();
    }
 else {
      connItem=((RepositoryNode)selectedObj).getParent().getObject().getProperty().getItem();
    }
    provider=((ConnectionItem)connItem).getConnection();
  }
 else   if (selectedObj instanceof Package) {
    provider=ConnectionHelper.getTdDataProvider((Package)selectedObj);
  }
  if (provider.getName() == null) {
    provider.setName(PropertyHelper.getProperty(provider).getLabel());
  }
  return provider;
}

Fixed version (ground truth):
@Override protected Connection findDataProvider(){
  Connection provider=null;
  if (selectedObj instanceof RepositoryNode) {
    if (selectedObj instanceof DBTableFolderRepNode || selectedObj instanceof DBViewFolderRepNode) {
      provider=ConnectionHelper.getTdDataProvider(getPackageFromObject(selectedObj));
    }
    Item connItem=null;
    IRepositoryViewObject object=((RepositoryNode)selectedObj).getObject();
    if (null != object) {
      connItem=object.getProperty().getItem();
    }
 else {
      connItem=((RepositoryNode)selectedObj).getParent().getObject().getProperty().getItem();
    }
    provider=((ConnectionItem)connItem).getConnection();
  }
 else   if (selectedObj instanceof Package) {
    provider=ConnectionHelper.getTdDataProvider((Package)selectedObj);
  }
  return provider;
}
Program: 138141
Project: 138141
Buggy source:
@Override protected Connection findDataProvider(){
  Connection provider=null;
  if (selectedObj instanceof RepositoryNode) {
    if (selectedObj instanceof DBTableFolderRepNode || selectedObj instanceof DBViewFolderRepNode) {
      provider=ConnectionHelper.getTdDataProvider(getPackageFromObject(selectedObj));
    }
    Item connItem=null;
    IRepositoryViewObject object=((RepositoryNode)selectedObj).getObject();
    if (null != object) {
      connItem=object.getProperty().getItem();
    }
 else {
      connItem=((RepositoryNode)selectedObj).getParent().getObject().getProperty().getItem();
    }
    provider=((ConnectionItem)connItem).getConnection();
  }
 else   if (selectedObj instanceof Package) {
    provider=ConnectionHelper.getTdDataProvider((Package)selectedObj);
  }
  return provider;
}

Fixed version (ground truth):
@Override protected Connection findDataProvider(){
  Connection provider=null;
  if (selectedObj instanceof RepositoryNode) {
    if (selectedObj instanceof DBTableFolderRepNode || selectedObj instanceof DBViewFolderRepNode) {
      provider=ConnectionHelper.getTdDataProvider(getPackageFromObject(selectedObj));
    }
    Item connItem=null;
    IRepositoryViewObject object=((RepositoryNode)selectedObj).getObject();
    if (null != object) {
      connItem=object.getProperty().getItem();
    }
 else {
      connItem=((RepositoryNode)selectedObj).getParent().getObject().getProperty().getItem();
    }
    provider=((ConnectionItem)connItem).getConnection();
  }
 else   if (selectedObj instanceof Package) {
    provider=ConnectionHelper.getTdDataProvider((Package)selectedObj);
  }
  if (provider.getName() == null) {
    provider.setName(PropertyHelper.getProperty(provider).getLabel());
  }
  return provider;
}
Program: 138144
Project: 138144
Buggy source:
private void moveConnectionRepNode(IRepositoryNode sourceNode,IRepositoryNode targetNode) throws PersistenceException {
  IRepositoryViewObject objectToMove=sourceNode.getObject();
  ConnectionItem item=(ConnectionItem)objectToMove.getProperty().getItem();
  IPath fullPath=Path.EMPTY;
  if (targetNode.getParent() instanceof DBConnectionFolderRepNode) {
    fullPath=ResourceManager.getConnectionFolder().getFullPath();
  }
 else   if (targetNode.getParent() instanceof DFConnectionFolderRepNode) {
    fullPath=ResourceManager.getFileDelimitedFolder().getFullPath();
  }
 else   if (targetNode.getParent() instanceof MDMConnectionFolderRepNode || targetNode.getParent() instanceof MDMConnectionSubFolderRepNode) {
    fullPath=ResourceManager.getMDMConnectionFolder().getFullPath();
  }
  if (targetNode.getType() == ENodeType.SIMPLE_FOLDER) {
    moveObject(objectToMove,sourceNode,targetNode,fullPath.makeRelativeTo(ResourceManager.getRootProject().getFullPath()));
  }
 else   if (targetNode.getType() == ENodeType.SYSTEM_FOLDER) {
    moveObject(objectToMove,sourceNode,targetNode,Path.EMPTY);
  }
  CorePlugin.getDefault().refreshDQView(targetNode.getParent());
  this.updateConnectionDependency(item);
}

Fixed version (ground truth):
private void moveConnectionRepNode(IRepositoryNode sourceNode,IRepositoryNode targetNode) throws PersistenceException {
  IRepositoryViewObject objectToMove=sourceNode.getObject();
  ConnectionItem item=(ConnectionItem)objectToMove.getProperty().getItem();
  IPath fullPath=Path.EMPTY;
  if (targetNode.getParent() instanceof DBConnectionFolderRepNode) {
    fullPath=ResourceManager.getConnectionFolder().getFullPath();
  }
 else   if (targetNode.getParent() instanceof DFConnectionFolderRepNode) {
    fullPath=ResourceManager.getFileDelimitedFolder().getFullPath();
  }
 else   if (targetNode.getParent() instanceof MDMConnectionFolderRepNode || targetNode.getParent() instanceof MDMConnectionSubFolderRepNode) {
    fullPath=ResourceManager.getMDMConnectionFolder().getFullPath();
  }
  if (targetNode.getType() == ENodeType.SIMPLE_FOLDER) {
    moveObject(objectToMove,sourceNode,targetNode,fullPath.makeRelativeTo(ResourceManager.getRootProject().getFullPath()));
  }
 else   if (targetNode.getType() == ENodeType.SYSTEM_FOLDER) {
    moveObject(objectToMove,sourceNode,targetNode,Path.EMPTY);
  }
  CorePlugin.getDefault().refreshDQView(targetNode.getParent());
}
Program: 138145
Project: 138145
Buggy source:
private void computeDependcy(FolderItem emfFolder){
  try {
    if (emfFolder != null) {
      Item[] childrens=(Item[])emfFolder.getChildren().toArray();
      for (int i=0; i < childrens.length; i++) {
        if (childrens[i] instanceof FolderItem) {
          FolderItem children=(FolderItem)childrens[i];
          computeDependcy(children);
        }
 else {
          if (childrens[i] instanceof TDQAnalysisItem) {
            this.updateAnalysisDependency((TDQAnalysisItem)childrens[i]);
          }
 else           if (childrens[i] instanceof TDQReportItem) {
            this.updateReportDependency((TDQReportItem)childrens[i]);
          }
 else           if (childrens[i] instanceof TDQIndicatorDefinitionItem) {
            this.updateIndicatorDefinitionDependency((TDQIndicatorDefinitionItem)childrens[i]);
          }
 else           if (childrens[i] instanceof TDQBusinessRuleItem) {
            this.updateBusinessRuleDependency((TDQBusinessRuleItem)childrens[i]);
          }
 else           if (childrens[i] instanceof TDQPatternItem) {
            this.updatePatternDependency((TDQPatternItem)childrens[i]);
          }
 else           if (childrens[i] instanceof ConnectionItem) {
            this.updateConnectionDependency((ConnectionItem)childrens[i]);
          }
        }
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
private void computeDependcy(FolderItem emfFolder){
  try {
    if (emfFolder != null) {
      Item[] childrens=(Item[])emfFolder.getChildren().toArray();
      for (int i=0; i < childrens.length; i++) {
        if (childrens[i] instanceof FolderItem) {
          FolderItem children=(FolderItem)childrens[i];
          computeDependcy(children);
        }
 else {
          updateDependcyByItem(childrens[i]);
        }
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}
Program: 138146
Project: 138146
Buggy source:
private void computePath(FolderHelper folderHelper,IPath sourcePath,IPath targetPath,IPath makeRelativeTo,ERepositoryObjectType type,IRepositoryNode sourceNode,IRepositoryNode targetNode) throws PersistenceException {
  String completeNewPath=null;
  IPath sourceMakeRelativeTo=sourcePath.makeRelativeTo(makeRelativeTo);
  IPath targetMakeRelativeTo=targetPath.makeRelativeTo(makeRelativeTo);
  factory.moveFolder(type,sourceMakeRelativeTo,targetMakeRelativeTo);
  if (targetMakeRelativeTo.isEmpty()) {
    completeNewPath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + sourceMakeRelativeTo.lastSegment();
  }
 else {
    completeNewPath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + targetMakeRelativeTo.toString()+ IPath.SEPARATOR+ sourceMakeRelativeTo.lastSegment();
  }
  RepositoryNode sourceParent=sourceNode.getParent();
  RepositoryNode targetParent=targetNode.getParent();
  CorePlugin.getDefault().refreshDQView(sourceParent);
  CorePlugin.getDefault().refreshDQView(targetParent);
  FolderItem emfFolder=folderHelper.getFolder(completeNewPath);
  computeDependcy(emfFolder);
}

Fixed version (ground truth):
private void computePath(FolderHelper folderHelper,IPath sourcePath,IPath targetPath,IPath makeRelativeTo,ERepositoryObjectType type,IRepositoryNode sourceNode,IRepositoryNode targetNode) throws PersistenceException {
  String completeNewPath=null;
  IPath sourceMakeRelativeTo=sourcePath.makeRelativeTo(makeRelativeTo);
  IPath targetMakeRelativeTo=targetPath.makeRelativeTo(makeRelativeTo);
  factory.moveFolder(type,sourceMakeRelativeTo,targetMakeRelativeTo);
  if (targetMakeRelativeTo.isEmpty()) {
    completeNewPath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + sourceMakeRelativeTo.lastSegment();
  }
 else {
    completeNewPath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + targetMakeRelativeTo.toString()+ IPath.SEPARATOR+ sourceMakeRelativeTo.lastSegment();
  }
  RepositoryNode sourceParent=sourceNode.getParent();
  RepositoryNode targetParent=targetNode.getParent();
  CorePlugin.getDefault().refreshDQView(sourceParent);
  CorePlugin.getDefault().refreshDQView(targetParent);
  FolderItem emfFolder=folderHelper.getFolder(completeNewPath);
}
Program: 138147
Project: 138147
Buggy source:
/** 
 * DOC qiongli Comment method "lock".
 * @param item
 */
public void lock(final Item item){
  if (!isReadOnly() && item != null) {
    if (!item.eIsProxy()) {
      try {
        ProxyRepositoryFactory.getInstance().lock(item);
        CommonViewer commonViewer=RepositoryNodeHelper.getDQCommonViewer();
        if (commonViewer != null) {
          commonViewer.refresh();
        }
      }
 catch (      PersistenceException e) {
        log.error(e,e);
      }
catch (      LoginException e) {
        log.error(e,e);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC qiongli Comment method "lock".
 * @param item
 */
public void lock(final Item item){
  if (!isReadOnly() && item != null) {
    if (!item.eIsProxy()) {
      try {
        ProxyRepositoryFactory.getInstance().lock(item);
      }
 catch (      PersistenceException e) {
        log.error(e,e);
      }
catch (      LoginException e) {
        log.error(e,e);
      }
    }
  }
}
Program: 138148
Project: 138148
Buggy source:
/** 
 * DOC qiongli Comment method "unLock".
 * @param item
 */
public void unLock(final Item item){
  if (!isReadOnly() & item != null) {
    try {
      ProxyRepositoryFactory.getInstance().unlock(item);
      CommonViewer commonViewer=RepositoryNodeHelper.getDQCommonViewer();
      if (commonViewer != null) {
        commonViewer.refresh();
      }
    }
 catch (    PersistenceException e) {
      log.error(e,e);
    }
catch (    LoginException e) {
      log.error(e,e);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC qiongli Comment method "unLock".
 * @param item
 */
public void unLock(final Item item){
  if (!isReadOnly() & item != null) {
    try {
      ProxyRepositoryFactory.getInstance().unlock(item);
    }
 catch (    PersistenceException e) {
      log.error(e,e);
    }
catch (    LoginException e) {
      log.error(e,e);
    }
  }
}
Program: 138150
Project: 138150
Buggy source:
@Override public void partClosed(IWorkbenchPart part){
  if (!isCommonFormEditor(part)) {
    return;
  }
  Item item=getItem((IEditorPart)part);
  if (item == null) {
    return;
  }
  if (ProxyRepositoryManager.getInstance().isReadOnly() || ProxyRepositoryManager.getInstance().isEditable(item)) {
    ProxyRepositoryManager.getInstance().unLock(item);
  }
 else {
    ProxyRepositoryManager.getInstance().refresh();
    CorePlugin.getDefault().refreshDQView();
  }
  super.partClosed(part);
}

Fixed version (ground truth):
@Override public void partClosed(IWorkbenchPart part){
  if (!isCommonFormEditor(part)) {
    return;
  }
  Item item=getItem((IEditorPart)part);
  if (item == null) {
    return;
  }
  if (ProxyRepositoryManager.getInstance().isReadOnly() || ProxyRepositoryManager.getInstance().isEditable(item)) {
    ProxyRepositoryManager.getInstance().unLock(item);
    RepositoryNode recursiveFind=RepositoryNodeHelper.recursiveFind(item.getProperty());
    CommonViewer dqCommonViewer=RepositoryNodeHelper.getDQCommonViewer();
    if (dqCommonViewer != null && null != recursiveFind) {
      dqCommonViewer.refresh(recursiveFind);
    }
 else {
      CorePlugin.getDefault().refreshDQView();
    }
  }
 else {
    ProxyRepositoryManager.getInstance().refresh();
    CorePlugin.getDefault().refreshDQView();
  }
  super.partClosed(part);
}
Program: 138151
Project: 138151
Buggy source:
@Override public void partOpened(IWorkbenchPart part){
  if (!isCommonFormEditor(part)) {
    return;
  }
  Item item=getItem((IEditorPart)part);
  if (item == null) {
    return;
  }
  CorePlugin.getDefault().refreshWorkSpace();
  if (ProxyRepositoryManager.getInstance().isReadOnly() || !ProxyRepositoryManager.getInstance().isEditable(item)) {
    MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),"String_Node_Str",part.getTitle() + "String_Node_Str" + ProxyRepositoryFactory.getInstance().getStatus(item).name()+ "String_Node_Str");
    lockCommonFormEditor(part);
    CorePlugin.getDefault().refreshDQView();
    return;
  }
  ProxyRepositoryManager.getInstance().lock(item);
  super.partOpened(part);
}

Fixed version (ground truth):
@Override public void partOpened(IWorkbenchPart part){
  if (!isCommonFormEditor(part)) {
    return;
  }
  Item item=getItem((IEditorPart)part);
  if (item == null) {
    return;
  }
  CorePlugin.getDefault().refreshWorkSpace();
  if (ProxyRepositoryManager.getInstance().isReadOnly() || !ProxyRepositoryManager.getInstance().isEditable(item)) {
    MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),"String_Node_Str",part.getTitle() + "String_Node_Str" + ProxyRepositoryFactory.getInstance().getStatus(item).name()+ "String_Node_Str");
    lockCommonFormEditor(part);
    CorePlugin.getDefault().refreshDQView();
    return;
  }
  ProxyRepositoryManager.getInstance().lock(item);
  RepositoryNode recursiveFind=RepositoryNodeHelper.recursiveFind(item.getProperty());
  CommonViewer dqCommonViewer=RepositoryNodeHelper.getDQCommonViewer();
  if (dqCommonViewer != null && null != recursiveFind) {
    dqCommonViewer.refresh(recursiveFind);
  }
 else {
    CorePlugin.getDefault().refreshDQView();
  }
  super.partOpened(part);
}
Program: 138152
Project: 138152
Buggy source:
@Override public void postWindowOpen(){
  this.getWindowConfigurer().getWindow().getShell().setMaximized(true);
  super.postWindowOpen();
  ChangePerspectiveAction.getAction().switchTitle();
}

Fixed version (ground truth):
@Override public void postWindowOpen(){
  this.getWindowConfigurer().getWindow().getShell().setMaximized(true);
  super.postWindowOpen();
  ChangePerspectiveAction.getAction().switchTitle();
  ITDQRepositoryService tdqRepositoryService=(ITDQRepositoryService)org.talend.core.GlobalServiceRegister.getDefault().getService(ITDQRepositoryService.class);
  if (tdqRepositoryService != null) {
    tdqRepositoryService.addPartListener();
  }
}
Program: 138155
Project: 138155
Buggy source:
/** 
 * DOC xqliu IndicatorSelectDialog constructor comment.
 * @param parentShell
 * @param title
 * @param modelElementIndicators
 * @deprecated
 */
public IndicatorSelectDialog(Shell parentShell,String title,ModelElementIndicator[] modelElementIndicators){
  this(parentShell,title,modelElementIndicators,null);
  Object editorPart=CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (editorPart instanceof AnalysisEditor) {
    AnalysisEditor analyEditor=(AnalysisEditor)editorPart;
    if (analyEditor.getMasterPage() instanceof ColumnMasterDetailsPage) {
      this.language=ExecutionLanguage.get(((ColumnMasterDetailsPage)analyEditor.getMasterPage()).getExecCombo().getText());
      DataManager connection=((ColumnMasterDetailsPage)analyEditor.getMasterPage()).getAnalysis().getContext().getConnection();
      if (connection == null && modelElementIndicators.length > 0) {
      }
      this.dbms=DbmsLanguageFactory.createDbmsLanguage(connection);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC xqliu IndicatorSelectDialog constructor comment.
 * @param parentShell
 * @param title
 * @param modelElementIndicators
 * @deprecated
 */
public IndicatorSelectDialog(Shell parentShell,String title,ModelElementIndicator[] modelElementIndicators){
  this(parentShell,title,modelElementIndicators,null);
  Object editorPart=CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (editorPart instanceof AnalysisEditor) {
    AnalysisEditor analyEditor=(AnalysisEditor)editorPart;
    if (analyEditor.getMasterPage() instanceof ColumnMasterDetailsPage) {
      this.language=ExecutionLanguage.get(((ColumnMasterDetailsPage)analyEditor.getMasterPage()).getExecCombo().getText());
      DataManager connection=((ColumnMasterDetailsPage)analyEditor.getMasterPage()).getAnalysis().getContext().getConnection();
      if (connection == null && modelElementIndicators.length > 0) {
      }
      this.dbms=DbmsLanguageFactory.createDbmsLanguage(connection);
    }
  }
  for (  ModelElementIndicator modelElementIndicator : getResult()) {
    modelElementIndicator.copyOldIndicatorEnum();
  }
}
Program: 138158
Project: 138158
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  int toPage=pageGoTo.getSelectionIndex() + 1;
  loadPageTempIndicator(toPage);
  currentPage=toPage;
  tree.dispose();
  buttomComp.dispose();
  if (IndicatorSelectDialog.this.parent != null) {
    initializationTree(IndicatorSelectDialog.this.parent);
    IndicatorSelectDialog.this.parent.layout();
  }
  if (currentPage == 1) {
    pageFirstImgHypLnk.setEnabled(false);
    pagePreviouseImgHypLnk.setEnabled(false);
    pageNextImgHypLnk.setEnabled(true);
    pageLastImgHypLnk.setEnabled(true);
    okButton.setEnabled(false);
  }
 else   if (currentPage == totalPages) {
    pageFirstImgHypLnk.setEnabled(true);
    pagePreviouseImgHypLnk.setEnabled(true);
    pageNextImgHypLnk.setEnabled(false);
    pageLastImgHypLnk.setEnabled(false);
    okButton.setEnabled(true);
  }
 else {
    pageFirstImgHypLnk.setEnabled(true);
    pagePreviouseImgHypLnk.setEnabled(true);
    pageNextImgHypLnk.setEnabled(true);
    pageLastImgHypLnk.setEnabled(true);
    okButton.setEnabled(false);
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  int toPage=pageGoTo.getSelectionIndex() + 1;
  currentPage=toPage;
  tree.dispose();
  buttomComp.dispose();
  if (IndicatorSelectDialog.this.parent != null) {
    initializationTree(IndicatorSelectDialog.this.parent);
    IndicatorSelectDialog.this.parent.layout();
  }
  if (currentPage == 1) {
    pageFirstImgHypLnk.setEnabled(false);
    pagePreviouseImgHypLnk.setEnabled(false);
    pageNextImgHypLnk.setEnabled(true);
    pageLastImgHypLnk.setEnabled(true);
    okButton.setEnabled(false);
  }
 else   if (currentPage == totalPages) {
    pageFirstImgHypLnk.setEnabled(true);
    pagePreviouseImgHypLnk.setEnabled(true);
    pageNextImgHypLnk.setEnabled(false);
    pageLastImgHypLnk.setEnabled(false);
    okButton.setEnabled(true);
  }
 else {
    pageFirstImgHypLnk.setEnabled(true);
    pagePreviouseImgHypLnk.setEnabled(true);
    pageNextImgHypLnk.setEnabled(true);
    pageLastImgHypLnk.setEnabled(true);
    okButton.setEnabled(false);
  }
}
Program: 138159
Project: 138159
Buggy source:
@Override public void mouseUp(MouseEvent e){
  if (currentPage != totalPages) {
    loadPageTempIndicator(totalPages);
    currentPage=totalPages;
    tree.dispose();
    buttomComp.dispose();
    if (IndicatorSelectDialog.this.parent != null) {
      initializationTree(IndicatorSelectDialog.this.parent);
      IndicatorSelectDialog.this.parent.layout();
    }
    pageFirstImgHypLnk.setEnabled(true);
    pagePreviouseImgHypLnk.setEnabled(true);
    pageNextImgHypLnk.setEnabled(false);
    pageLastImgHypLnk.setEnabled(false);
    okButton.setEnabled(true);
    pageGoTo.select(currentPage - 1);
  }
}

Fixed version (ground truth):
@Override public void mouseUp(MouseEvent e){
  if (currentPage != totalPages) {
    currentPage=totalPages;
    tree.dispose();
    buttomComp.dispose();
    if (IndicatorSelectDialog.this.parent != null) {
      initializationTree(IndicatorSelectDialog.this.parent);
      IndicatorSelectDialog.this.parent.layout();
    }
    pageFirstImgHypLnk.setEnabled(true);
    pagePreviouseImgHypLnk.setEnabled(true);
    pageNextImgHypLnk.setEnabled(false);
    pageLastImgHypLnk.setEnabled(false);
    okButton.setEnabled(true);
    pageGoTo.select(currentPage - 1);
  }
}
Program: 138160
Project: 138160
Buggy source:
/** 
 * DOC bZhou Comment method "getIndicatorPercentValue".
 * @param indicator, never null
 * @return null in case of error
 */
public static String getIndicatorPercentValue(Indicator indicator){
  try {
    String indicatorValue=getIndicatorValue(indicator);
    if (indicatorValue != null) {
      double userCount=NumberFormat.getInstance().parse(indicatorValue).doubleValue();
      double count=Double.valueOf(indicator.getCount());
      return computePercent(userCount,count);
    }
  }
 catch (  NumberFormatException e) {
    log.warn("String_Node_Str" + indicator.getName(),e);
  }
catch (  ParseException e) {
    log.warn("String_Node_Str" + indicator.getName(),e);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getIndicatorPercentValue".
 * @param indicator, never null
 * @return null in case of error
 */
public static String getIndicatorPercentValue(Indicator indicator){
  try {
    String indicatorValue=getIndicatorValue(indicator);
    if (indicatorValue != null) {
      if (IndicatorsPackage.eINSTANCE.getModeIndicator().equals(indicator.eClass())) {
        return null;
      }
      double userCount=NumberFormat.getInstance().parse(indicatorValue).doubleValue();
      double count=Double.valueOf(indicator.getCount());
      return computePercent(userCount,count);
    }
  }
 catch (  NumberFormatException e) {
    log.warn("String_Node_Str" + indicator.getName(),e);
  }
catch (  ParseException e) {
    log.warn("String_Node_Str" + indicator.getName(),e);
  }
  return null;
}
Program: 138161
Project: 138161
Buggy source:
public String trimIfBlank(String colName){
  return "String_Node_Str" + trim(colName) + "String_Node_Str"+ colName+ "String_Node_Str";
}

Fixed version (ground truth):
public String trimIfBlank(String colName){
  return "String_Node_Str" + charLength(trim(colName)) + "String_Node_Str"+ colName+ "String_Node_Str";
}
Program: 138162
Project: 138162
Buggy source:
@Override public String getAverageLengthWithBlankRows(){
  String whereExpression="String_Node_Str";
  return "String_Node_Str" + trimIfBlank("String_Node_Str") + "String_Node_Str"+ trimIfBlank("String_Node_Str")+ "String_Node_Str"+ whereExpression+ "String_Node_Str"+ trimIfBlank("String_Node_Str")+ "String_Node_Str"+ whereExpression+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getAverageLengthWithBlankRows(){
  String sql="String_Node_Str" + charLength(trimIfBlank("String_Node_Str")) + "String_Node_Str"+ "String_Node_Str"+ charLength(trimIfBlank("String_Node_Str"))+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ charLength(trimIfBlank("String_Node_Str"))+ "String_Node_Str";
  return sql;
}
Program: 138163
Project: 138163
Buggy source:
@Override public String getAverageLengthWithNullBlankRows(){
  return "String_Node_Str" + trimIfBlank("String_Node_Str") + "String_Node_Str"+ trimIfBlank("String_Node_Str")+ "String_Node_Str"+ trimIfBlank("String_Node_Str")+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getAverageLengthWithNullBlankRows(){
  String sql="String_Node_Str" + charLength(trimIfBlank("String_Node_Str")) + "String_Node_Str"+ "String_Node_Str"+ charLength(trimIfBlank("String_Node_Str"))+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ charLength(trimIfBlank("String_Node_Str"))+ "String_Node_Str";
  return sql;
}
Program: 138164
Project: 138164
Buggy source:
@Override public PieDataset getPieDataset(){
  DefaultPieDataset dataset=new DefaultPieDataset();
  for (  IndicatorUnit unit : units) {
    if (unit.isExcuted()) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])unit.getValue();
      ComparatorsFactory.sort(frequencyExt,ComparatorsFactory.TEXT_STATISTICS_COMPARATOR_ID);
      int numOfShown=frequencyExt.length;
      for (int i=0; i < numOfShown; i++) {
        FrequencyExt freqExt=frequencyExt[i];
        String keyLabel=String.valueOf(freqExt.getKey());
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.NULL_FIELD;
        }
        if (PluginConstant.EMPTY_STRING.equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.EMPTY_FIELD;
        }
        Double percent=freqExt.getFrequency();
        dataset.setValue(keyLabel,percent);
      }
    }
  }
  return dataset;
}

Fixed version (ground truth):
@Override public PieDataset getPieDataset(){
  DefaultPieDataset dataset=new DefaultPieDataset();
  for (  IndicatorUnit unit : units) {
    if (unit.isExcuted()) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])unit.getValue();
      ComparatorsFactory.sort(frequencyExt,ComparatorsFactory.FREQUENCY_COMPARATOR_ID);
      int numOfShown=frequencyExt.length;
      for (int i=0; i < numOfShown; i++) {
        FrequencyExt freqExt=frequencyExt[i];
        String keyLabel=String.valueOf(freqExt.getKey());
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.NULL_FIELD;
        }
        if (PluginConstant.EMPTY_STRING.equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.EMPTY_FIELD;
        }
        Double percent=freqExt.getFrequency();
        dataset.setValue(keyLabel,percent);
      }
    }
  }
  return dataset;
}
Program: 138165
Project: 138165
Buggy source:
@Override protected Connection findDataProvider(){
  Connection provider=null;
  if (selectedObj instanceof RepositoryNode) {
    if (selectedObj instanceof DBTableFolderRepNode || selectedObj instanceof DBViewFolderRepNode) {
      provider=ConnectionHelper.getTdDataProvider(getPackageFromObject(selectedObj));
    }
    Item connItem=((RepositoryNode)selectedObj).getObject().getProperty().getItem();
    provider=((ConnectionItem)connItem).getConnection();
  }
 else   if (selectedObj instanceof Package) {
    provider=ConnectionHelper.getTdDataProvider((Package)selectedObj);
  }
  return provider;
}

Fixed version (ground truth):
@Override protected Connection findDataProvider(){
  Connection provider=null;
  if (selectedObj instanceof RepositoryNode) {
    if (selectedObj instanceof DBTableFolderRepNode || selectedObj instanceof DBViewFolderRepNode) {
      provider=ConnectionHelper.getTdDataProvider(getPackageFromObject(selectedObj));
    }
    Item connItem=null;
    IRepositoryViewObject object=((RepositoryNode)selectedObj).getObject();
    if (null != object) {
      connItem=object.getProperty().getItem();
    }
 else {
      connItem=((RepositoryNode)selectedObj).getParent().getObject().getProperty().getItem();
    }
    provider=((ConnectionItem)connItem).getConnection();
  }
 else   if (selectedObj instanceof Package) {
    provider=ConnectionHelper.getTdDataProvider((Package)selectedObj);
  }
  return provider;
}
Program: 138169
Project: 138169
Buggy source:
public static boolean canOpenEditor(RepositoryNode node){
  return node instanceof AnalysisRepNode || node instanceof SysIndicatorDefinitionRepNode || node instanceof PatternRepNode|| node instanceof JrxmlTempleteRepNode|| node instanceof SourceFileRepNode|| node instanceof RuleRepNode|| node instanceof DBConnectionRepNode|| node instanceof MDMConnectionRepNode|| node instanceof ReportRepNode|| node instanceof ReportFileRepNode;
}

Fixed version (ground truth):
public static boolean canOpenEditor(RepositoryNode node){
  return node instanceof AnalysisRepNode || node instanceof SysIndicatorDefinitionRepNode || node instanceof PatternRepNode|| node instanceof JrxmlTempleteRepNode|| node instanceof SourceFileRepNode|| node instanceof RuleRepNode|| node instanceof DBConnectionRepNode|| node instanceof MDMConnectionRepNode|| node instanceof ReportRepNode|| node instanceof ReportFileRepNode|| node instanceof ReportAnalysisRepNode;
}
Program: 138170
Project: 138170
Buggy source:
/** 
 * build RepositoryNode(Analysis) children according to IResource array.
 * @param analyses
 * @return
 */
private List<IRepositoryNode> buildChildrenAnalysis(List<Analysis> analyses){
  List<IRepositoryNode> nodes=new ArrayList<IRepositoryNode>();
  for (  Analysis analysis : analyses) {
    ModelElement anaEleModelElement=analysis.getModelElement();
    if (null == anaEleModelElement) {
      continue;
    }
    Property anaEleProperty=PropertyHelper.getProperty(anaEleModelElement);
    IRepositoryViewObject medataViewObject=null;
    try {
      medataViewObject=ProxyRepositoryFactory.getInstance().getLastVersion(anaEleProperty.getId());
    }
 catch (    Exception e) {
      log.error(e);
    }
    ReportAnalysisRepNode node=new ReportAnalysisRepNode(medataViewObject,this,ENodeType.TDQ_REPOSITORY_ELEMENT);
    node.setReport(this.getReport());
    node.setAnalysis(analysis);
    node.setId(this.getReport().getName() + analysis.getName());
    nodes.add(node);
  }
  if (nodes.size() > 0) {
    this.getReportSubFolderChildren().clear();
    this.getReportSubFolderChildren().addAll(nodes);
  }
  return this.getReportSubFolderChildren();
}

Fixed version (ground truth):
/** 
 * build RepositoryNode(Analysis) children according to IResource array.
 * @param analyses
 * @return
 */
private List<IRepositoryNode> buildChildrenAnalysis(List<Analysis> analyses){
  List<IRepositoryNode> nodes=new ArrayList<IRepositoryNode>();
  for (  Analysis analysis : analyses) {
    Property anaEleProperty=PropertyHelper.getProperty(analysis);
    IRepositoryViewObject viewObject=null;
    try {
      viewObject=ProxyRepositoryFactory.getInstance().getLastVersion(anaEleProperty.getId());
    }
 catch (    Exception e) {
      log.error(e);
    }
    if (null == viewObject) {
      continue;
    }
    ReportAnalysisRepNode node=new ReportAnalysisRepNode(viewObject,this,ENodeType.TDQ_REPOSITORY_ELEMENT);
    node.setReport(this.getReport());
    node.setAnalysis(analysis);
    node.setId(this.getReport().getName() + analysis.getName());
    nodes.add(node);
  }
  if (nodes.size() > 0) {
    this.getReportSubFolderChildren().clear();
    this.getReportSubFolderChildren().addAll(nodes);
  }
  return this.getReportSubFolderChildren();
}