nus-yam/ex-repair huggingface dataset:
Program: 136855
Project: 136855
Buggy source:
private Object createDataset(){
  String s=DefaultMessagesImpl.getString("String_Node_Str");
  String[] array=groupSize2GroupFrequency.keySet().toArray(new String[0]);
  List<String> groups=Arrays.asList(array);
  Collections.sort(groups,new Comparator<String>(){
    @Override public int compare(    String o1,    String o2){
      return Integer.parseInt(o1) - Integer.parseInt(o2);
    }
  }
);
  return TOPChartUtil.getInstance().createDatasetForMatchRule(groupSize2GroupFrequency,groups,times,s);
}

Fixed version (ground truth):
private Object createDataset(){
  String s=DefaultMessagesImpl.getString("String_Node_Str");
  if (groupSize2GroupFrequency != null) {
    String[] array=groupSize2GroupFrequency.keySet().toArray(new String[0]);
    List<String> groups=Arrays.asList(array);
    Collections.sort(groups,new Comparator<String>(){
      @Override public int compare(      String o1,      String o2){
        return Integer.parseInt(o1) - Integer.parseInt(o2);
      }
    }
);
    return TOPChartUtil.getInstance().createDatasetForMatchRule(groupSize2GroupFrequency,groups,times,s);
  }
 else {
    return TOPChartUtil.getInstance().createDatasetForMatchRule(groupSize2GroupFrequency,null,times,s);
  }
}
Program: 136856
Project: 136856
Buggy source:
@Override public void modifyText(ModifyEvent e){
  Long currentRunTime=System.currentTimeMillis();
  if (taskList.size() > 0) {
    RunModifyTimerTask oldRunTask=taskList.get(0);
    if (currentRunTime - oldRunTask.getTaskRunTime() < DELAY_RUN_GROUP_LESS_THEN) {
      oldRunTask.cancel();
      taskList.clear();
    }
  }
  RunModifyTimerTask runModifyTimerTask=new RunModifyTimerTask(currentRunTime,lessSpin.getText().trim());
  timer.schedule(runModifyTimerTask,DELAY_RUN_GROUP_LESS_THEN);
  taskList.add(runModifyTimerTask);
}

Fixed version (ground truth):
@Override public void modifyText(ModifyEvent e){
  Long currentRunTime=System.currentTimeMillis();
  if (taskList.size() > 0) {
    RunModifyTimerTask oldRunTask=taskList.get(0);
    if (currentRunTime - oldRunTask.getTaskRunTime() < DELAY_RUN_GROUP_LESS_THEN) {
      oldRunTask.cancel();
      taskList.clear();
    }
  }
  RunModifyTimerTask runModifyTimerTask=new RunModifyTimerTask(currentRunTime,lessSpin.getText().trim());
  new Timer().schedule(runModifyTimerTask,DELAY_RUN_GROUP_LESS_THEN);
  taskList.add(runModifyTimerTask);
}
Program: 136857
Project: 136857
Buggy source:
/** 
 * DOC zshen Comment method "createHideGroupComposite".
 * @param chartComposite
 */
protected void createHideGroupComposite(Composite chartComposite){
  GridData gridData;
  Composite toolComp=toolkit.createComposite(chartComposite,SWT.NONE);
  gridData=new GridData(GridData.FILL_HORIZONTAL);
  toolComp.setLayoutData(gridData);
  GridLayout gridLayout=new GridLayout(3,false);
  toolComp.setLayout(gridLayout);
  Label lessText=new Label(toolComp,SWT.NONE);
  lessText.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  final Spinner lessSpin=new Spinner(toolComp,SWT.BORDER);
  lessSpin.setMinimum(1);
  lessSpin.setMaximum(Integer.MAX_VALUE);
  lessSpin.setTextLimit(9);
  lessSpin.setSelection(PluginConstant.HIDDEN_GROUP_LESS_THAN_DEFAULT);
  lessSpin.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    ModifyEvent e){
      Long currentRunTime=System.currentTimeMillis();
      if (taskList.size() > 0) {
        RunModifyTimerTask oldRunTask=taskList.get(0);
        if (currentRunTime - oldRunTask.getTaskRunTime() < DELAY_RUN_GROUP_LESS_THEN) {
          oldRunTask.cancel();
          taskList.clear();
        }
      }
      RunModifyTimerTask runModifyTimerTask=new RunModifyTimerTask(currentRunTime,lessSpin.getText().trim());
      timer.schedule(runModifyTimerTask,DELAY_RUN_GROUP_LESS_THEN);
      taskList.add(runModifyTimerTask);
    }
  }
);
  Label lessText2=new Label(toolComp,SWT.NONE);
  lessText2.setText(DefaultMessagesImpl.getString("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "createHideGroupComposite".
 * @param chartComposite
 */
protected void createHideGroupComposite(Composite chartComposite){
  GridData gridData;
  Composite toolComp=toolkit.createComposite(chartComposite,SWT.NONE);
  gridData=new GridData(GridData.FILL_HORIZONTAL);
  toolComp.setLayoutData(gridData);
  GridLayout gridLayout=new GridLayout(3,false);
  toolComp.setLayout(gridLayout);
  Label lessText=new Label(toolComp,SWT.NONE);
  lessText.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  final Spinner lessSpin=new Spinner(toolComp,SWT.BORDER);
  lessSpin.setMinimum(1);
  lessSpin.setMaximum(Integer.MAX_VALUE);
  lessSpin.setTextLimit(9);
  lessSpin.setSelection(PluginConstant.HIDDEN_GROUP_LESS_THAN_DEFAULT);
  lessSpin.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    ModifyEvent e){
      Long currentRunTime=System.currentTimeMillis();
      if (taskList.size() > 0) {
        RunModifyTimerTask oldRunTask=taskList.get(0);
        if (currentRunTime - oldRunTask.getTaskRunTime() < DELAY_RUN_GROUP_LESS_THEN) {
          oldRunTask.cancel();
          taskList.clear();
        }
      }
      RunModifyTimerTask runModifyTimerTask=new RunModifyTimerTask(currentRunTime,lessSpin.getText().trim());
      new Timer().schedule(runModifyTimerTask,DELAY_RUN_GROUP_LESS_THEN);
      taskList.add(runModifyTimerTask);
    }
  }
);
  Label lessText2=new Label(toolComp,SWT.NONE);
  lessText2.setText(DefaultMessagesImpl.getString("String_Node_Str"));
}
Program: 136858
Project: 136858
Buggy source:
/** 
 * Adds a submenu to the given menu with the name "New Component".
 */
@Override public void fillContextMenu(IMenuManager menu){
  if (!isShowMenu()) {
    return;
  }
  Object obj=((TreeSelection)this.getContext().getSelection()).getFirstElement();
  RepositoryNode node=(RepositoryNode)obj;
  RepositoryNode parent=node.getParent();
  if (!(parent instanceof ReportSubFolderRepNode)) {
    if (parent != null) {
      IFolder folder=WorkbenchUtils.getFolder(node);
      if (!(node instanceof ExchangeFolderRepNode) && !ResourceManager.getRulesFolder().equals(folder) && !ResourceManager.getPatternFolder().equals(folder)&& !ResourceManager.getIndicatorFolder().equals(folder)&& !ResourceService.isSubFolder(ResourceManager.getSystemIndicatorFolder(),folder)&& (ENodeType.SYSTEM_FOLDER.equals(node.getType()) || ENodeType.SIMPLE_FOLDER.equals(node.getType()))&& !(node instanceof HDFSOfHCFolderRepNode || node instanceof HiveOfHCFolderRepNode)) {
        if (node.getObject() != null && !node.getObject().getProperty().getItem().getState().isDeleted()) {
          currentSelection=WorkbenchUtils.getFolder(node);
          CreateRepositoryNodeAction createSubFolderAction=new CreateRepositoryNodeAction(currentSelection);
          menu.add(createSubFolderAction);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds a submenu to the given menu with the name "New Component".
 */
@Override public void fillContextMenu(IMenuManager menu){
  if (!isShowMenu()) {
    return;
  }
  if (isExchangeNode()) {
    return;
  }
  Object obj=((TreeSelection)this.getContext().getSelection()).getFirstElement();
  RepositoryNode node=(RepositoryNode)obj;
  RepositoryNode parent=node.getParent();
  if (!(parent instanceof ReportSubFolderRepNode)) {
    if (parent != null) {
      IFolder folder=WorkbenchUtils.getFolder(node);
      if (!(node instanceof ExchangeFolderRepNode) && !ResourceManager.getRulesFolder().equals(folder) && !ResourceManager.getPatternFolder().equals(folder)&& !ResourceManager.getIndicatorFolder().equals(folder)&& !ResourceService.isSubFolder(ResourceManager.getSystemIndicatorFolder(),folder)&& (ENodeType.SYSTEM_FOLDER.equals(node.getType()) || ENodeType.SIMPLE_FOLDER.equals(node.getType()))&& !(node instanceof HDFSOfHCFolderRepNode || node instanceof HiveOfHCFolderRepNode)) {
        if (node.getObject() != null && !node.getObject().getProperty().getItem().getState().isDeleted()) {
          currentSelection=WorkbenchUtils.getFolder(node);
          CreateRepositoryNodeAction createSubFolderAction=new CreateRepositoryNodeAction(currentSelection);
          menu.add(createSubFolderAction);
        }
      }
    }
  }
}
Program: 136859
Project: 136859
Buggy source:
/** 
 * Adds a submenu to the given menu with the name "New Component".
 */
@Override public void fillContextMenu(IMenuManager menu){
  if (!isShowMenu()) {
    return;
  }
  Object obj=((TreeSelection)this.getContext().getSelection()).getFirstElement();
  if (obj instanceof RepositoryNode) {
    RepositoryNode node=(RepositoryNode)obj;
    if (shouldShowDeleteMenu(node)) {
      menu.add(new DQDeleteAction());
      if (shouldShowRenameFolderMenu(node)) {
        Object type=node.getProperties(EProperties.CONTENT_TYPE);
        if (ERepositoryObjectType.TDQ_JRAXML_ELEMENT.equals(type)) {
          menu.add(new RenameJrxmlFolderAction(node));
        }
 else {
          menu.add(new RenameTdqFolderAction(node));
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds a submenu to the given menu with the name "New Component".
 */
@Override public void fillContextMenu(IMenuManager menu){
  if (!isShowMenu()) {
    return;
  }
  if (isExchangeNode()) {
    return;
  }
  Object obj=((TreeSelection)this.getContext().getSelection()).getFirstElement();
  if (obj instanceof RepositoryNode) {
    RepositoryNode node=(RepositoryNode)obj;
    if (shouldShowDeleteMenu(node)) {
      menu.add(new DQDeleteAction());
      if (shouldShowRenameFolderMenu(node)) {
        Object type=node.getProperties(EProperties.CONTENT_TYPE);
        if (ERepositoryObjectType.TDQ_JRAXML_ELEMENT.equals(type)) {
          menu.add(new RenameJrxmlFolderAction(node));
        }
 else {
          menu.add(new RenameTdqFolderAction(node));
        }
      }
    }
  }
}
Program: 136860
Project: 136860
Buggy source:
@Override public void fillContextMenu(IMenuManager menu){
  if (!isShowMenuWhenIsReadonlyUser()) {
    return;
  }
  TreeSelection selection=(TreeSelection)this.getContext().getSelection();
  Object[] objs=selection.toArray();
  if (shouldShowMenu(objs)) {
    List<IRepositoryNode> repositoryNodeList=RepositoryNodeHelper.getRepositoryNodeList(objs);
    DuplicateAction duplicate=new DuplicateAction(repositoryNodeList.toArray(new IRepositoryNode[repositoryNodeList.size()]));
    menu.add(duplicate);
  }
}

Fixed version (ground truth):
@Override public void fillContextMenu(IMenuManager menu){
  if (!isShowMenuWhenIsReadonlyUser()) {
    return;
  }
  if (isExchangeNode()) {
    return;
  }
  TreeSelection selection=(TreeSelection)this.getContext().getSelection();
  Object[] objs=selection.toArray();
  if (shouldShowMenu(objs)) {
    List<IRepositoryNode> repositoryNodeList=RepositoryNodeHelper.getRepositoryNodeList(objs);
    DuplicateAction duplicate=new DuplicateAction(repositoryNodeList.toArray(new IRepositoryNode[repositoryNodeList.size()]));
    menu.add(duplicate);
  }
}
Program: 136862
Project: 136862
Buggy source:
/** 
 * DOC mzhao Comment method "isSameType". MOD mzhao 9848 2010-01-14, Allowing drag table.
 * @param model1
 * @param model2
 * @return
 */
static boolean isSameType(Object model1,Object model2){
  if ((model1 instanceof TdTable || model1 instanceof TdColumn) && (model2 instanceof TdTable || model2 instanceof TdColumn)) {
    if (model1 instanceof TdTable && model2 instanceof TdTable) {
      return true;
    }
 else     if (model1 instanceof TdColumn && model2 instanceof TdColumn) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC mzhao Comment method "isSameType". MOD mzhao 9848 2010-01-14, Allowing drag table.
 * @param model1
 * @param model2
 * @return
 */
static boolean isSameType(Object model1,Object model2){
  if (model1 instanceof TdTable && model2 instanceof TdTable) {
    return true;
  }
  if (model1 instanceof TdColumn && model2 instanceof TdColumn) {
    return true;
  }
  return false;
}
Program: 136863
Project: 136863
Buggy source:
/** 
 * DOC yyin HDFSOfHCConnectionNode constructor comment.
 * @param object
 * @param parent
 * @param type
 */
public HDFSOfHCConnectionNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type){
  super(object,parent,type);
}

Fixed version (ground truth):
/** 
 * DOC yyin HDFSOfHCConnectionNode constructor comment.
 * @param object
 * @param parent
 * @param type
 */
public HDFSOfHCConnectionNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type,org.talend.core.model.general.Project inWhichProject){
  super(object,parent,type,inWhichProject);
}
Program: 136865
Project: 136865
Buggy source:
public HDFSOfHCFolderRepNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type){
  super(object,parent,type);
}

Fixed version (ground truth):
public HDFSOfHCFolderRepNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type,org.talend.core.model.general.Project inWhichProject){
  super(object,parent,type,inWhichProject);
}
Program: 136866
Project: 136866
Buggy source:
/** 
 * 1)The current node is under: hadoop/hadoopcluster, need to get the folder to shown as child: hadoop/hdfs, hadoop/hive, 2) only show hdfs or hive folder, when it has children.
 */
@Override public List<IRepositoryNode> getChildren(){
  List<IRepositoryNode> children=new ArrayList<IRepositoryNode>();
  HDFSOfHCFolderRepNode hdfsFolder=new HDFSOfHCFolderRepNode(this.getObject(),this,ENodeType.SIMPLE_FOLDER);
  HiveOfHCFolderRepNode hiveFolder=new HiveOfHCFolderRepNode(this.getObject(),this,ENodeType.SIMPLE_FOLDER);
  addSubFolder(children,hdfsFolder);
  addSubFolder(children,hiveFolder);
  return children;
}

Fixed version (ground truth):
/** 
 * 1)The current node is under: hadoop/hadoopcluster, need to get the folder to shown as child: hadoop/hdfs, hadoop/hive, 2) only show hdfs or hive folder, when it has children.
 */
@Override public List<IRepositoryNode> getChildren(){
  List<IRepositoryNode> children=new ArrayList<IRepositoryNode>();
  HDFSOfHCFolderRepNode hdfsFolder=new HDFSOfHCFolderRepNode(this.getObject(),this,ENodeType.SIMPLE_FOLDER,getProject());
  HiveOfHCFolderRepNode hiveFolder=new HiveOfHCFolderRepNode(this.getObject(),this,ENodeType.SIMPLE_FOLDER,getProject());
  addSubFolder(children,hdfsFolder);
  addSubFolder(children,hiveFolder);
  return children;
}
Program: 136867
Project: 136867
Buggy source:
/** 
 * DOC yyin HadoopClusterConnectionRepNode constructor comment.
 * @param object
 * @param parent
 * @param type
 */
public HadoopClusterConnectionRepNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type){
  super(object,parent,type);
}

Fixed version (ground truth):
/** 
 * DOC yyin HadoopClusterConnectionRepNode constructor comment.
 * @param object
 * @param parent
 * @param type
 */
public HadoopClusterConnectionRepNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type,org.talend.core.model.general.Project inWhichProject){
  super(object,parent,type,inWhichProject);
}
Program: 136868
Project: 136868
Buggy source:
@Override public List<IRepositoryNode> getChildren(boolean withDeleted){
  try {
    super.getChildren().clear();
    RootContainer<String,IRepositoryViewObject> tdqViewObjects=ProxyRepositoryFactory.getInstance().getTdqRepositoryViewObjects(HadoopClusterRepositoryNodeType.HADOOPCLUSTER,RepositoryNodeHelper.getPath(this).toString());
    for (    IRepositoryViewObject viewObject : tdqViewObjects.getMembers()) {
      if (!withDeleted && viewObject.isDeleted()) {
        continue;
      }
      HadoopClusterConnectionRepNode repNode=new HadoopClusterConnectionRepNode(viewObject,this,ENodeType.REPOSITORY_ELEMENT);
      repNode.setProperties(EProperties.LABEL,HadoopClusterRepositoryNodeType.HADOOPCLUSTER);
      repNode.setProperties(EProperties.CONTENT_TYPE,HadoopClusterRepositoryNodeType.HADOOPCLUSTER);
      viewObject.setRepositoryNode(repNode);
      super.getChildren().add(repNode);
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return filterResultsIfAny(super.getChildren());
}

Fixed version (ground truth):
@Override public List<IRepositoryNode> getChildren(boolean withDeleted){
  try {
    super.getChildren().clear();
    RootContainer<String,IRepositoryViewObject> tdqViewObjects=ProxyRepositoryFactory.getInstance().getTdqRepositoryViewObjects(HadoopClusterRepositoryNodeType.HADOOPCLUSTER,RepositoryNodeHelper.getPath(this).toString());
    for (    IRepositoryViewObject viewObject : tdqViewObjects.getMembers()) {
      if (!withDeleted && viewObject.isDeleted()) {
        continue;
      }
      HadoopClusterConnectionRepNode repNode=new HadoopClusterConnectionRepNode(viewObject,this,ENodeType.REPOSITORY_ELEMENT,getProject());
      repNode.setProperties(EProperties.LABEL,HadoopClusterRepositoryNodeType.HADOOPCLUSTER);
      repNode.setProperties(EProperties.CONTENT_TYPE,HadoopClusterRepositoryNodeType.HADOOPCLUSTER);
      viewObject.setRepositoryNode(repNode);
      super.getChildren().add(repNode);
    }
  }
 catch (  PersistenceException e) {
    log.error(e,e);
  }
  return filterResultsIfAny(super.getChildren());
}
Program: 136869
Project: 136869
Buggy source:
/** 
 * DOC yyin HadoopClusterFolderRepNode constructor comment.
 * @param object
 * @param parent
 * @param type
 */
public HadoopClusterFolderRepNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type){
  super(object,parent,type);
}

Fixed version (ground truth):
/** 
 * DOC yyin HadoopClusterFolderRepNode constructor comment.
 * @param object
 * @param parent
 * @param type
 */
public HadoopClusterFolderRepNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type,org.talend.core.model.general.Project inWhichProject){
  super(object,parent,type,inWhichProject);
}
Program: 136870
Project: 136870
Buggy source:
/** 
 * DOC yyin HadoopClusterSubFolderRepNode constructor comment.
 * @param object
 * @param parent
 * @param type
 */
public HadoopClusterSubFolderRepNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type){
  super(object,parent,type);
}

Fixed version (ground truth):
/** 
 * DOC yyin HadoopClusterSubFolderRepNode constructor comment.
 * @param object
 * @param parent
 * @param type
 */
public HadoopClusterSubFolderRepNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type,org.talend.core.model.general.Project inWhichProject){
  super(object,parent,type,inWhichProject);
}
Program: 136871
Project: 136871
Buggy source:
/** 
 * DOC yyin HiveOfHCConnectionNode constructor comment.
 * @param object
 * @param parent
 * @param type
 */
public HiveOfHCConnectionNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type){
  super(object,parent,type);
}

Fixed version (ground truth):
/** 
 * DOC yyin HiveOfHCConnectionNode constructor comment.
 * @param object
 * @param parent
 * @param type
 */
public HiveOfHCConnectionNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type,org.talend.core.model.general.Project inWhichProject){
  super(object,parent,type,inWhichProject);
}
Program: 136873
Project: 136873
Buggy source:
/** 
 * DOC yyin HiveOfHCFolderRepNode constructor comment.
 * @param object
 * @param parent
 * @param type
 */
public HiveOfHCFolderRepNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type){
  super(object,parent,type);
}

Fixed version (ground truth):
/** 
 * DOC yyin HiveOfHCFolderRepNode constructor comment.
 * @param object
 * @param parent
 * @param type
 */
public HiveOfHCFolderRepNode(IRepositoryViewObject object,RepositoryNode parent,ENodeType type,org.talend.core.model.general.Project inWhichProject){
  super(object,parent,type,inWhichProject);
}
Program: 136875
Project: 136875
Buggy source:
public void dragEnter(DropTargetEvent event){
  super.dragEnter(event);
  execValidation(event,doDropValidation(event,LocalSelectionTransfer.getTransfer()));
}

Fixed version (ground truth):
@Override public void dragEnter(DropTargetEvent event){
  super.dragEnter(event);
  execValidation(event,doDropValidation(event,LocalSelectionTransfer.getTransfer()));
}
Program: 136876
Project: 136876
Buggy source:
public boolean doDropValidation(DropTargetEvent event,LocalSelectionTransfer transfer){
  boolean ret=false;
  Object[] firstElements=((StructuredSelection)transfer.getSelection()).toArray();
  for (  Object object : firstElements) {
    if (object instanceof IFile) {
      IFile fe=(IFile)object;
      if (extension != null && extension.equals(fe.getFileExtension())) {
        ret=true;
      }
    }
 else     if (object instanceof IRepositoryNode) {
      IPath itemPath=PropertyHelper.getItemPath(((IRepositoryNode)object).getObject().getProperty());
      if (itemPath == null) {
        continue;
      }
      if (extension != null && extension.equals(itemPath.getFileExtension())) {
        ret=true;
      }
    }
    if (!ret) {
      break;
    }
  }
  return ret;
}

Fixed version (ground truth):
public boolean doDropValidation(DropTargetEvent event,LocalSelectionTransfer transfer){
  boolean ret=false;
  Object[] firstElements=((StructuredSelection)transfer.getSelection()).toArray();
  for (  Object object : firstElements) {
    if (object instanceof IFile) {
      IFile fe=(IFile)object;
      if (extension != null && extension.equals(fe.getFileExtension())) {
        ret=true;
      }
    }
 else     if (object instanceof IRepositoryNode) {
      IRepositoryViewObject obj=((IRepositoryNode)object).getObject();
      if (!ProxyRepositoryFactory.getInstance().isEditableAndLockIfPossible(obj)) {
        return false;
      }
      IPath itemPath=PropertyHelper.getItemPath(obj.getProperty());
      if (itemPath == null) {
        continue;
      }
      if (extension != null && extension.equals(itemPath.getFileExtension())) {
        ret=true;
      }
    }
    if (!ret) {
      break;
    }
  }
  return ret;
}
Program: 136877
Project: 136877
Buggy source:
/** 
 * check whether DND is allowed.
 * @param sourceNode
 * @param targetNode
 * @return
 */
private boolean allowDND(IRepositoryNode sourceNode,IRepositoryNode targetNode){
  IPath sourcePath=WorkbenchUtils.getPath(sourceNode);
  IPath targetPath=WorkbenchUtils.getPath(targetNode);
  int sourceCount=sourcePath.segmentCount();
  int targetCount=targetPath.segmentCount();
  if (sourceCount == 1 || targetCount == 1) {
    return false;
  }
  if (sourceNode.equals(targetNode)) {
    return false;
  }
  if (isForbidNode(sourceNode)) {
    return false;
  }
  if (isSubTypeOfTargetNode(sourceNode,targetNode)) {
    return false;
  }
  if (!isSameType(sourceNode,targetNode)) {
    return false;
  }
  if (ProxyRepositoryFactory.getInstance().getStatus(sourceNode.getObject()) == ERepositoryStatus.DELETED) {
    return false;
  }
  if (sourceNode.getParent().equals(targetNode)) {
    return false;
  }
  if (targetNode.getParent().equals(sourceNode)) {
    return false;
  }
  if (sourceNode.getType() == ENodeType.SIMPLE_FOLDER) {
    if (!canMoveFolderNode(sourceNode,targetNode)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * check whether DND is allowed.
 * @param sourceNode
 * @param targetNode
 * @return
 */
private boolean allowDND(IRepositoryNode sourceNode,IRepositoryNode targetNode){
  IPath sourcePath=WorkbenchUtils.getPath(sourceNode);
  IPath targetPath=WorkbenchUtils.getPath(targetNode);
  int sourceCount=sourcePath.segmentCount();
  int targetCount=targetPath.segmentCount();
  if (sourceCount == 1 || targetCount == 1) {
    return false;
  }
  if (sourceNode.equals(targetNode)) {
    return false;
  }
  if (isForbidNode(sourceNode)) {
    return false;
  }
  if (isSubTypeOfTargetNode(sourceNode,targetNode)) {
    return false;
  }
  if (!isSameType(sourceNode,targetNode)) {
    return false;
  }
  if (ProxyRepositoryFactory.getInstance().getStatus(sourceNode.getObject()) == ERepositoryStatus.DELETED) {
    return false;
  }
  if (sourceNode.getParent().equals(targetNode)) {
    return false;
  }
  if (targetNode.getParent().equals(sourceNode)) {
    return false;
  }
  if (sourceNode.getType() == ENodeType.SIMPLE_FOLDER) {
    if (!canMoveFolderNode(sourceNode,targetNode)) {
      return false;
    }
  }
  if (!ProxyRepositoryFactory.getInstance().isEditableAndLockIfPossible(sourceNode.getObject())) {
    return false;
  }
  return true;
}
Program: 136880
Project: 136880
Buggy source:
public Date generateDateBetween(String minString,String maxString,RandomWrapper rnd){
  SimpleDateFormat df=new SimpleDateFormat("String_Node_Str");
  Date minDate=null;
  Date maxDate=null;
  try {
    minDate=df.parse(minString);
    maxDate=df.parse(maxString);
  }
 catch (  ParseException e) {
    return null;
  }
  if (minDate.after(maxDate)) {
    Date tmp=minDate;
    minDate=maxDate;
    maxDate=tmp;
  }
 else   if (minDate.equals(maxDate)) {
    return minDate;
  }
  long min=minDate.getTime();
  long max=maxDate.getTime();
  long number=min + ((long)(rnd.nextDouble() * (max - min)));
  Date newDate=new Date(number);
  return newDate;
}

Fixed version (ground truth):
public Date generateDateBetween(String minString,String maxString,RandomWrapper rnd){
  SimpleDateFormat df=new SimpleDateFormat("String_Node_Str");
  Date minDate=null;
  Date maxDate=null;
  try {
    minDate=df.parse(minString);
    maxDate=df.parse(maxString);
  }
 catch (  ParseException e) {
    return new Date(System.currentTimeMillis());
  }
  if (minDate.after(maxDate)) {
    Date tmp=minDate;
    minDate=maxDate;
    maxDate=tmp;
  }
 else   if (minDate.equals(maxDate)) {
    return minDate;
  }
  long min=minDate.getTime();
  long max=maxDate.getTime();
  long number=min + ((long)(rnd.nextDouble() * (max - min)));
  Date newDate=new Date(number);
  return newDate;
}
Program: 136881
Project: 136881
Buggy source:
@SuppressWarnings("String_Node_Str") public static int getPageSize(){
  try {
    String defaultPageSize=ResourcesPlugin.getPlugin().getPluginPreferences().getString(EditorPreferencePage.ANALYZED_ITEMS_PER_PAGE);
    if (!"String_Node_Str".equals(defaultPageSize)) {
      return Integer.parseInt(defaultPageSize);
    }
  }
 catch (  NumberFormatException e) {
    ExceptionHandler.process(e);
  }
  return PAGE_SIZE;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static int getPageSize(){
  try {
    String defaultPageSize=Platform.getPreferencesService().getString(CorePlugin.PLUGIN_ID,EditorPreferencePage.ANALYZED_ITEMS_PER_PAGE,null,null);
    if (!"String_Node_Str".equals(defaultPageSize)) {
      return Integer.parseInt(defaultPageSize);
    }
  }
 catch (  NumberFormatException e) {
    ExceptionHandler.process(e);
  }
  return PAGE_SIZE;
}
Program: 136882
Project: 136882
Buggy source:
/** 
 * DOC xqliu Comment method "getDQRuleSize". ADD xqliu 2010-03-10 feature 10834
 * @return
 */
public static String getDQRuleSize(){
  String result=Platform.getPreferencesService().get(CorePlugin.PLUGIN_ID,DQ_RULES_PER_PAGE,null);
  if (result == null || PluginConstant.EMPTY_STRING.equals(result.trim())) {
    result=DEFAULT_PAGE_SIZE;
  }
  return result;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "getDQRuleSize". ADD xqliu 2010-03-10 feature 10834
 * @return
 */
public static String getDQRuleSize(){
  String result=Platform.getPreferencesService().getString(CorePlugin.PLUGIN_ID,DQ_RULES_PER_PAGE,null,null);
  if (StringUtils.isBlank(result)) {
    result=DEFAULT_PAGE_SIZE;
  }
  return result;
}
Program: 136883
Project: 136883
Buggy source:
@Override public boolean performOk(){
  boolean ok=super.performOk();
  LocalToLanguageEnum language=LocalToLanguageEnum.findLocal(execCombo.getText());
  getPreferenceStore().setValue(PluginConstant.LANGUAGE_SELECTOR,language.getShortOfLocale());
  try {
    InstanceScope.INSTANCE.getNode(CorePlugin.PLUGIN_ID).flush();
  }
 catch (  BackingStoreException e) {
    log.error(e);
  }
  saveLanguageType();
  return ok;
}

Fixed version (ground truth):
@Override public boolean performOk(){
  boolean ok=super.performOk();
  LocalToLanguageEnum language=LocalToLanguageEnum.findLocal(execCombo.getText());
  InstanceScope.INSTANCE.getNode(CorePlugin.PLUGIN_ID).put(PluginConstant.LANGUAGE_SELECTOR,language.getShortOfLocale());
  try {
    InstanceScope.INSTANCE.getNode(CorePlugin.PLUGIN_ID).flush();
  }
 catch (  BackingStoreException e) {
    log.error(e);
  }
  saveLanguageType();
  return ok;
}
Program: 136884
Project: 136884
Buggy source:
@Override protected void performDefaults(){
  execCombo.deselectAll();
  getPreferenceStore().setValue(PluginConstant.LANGUAGE_SELECTOR,LocalToLanguageEnum.ENGLISH.getShortOfLocale());
  execCombo.setText(LocalToLanguageEnum.ENGLISH.getLocale());
  super.performDefaults();
}

Fixed version (ground truth):
@Override protected void performDefaults(){
  execCombo.deselectAll();
  InstanceScope.INSTANCE.getNode(CorePlugin.PLUGIN_ID).put(PluginConstant.LANGUAGE_SELECTOR,LocalToLanguageEnum.ENGLISH.getShortOfLocale());
  execCombo.setText(LocalToLanguageEnum.ENGLISH.getLocale());
  super.performDefaults();
}
Program: 136886
Project: 136886
Buggy source:
/** 
 * DOC hcheng Comment method "saveLanguageType".
 */
private void saveLanguageType(){
  FileInputStream fin=null;
  FileOutputStream fout=null;
  try {
    URL url=Platform.getConfigurationLocation().getURL();
    log(url.getFile());
    Properties p=new Properties();
    File iniFile=new File(url.getFile(),"String_Node_Str");
    fin=new FileInputStream(iniFile);
    p.load(fin);
    String languageType=Platform.getPreferencesService().get(CorePlugin.PLUGIN_ID,PluginConstant.LANGUAGE_SELECTOR,null);
    if (languageType == null || languageType.equals(p.getProperty(EclipseStarter.PROP_NL))) {
      return;
    }
    p.setProperty(EclipseStarter.PROP_NL,languageType);
    fout=new FileOutputStream(iniFile);
    p.store(fout,"String_Node_Str");
    fout.flush();
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
 finally {
    if (fin != null) {
      try {
        fin.close();
      }
 catch (      Exception e) {
      }
    }
    if (fout != null) {
      try {
        fout.close();
      }
 catch (      Exception e) {
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC hcheng Comment method "saveLanguageType".
 */
private void saveLanguageType(){
  FileInputStream fin=null;
  FileOutputStream fout=null;
  try {
    URL url=Platform.getConfigurationLocation().getURL();
    log(url.getFile());
    Properties p=new Properties();
    File iniFile=new File(url.getFile(),"String_Node_Str");
    fin=new FileInputStream(iniFile);
    p.load(fin);
    String languageType=Platform.getPreferencesService().getString(CorePlugin.PLUGIN_ID,PluginConstant.LANGUAGE_SELECTOR,LocalToLanguageEnum.ENGLISH.getShortOfLocale(),null);
    if (languageType == null || languageType.equals(p.getProperty(EclipseStarter.PROP_NL))) {
      return;
    }
    p.setProperty(EclipseStarter.PROP_NL,languageType);
    fout=new FileOutputStream(iniFile);
    p.store(fout,"String_Node_Str");
    fout.flush();
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
 finally {
    if (fin != null) {
      try {
        fin.close();
      }
 catch (      Exception e) {
      }
    }
    if (fout != null) {
      try {
        fout.close();
      }
 catch (      Exception e) {
      }
    }
  }
}
Program: 136887
Project: 136887
Buggy source:
/** 
 * Create IIndicatorNode for every folder or file which is valid
 * @param folder
 * @param indiEnum
 * @param resourceMap
 * @return
 */
public static IIndicatorNode[] getNestFolderNodes(IFolder folder,IndicatorEnum indiEnum,ResourceFileMap resourceMap){
  List<IIndicatorNode> chilren=new ArrayList<IIndicatorNode>();
  try {
    for (    IResource resource : folder.members()) {
      if (resource instanceof IFile) {
        ModelElement modelElement=resourceMap.getModelElement((IFile)resource);
        if (modelElement == null) {
          continue;
        }
        Property property=PropertyHelper.getProperty(modelElement);
        if (property == null) {
          continue;
        }
        IIndicatorNode indicatorNode=createLeafNode(property.getDisplayName(),indiEnum,modelElement);
        if (indicatorNode == null) {
          continue;
        }
        chilren.add(indicatorNode);
      }
 else {
        ICategoryNode indicatorCateNode=new IndicatorCategoryNode(resource.getName());
        IIndicatorNode[] nestFolderNodes=getNestFolderNodes((IFolder)resource,indiEnum,resourceMap);
        if (nestFolderNodes.length > 0) {
          indicatorCateNode.setChildren(nestFolderNodes);
          chilren.add(indicatorCateNode);
        }
      }
    }
  }
 catch (  CoreException e) {
  }
  return chilren.toArray(new IIndicatorNode[chilren.size()]);
}

Fixed version (ground truth):
/** 
 * Create IIndicatorNode for every folder or file which is valid
 * @param folder
 * @param indiEnum
 * @param resourceMap
 * @return nodes if folder is not empty else return empty array
 */
public static IIndicatorNode[] getNestFolderNodes(IFolder folder,IndicatorEnum indiEnum,ResourceFileMap resourceMap){
  List<IIndicatorNode> chilren=new ArrayList<IIndicatorNode>();
  try {
    if (UDIHelper.isUDILibFolder(folder)) {
      return new IIndicatorNode[0];
    }
    for (    IResource resource : folder.members()) {
      if (resource instanceof IFile) {
        ModelElement modelElement=resourceMap.getModelElement((IFile)resource);
        if (modelElement == null) {
          continue;
        }
        Property property=PropertyHelper.getProperty(modelElement);
        if (property == null) {
          continue;
        }
        IIndicatorNode indicatorNode=createLeafNode(property.getDisplayName(),indiEnum,modelElement);
        if (indicatorNode == null) {
          continue;
        }
        chilren.add(indicatorNode);
      }
 else {
        ICategoryNode indicatorCateNode=new IndicatorCategoryNode(resource.getName());
        IIndicatorNode[] nestFolderNodes=getNestFolderNodes((IFolder)resource,indiEnum,resourceMap);
        if (nestFolderNodes.length > 0) {
          indicatorCateNode.setChildren(nestFolderNodes);
          chilren.add(indicatorCateNode);
        }
      }
    }
  }
 catch (  CoreException e) {
  }
  return chilren.toArray(new IIndicatorNode[chilren.size()]);
}
Program: 136888
Project: 136888
Buggy source:
private IndicatorUnit createTempSpecialIndicatorUnit(IndicatorEnum indicatorEnum,Indicator indicator){
  Indicator tempIndicator=indicator;
  if (tempIndicator == null) {
    EFactoryImpl factory=(EFactoryImpl)indicatorEnum.getIndicatorType().getEPackage().getEFactoryInstance();
    tempIndicator=(Indicator)factory.create(indicatorEnum.getIndicatorType());
    if (!DefinitionHandler.getInstance().setDefaultIndicatorDefinition(tempIndicator)) {
      log.error(DefaultMessagesImpl.getString("String_Node_Str") + tempIndicator.getName());
    }
  }
  if (this.specialIndicatorUnitList == null) {
    this.specialIndicatorUnitList=new ArrayList<IndicatorUnit>();
  }
  IndicatorUnit indicatorUnit=new ColumnIndicatorUnit(indicatorEnum,tempIndicator,this);
  tempSpecialIndicatorUnitList.add(indicatorUnit);
  this.specialIndicatorUnitMap.put(tempIndicator.getName(),indicatorUnit);
  return indicatorUnit;
}

Fixed version (ground truth):
private IndicatorUnit createTempSpecialIndicatorUnit(IndicatorEnum indicatorEnum,Indicator indicator){
  Indicator tempIndicator=indicator;
  if (tempIndicator == null) {
    EFactoryImpl factory=(EFactoryImpl)indicatorEnum.getIndicatorType().getEPackage().getEFactoryInstance();
    tempIndicator=(Indicator)factory.create(indicatorEnum.getIndicatorType());
    if (!DefinitionHandler.getInstance().setDefaultIndicatorDefinition(tempIndicator)) {
      log.error(DefaultMessagesImpl.getString("String_Node_Str") + tempIndicator.getName());
    }
  }
  if (this.specialIndicatorUnitList == null) {
    this.specialIndicatorUnitList=new ArrayList<IndicatorUnit>();
  }
  IndicatorUnit indicatorUnit=new ColumnIndicatorUnit(indicatorEnum,tempIndicator,this);
  if (tempSpecialIndicatorUnitList.contains(indicatorUnit)) {
    return indicatorUnit;
  }
  tempSpecialIndicatorUnitList.add(indicatorUnit);
  this.specialIndicatorUnitMap.put(tempIndicator.getName(),indicatorUnit);
  return indicatorUnit;
}
Program: 136889
Project: 136889
Buggy source:
/** 
 * Refresh the preview Table
 * @param modelElementIndicator
 */
public void refreshPreviewTable(ModelElementIndicator[] modelElements){
  this.currentModelElementIndicators=modelElements;
  this.refreshPreviewTable();
}

Fixed version (ground truth):
/** 
 * Refresh the preview Table
 * @param modelElementIndicator
 */
public void refreshPreviewTable(ModelElementIndicator[] modelElements){
  this.currentModelElementIndicators=modelElements;
  this.refreshPreviewTable(true);
}
Program: 136890
Project: 136890
Buggy source:
/** 
 * DOC talend Comment method "createIndicatorSelectButton".
 * @param buttonComposite
 */
private void createIndicatorSelectButton(Composite buttonComposite){
  Button indcBtn=toolkit.createButton(buttonComposite,DefaultMessagesImpl.getString("String_Node_Str"),SWT.NONE);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).applyTo(indcBtn);
  indcBtn.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      if (!isValidateRowCount()) {
        MessageDialog.openWarning(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
      }
 else {
        ModelElementIndicator[] result=treeViewer.openIndicatorSelectDialog(ColumnMasterDetailsPage.this.getSite().getShell());
        refreshCurrentTreeViewer(result);
        refreshPreviewTable();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * DOC talend Comment method "createIndicatorSelectButton".
 * @param buttonComposite
 */
private void createIndicatorSelectButton(Composite buttonComposite){
  Button indcBtn=toolkit.createButton(buttonComposite,DefaultMessagesImpl.getString("String_Node_Str"),SWT.NONE);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).applyTo(indcBtn);
  indcBtn.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      if (!isValidateRowCount()) {
        MessageDialog.openWarning(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
      }
 else {
        ModelElementIndicator[] result=treeViewer.openIndicatorSelectDialog(ColumnMasterDetailsPage.this.getSite().getShell());
        if (result != null) {
          refreshCurrentTreeViewer(result);
          refreshPreviewTable();
        }
      }
    }
  }
);
}
Program: 136891
Project: 136891
Buggy source:
private void createNatTable(){
  sampleTable.createNatTable(null,dataTableComp,analysisHandler.getSelectedColumns());
}

Fixed version (ground truth):
private void createNatTable(){
  try {
    sampleTable.createNatTable(null,dataTableComp,analysisHandler.getSelectedColumns());
  }
 catch (  SQLException e) {
    MessageDialog.openWarning(null,DefaultMessagesImpl.getString("String_Node_Str"),e.getMessage());
  }
}
Program: 136892
Project: 136892
Buggy source:
@Override protected void removeSelectedElements2(Tree tree){
  removeSelectedElements(tree);
}

Fixed version (ground truth):
@Override protected void removeSelectedElements2(Tree tree){
  removeSelectedElements(tree);
  notifyObservers();
}
Program: 136893
Project: 136893
Buggy source:
private void addTreeListener(final Tree tree){
  tree.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      TreeItem item=(TreeItem)e.item;
      if (item == null || DATA_PARAM.equals(item.getData(DATA_PARAM))) {
        Menu m=tree.getMenu();
        if (m != null && !m.isDisposed()) {
          m.dispose();
        }
        tree.setMenu(null);
      }
 else {
        new AnalysisColumnColumnMenuProvider(tree).createTreeMenu(Boolean.FALSE);
      }
    }
  }
);
  tree.addTreeListener(treeAdapter);
  tree.addMouseListener(new MouseAdapter(){
    @Override public void mouseDoubleClick(    MouseEvent e){
      TreeItem[] treeSelection=tree.getSelection();
      if (treeSelection.length > 0) {
        TreeItem item=treeSelection[0];
        Object indicatorobj=item.getData(INDICATOR_UNIT_KEY);
        Object meobj=item.getData(MODELELEMENT_INDICATOR_KEY);
        if (meobj != null && indicatorobj == null) {
          ModelElementIndicator[] modelElementIndicator=openIndicatorSelectDialog(masterPage.getEditor().getEditorSite().getShell());
          masterPage.refreshCurrentTreeViewer(modelElementIndicator);
        }
 else         if (meobj != null && indicatorobj != null) {
          openIndicatorOptionDialog(Display.getCurrent().getActiveShell(),item);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private void addTreeListener(final Tree tree){
  tree.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      TreeItem item=(TreeItem)e.item;
      if (item == null || DATA_PARAM.equals(item.getData(DATA_PARAM))) {
        Menu m=tree.getMenu();
        if (m != null && !m.isDisposed()) {
          m.dispose();
        }
        tree.setMenu(null);
      }
 else {
        new AnalysisColumnColumnMenuProvider(tree).createTreeMenu(Boolean.FALSE);
      }
    }
  }
);
  tree.addTreeListener(treeAdapter);
  tree.addMouseListener(new MouseAdapter(){
    @Override public void mouseDoubleClick(    MouseEvent e){
      TreeItem[] treeSelection=tree.getSelection();
      if (treeSelection.length > 0) {
        TreeItem item=treeSelection[0];
        Object indicatorobj=item.getData(INDICATOR_UNIT_KEY);
        Object meobj=item.getData(MODELELEMENT_INDICATOR_KEY);
        if (meobj != null && indicatorobj == null) {
          ModelElementIndicator[] modelElementIndicator=openIndicatorSelectDialog(masterPage.getEditor().getEditorSite().getShell());
          if (modelElementIndicator != null) {
            masterPage.refreshCurrentTreeViewer(modelElementIndicator);
            masterPage.refreshPreviewTable();
          }
        }
 else         if (meobj != null && indicatorobj != null) {
          openIndicatorOptionDialog(Display.getCurrent().getActiveShell(),item);
        }
      }
    }
  }
);
}
Program: 136895
Project: 136895
Buggy source:
@Override public void mouseDoubleClick(MouseEvent e){
  TreeItem[] treeSelection=tree.getSelection();
  if (treeSelection.length > 0) {
    TreeItem item=treeSelection[0];
    Object indicatorobj=item.getData(INDICATOR_UNIT_KEY);
    Object meobj=item.getData(MODELELEMENT_INDICATOR_KEY);
    if (meobj != null && indicatorobj == null) {
      ModelElementIndicator[] modelElementIndicator=openIndicatorSelectDialog(masterPage.getEditor().getEditorSite().getShell());
      masterPage.refreshCurrentTreeViewer(modelElementIndicator);
    }
 else     if (meobj != null && indicatorobj != null) {
      openIndicatorOptionDialog(Display.getCurrent().getActiveShell(),item);
    }
  }
}

Fixed version (ground truth):
@Override public void mouseDoubleClick(MouseEvent e){
  TreeItem[] treeSelection=tree.getSelection();
  if (treeSelection.length > 0) {
    TreeItem item=treeSelection[0];
    Object indicatorobj=item.getData(INDICATOR_UNIT_KEY);
    Object meobj=item.getData(MODELELEMENT_INDICATOR_KEY);
    if (meobj != null && indicatorobj == null) {
      ModelElementIndicator[] modelElementIndicator=openIndicatorSelectDialog(masterPage.getEditor().getEditorSite().getShell());
      if (modelElementIndicator != null) {
        masterPage.refreshCurrentTreeViewer(modelElementIndicator);
        masterPage.refreshPreviewTable();
      }
    }
 else     if (meobj != null && indicatorobj != null) {
      openIndicatorOptionDialog(Display.getCurrent().getActiveShell(),item);
    }
  }
}
Program: 136896
Project: 136896
Buggy source:
public Map<String,String> getQueryMap(){
  Map<String,String> map=new HashMap<String,String>();
  if (ColumnsetPackage.eINSTANCE.getAllMatchIndicator().isSuperTypeOf(indicator.eClass())) {
    return map;
  }
  boolean isSqlEngine=ExecutionLanguage.SQL.equals(this.analysis.getParameters().getExecutionLanguage());
  EList<Expression> instantiatedExpressions=this.indicator.getInstantiatedExpressions();
  if (instantiatedExpressions.size() > 0) {
    Expression expression=instantiatedExpressions.get(0);
    String regularExpressionFunctionName=dbmsLanguage.extractRegularExpressionFunction(expression);
    dbmsLanguage.setRegularExpressionFunction(regularExpressionFunctionName);
    dbmsLanguage.setFunctionReturnValue(expression);
  }
  map.put(MENU_VIEW_INVALID_VALUES,isSqlEngine ? getComment(MENU_VIEW_INVALID_VALUES) + getInvalidValuesStatement() : null);
  map.put(MENU_VIEW_VALID_VALUES,isSqlEngine ? getComment(MENU_VIEW_VALID_VALUES) + getValidValuesStatement() : null);
  map.put(MENU_VIEW_INVALID_ROWS,isSqlEngine ? getComment(MENU_VIEW_INVALID_ROWS) + getInvalidRowsStatement() : null);
  map.put(MENU_VIEW_VALID_ROWS,isSqlEngine ? getComment(MENU_VIEW_VALID_ROWS) + getValidRowsStatement() : null);
  return map;
}

Fixed version (ground truth):
public Map<String,String> getQueryMap(){
  Map<String,String> map=new HashMap<String,String>();
  if (ColumnsetPackage.eINSTANCE.getAllMatchIndicator().isSuperTypeOf(indicator.eClass())) {
    return map;
  }
  boolean isSqlEngine=ExecutionLanguage.SQL.equals(analysis.getParameters().getExecutionLanguage());
  EList<Expression> instantiatedExpressions=indicator.getInstantiatedExpressions();
  if (instantiatedExpressions.size() > 0) {
    Expression expression=instantiatedExpressions.get(0);
    String regexp=dbmsLanguage.getRegexPatternString(indicator);
    dbmsLanguage.setRegularExpressionFunction(dbmsLanguage.extractRegularExpressionFunction(expression,regexp));
    dbmsLanguage.setFunctionReturnValue(dbmsLanguage.extractRegularExpressionFunctionReturnValue(expression,regexp));
  }
  map.put(MENU_VIEW_INVALID_VALUES,isSqlEngine ? getComment(MENU_VIEW_INVALID_VALUES) + getInvalidValuesStatement() : null);
  map.put(MENU_VIEW_VALID_VALUES,isSqlEngine ? getComment(MENU_VIEW_VALID_VALUES) + getValidValuesStatement() : null);
  map.put(MENU_VIEW_INVALID_ROWS,isSqlEngine ? getComment(MENU_VIEW_INVALID_ROWS) + getInvalidRowsStatement() : null);
  map.put(MENU_VIEW_VALID_ROWS,isSqlEngine ? getComment(MENU_VIEW_VALID_ROWS) + getValidRowsStatement() : null);
  return map;
}
Program: 136897
Project: 136897
Buggy source:
/** 
 * remember the result value for regular expression.So that we can get complete expression and Normal it should be "=1"
 * @param expression
 */
public void setFunctionReturnValue(Expression expression){
  try {
    String tempString=splictExpression(expression);
    tempString=tempString.split("String_Node_Str").length > 1 ? tempString.split("String_Node_Str")[1] : "String_Node_Str";
    tempString=tempString.split("String_Node_Str").length > 1 ? tempString.split("String_Node_Str")[0] : "String_Node_Str";
    regularfunctionReturnValue=tempString.trim();
  }
 catch (  NullPointerException e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
/** 
 * remember the result value for regular expression.So that we can get complete expression and it should be "=1" always
 * @param expression
 */
public void setFunctionReturnValue(String returnValue){
  regularfunctionReturnValue=returnValue.trim();
}