nus-yam/ex-repair huggingface dataset:
Program: 126112
Project: 126112
Buggy source:
public static JsonTreeNode getSchemaTree(String jsonString,int numberOfElementsAccessiable){
  JsonTreeNode jsonTreeNode=null;
  try {
    ObjectMapper objMapper=new ObjectMapper();
    JsonNode jsonNode=objMapper.readTree(jsonString);
    jsonTreeNode=new JsonTreeNode();
    jsonTreeNode.addValue(jsonNode);
    String label="String_Node_Str";
    if (jsonNode.isArray()) {
      label=label + "String_Node_Str";
    }
    jsonTreeNode.setLabel(label);
    jsonTreeNode.setJsonPath(label);
    fetchTreeNode(jsonTreeNode,numberOfElementsAccessiable - 1);
  }
 catch (  IOException e) {
    CommonExceptionHandler.process(e);
  }
  return jsonTreeNode;
}

Fixed version (ground truth):
public static JsonTreeNode getSchemaTree(String jsonString,int numberOfElementsAccessiable){
  JsonTreeNode jsonTreeNode=null;
  try {
    ObjectMapper objMapper=new ObjectMapper();
    JsonNode jsonNode=objMapper.readTree(jsonString);
    jsonTreeNode=new JsonTreeNode();
    jsonTreeNode.addValue(jsonNode);
    String label="String_Node_Str";
    if (jsonNode != null && jsonNode.isArray()) {
      label=label + getJsonPathArrayWildcard();
    }
    jsonTreeNode.setLabel(label);
    jsonTreeNode.setJsonPath(label);
    fetchTreeNode(jsonTreeNode,numberOfElementsAccessiable - 1);
  }
 catch (  IOException e) {
    CommonExceptionHandler.process(e);
  }
  return jsonTreeNode;
}
Program: 126113
Project: 126113
Buggy source:
public static String getFilteredJsonPath(String jsonPath){
  if (jsonPath == null || jsonPath.isEmpty()) {
    return jsonPath;
  }
  return jsonPath.replaceAll("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static String getFilteredJsonPath(String jsonPath){
  if (jsonPath == null || jsonPath.isEmpty()) {
    return jsonPath;
  }
  String filteredJsonPath=jsonPath.replaceAll("String_Node_Str","String_Node_Str");
  return filteredJsonPath.replaceAll(getJsonPathArrayWildcardExpr(),"String_Node_Str");
}
Program: 126114
Project: 126114
Buggy source:
public static JsonTreeNode getJsonTreeNodeByJsonPath(Object[] treeNodes,String jsonPath){
  if (treeNodes == null || treeNodes.length <= 0 || jsonPath == null) {
    return null;
  }
  if (jsonPath.isEmpty()) {
    return null;
  }
  for (  Object childObj : treeNodes) {
    if (!(childObj instanceof JsonTreeNode)) {
      continue;
    }
    JsonTreeNode childJsonTreeNode=(JsonTreeNode)childObj;
    String treeNodePath=childJsonTreeNode.getJsonPath();
    if (jsonPath.equals(treeNodePath)) {
      return childJsonTreeNode;
    }
 else     if (jsonPath.startsWith(treeNodePath + "String_Node_Str")) {
      return getJsonTreeNodeByJsonPath(childJsonTreeNode.getChildren(),jsonPath);
    }
 else {
      continue;
    }
  }
  return null;
}

Fixed version (ground truth):
public static JsonTreeNode getJsonTreeNodeByJsonPath(Object[] treeNodes,String jsonPath){
  if (treeNodes == null || treeNodes.length <= 0 || jsonPath == null) {
    return null;
  }
  if (jsonPath.isEmpty()) {
    return null;
  }
  for (  Object childObj : treeNodes) {
    if (!(childObj instanceof JsonTreeNode)) {
      continue;
    }
    JsonTreeNode childJsonTreeNode=(JsonTreeNode)childObj;
    String treeNodePath=getFilteredJsonPath(childJsonTreeNode.getJsonPath());
    if (jsonPath.equals(treeNodePath)) {
      return childJsonTreeNode;
    }
 else     if (jsonPath.startsWith(treeNodePath + "String_Node_Str")) {
      return getJsonTreeNodeByJsonPath(childJsonTreeNode.getChildren(),jsonPath);
    }
 else {
      continue;
    }
  }
  return null;
}
Program: 126115
Project: 126115
Buggy source:
private static void fetchArrayTreeNode(JsonTreeNode parentNode,JsonNode jsonNode){
  if (parentNode == null || jsonNode == null) {
    return;
  }
  Iterator<Entry<String,JsonNode>> childrenIter=jsonNode.fields();
  while (childrenIter.hasNext()) {
    Entry<String,JsonNode> childEntry=childrenIter.next();
    String name=childEntry.getKey();
    JsonTreeNode childJsonTreeNode=parentNode.getFromValueMap(name);
    if (childJsonTreeNode == null) {
      childJsonTreeNode=new JsonTreeNode();
      childJsonTreeNode.setLabel(name);
      JsonNode value=childEntry.getValue();
      String jsonPath=parentNode.getJsonPath() + "String_Node_Str" + name;
      childJsonTreeNode.addValue(value);
      childJsonTreeNode.setJsonPath(jsonPath);
      parentNode.addChild(childJsonTreeNode);
      parentNode.putValueMap(name,childJsonTreeNode);
    }
 else {
      childJsonTreeNode.addValue(childEntry.getValue());
    }
  }
}

Fixed version (ground truth):
private static void fetchArrayTreeNode(JsonTreeNode parentNode,JsonNode jsonNode){
  if (parentNode == null || jsonNode == null) {
    return;
  }
  Iterator<Entry<String,JsonNode>> childrenIter=jsonNode.fields();
  while (childrenIter.hasNext()) {
    Entry<String,JsonNode> childEntry=childrenIter.next();
    addChildJsonTreeNode(parentNode,childEntry);
  }
}
Program: 126116
Project: 126116
Buggy source:
public static void fetchTreeNode(JsonTreeNode parentNode,int numberOfElementsAccessiable){
  if (parentNode == null || numberOfElementsAccessiable == 0 || !parentNode.hasChildren()) {
    return;
  }
  Set<JsonNode> valueSet=parentNode.getValues();
  if (valueSet == null || valueSet.isEmpty()) {
    return;
  }
  Iterator<JsonNode> valueIter=valueSet.iterator();
  while (valueIter.hasNext()) {
    JsonNode jsonNode=valueIter.next();
    if (jsonNode.isArray()) {
      Iterator<JsonNode> childrenIter=jsonNode.iterator();
      Set<JsonNode> arraySet=new HashSet<JsonNode>();
      while (childrenIter.hasNext()) {
        JsonNode childJsonNode=childrenIter.next();
        arraySet.add(childJsonNode);
      }
      fetchArrayTreeNode(parentNode,arraySet,numberOfElementsAccessiable);
    }
 else {
      Iterator<Entry<String,JsonNode>> childrenIter=jsonNode.fields();
      while (childrenIter.hasNext()) {
        Entry<String,JsonNode> childEntry=childrenIter.next();
        JsonTreeNode childJsonTreeNode=new JsonTreeNode();
        String label=childEntry.getKey();
        JsonNode value=childEntry.getValue();
        if (value != null && value.isArray()) {
          label=label + "String_Node_Str";
        }
        String jsonPath=parentNode.getJsonPath() + "String_Node_Str" + label;
        childJsonTreeNode.setLabel(label);
        childJsonTreeNode.addValue(value);
        childJsonTreeNode.setJsonPath(jsonPath);
        parentNode.addChild(childJsonTreeNode);
        if (childJsonTreeNode.hasChildren()) {
          fetchTreeNode(childJsonTreeNode,numberOfElementsAccessiable - 1);
        }
      }
    }
  }
}

Fixed version (ground truth):
public static void fetchTreeNode(JsonTreeNode parentNode,int numberOfElementsAccessiable){
  if (parentNode == null || numberOfElementsAccessiable == 0) {
    return;
  }
  parentNode.setRetrieved();
  Set<JsonNode> valueSet=parentNode.getValues();
  if (valueSet == null || valueSet.isEmpty()) {
    return;
  }
  Iterator<JsonNode> valueIter=valueSet.iterator();
  while (valueIter.hasNext()) {
    JsonNode jsonNode=valueIter.next();
    if (jsonNode.isArray()) {
      Iterator<JsonNode> childrenIter=jsonNode.iterator();
      Set<JsonNode> arraySet=new HashSet<JsonNode>();
      while (childrenIter.hasNext()) {
        JsonNode childJsonNode=childrenIter.next();
        if (hasChildren(childJsonNode)) {
          arraySet.add(childJsonNode);
        }
      }
      fetchArrayTreeNode(parentNode,arraySet,numberOfElementsAccessiable);
    }
 else {
      Iterator<Entry<String,JsonNode>> childrenIter=jsonNode.fields();
      while (childrenIter.hasNext()) {
        Entry<String,JsonNode> childEntry=childrenIter.next();
        JsonTreeNode childJsonTreeNode=addChildJsonTreeNode(parentNode,childEntry);
        fetchTreeNode(childJsonTreeNode,numberOfElementsAccessiable - 1);
      }
    }
  }
}
Program: 126117
Project: 126117
Buggy source:
@Override public void fillCoolBar(ICoolBarManager coolBar){
  this.coolBar=coolBar;
  IToolBarManager toolBar=new ToolBarManager(SWT.FLAT | SWT.RIGHT);
  coolBar.add(new ToolBarContributionItem(toolBar,Messages.getString("String_Node_Str")));
  toolBar.add(ActionFactory.SAVE.create(window));
  if (PluginChecker.isRefProjectLoaded()) {
    IReferencedProjectService service=(IReferencedProjectService)GlobalServiceRegister.getDefault().getService(IReferencedProjectService.class);
    if (service != null) {
      toolBar=new ToolBarManager(SWT.FLAT | SWT.RIGHT);
      coolBar.add(new ToolBarContributionItem(toolBar,"String_Node_Str"));
      service.addMergeAction(window,toolBar);
    }
  }
  IToolBarManager toolBarManager=new ToolBarManager(SWT.FLAT | SWT.RIGHT);
  toolBarManager.add(new LinksToolbarItem());
  coolBar.add(new ToolBarContributionItem(toolBarManager,LinksToolbarItem.COOLITEM_LINKS_ID));
}

Fixed version (ground truth):
@Override public void fillCoolBar(ICoolBarManager coolBar){
  IToolBarManager toolBar=new ToolBarManager(SWT.FLAT | SWT.RIGHT);
  coolBar.add(new ToolBarContributionItem(toolBar,Messages.getString("String_Node_Str")));
  toolBar.add(ActionFactory.SAVE.create(window));
  IToolBarManager toolBarManager=new ToolBarManager(SWT.FLAT | SWT.RIGHT);
  toolBarManager.add(new LinksToolbarItem());
  coolBar.add(new ToolBarContributionItem(toolBarManager,LinksToolbarItem.COOLITEM_LINKS_ID));
}
Program: 126119
Project: 126119
Buggy source:
/** 
 * DOC amaumont Comment method "initNamespaceContext".
 */
private void initNamespaceContext(){
  namespaceContext=new NamespaceContext(){
    public String getNamespaceURI(    String prefix){
      String namespaceForPrefix=getNamespaceForPrefix(prefix);
      return namespaceForPrefix;
    }
    public Iterator getPrefixes(    String val){
      return null;
    }
    public String getPrefix(    String uri){
      return null;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "initNamespaceContext".
 */
private void initNamespaceContext(){
  namespaceContext=new NamespaceContext(){
    @Override public String getNamespaceURI(    String prefix){
      String namespaceForPrefix=getNamespaceForPrefix(prefix);
      return namespaceForPrefix;
    }
    @Override public Iterator getPrefixes(    String val){
      return null;
    }
    @Override public String getPrefix(    String uri){
      return null;
    }
  }
;
}
Program: 126120
Project: 126120
Buggy source:
public String getPrefix(String uri){
  return null;
}

Fixed version (ground truth):
@Override public String getPrefix(String uri){
  return null;
}
Program: 126121
Project: 126121
Buggy source:
public String getNamespaceURI(String prefix){
  String namespaceForPrefix=getNamespaceForPrefix(prefix);
  return namespaceForPrefix;
}

Fixed version (ground truth):
@Override public String getNamespaceURI(String prefix){
  String namespaceForPrefix=getNamespaceForPrefix(prefix);
  return namespaceForPrefix;
}
Program: 126122
Project: 126122
Buggy source:
public Iterator getPrefixes(String val){
  return null;
}

Fixed version (ground truth):
@Override public Iterator getPrefixes(String val){
  return null;
}
Program: 126123
Project: 126123
Buggy source:
void init(){
  performanceEvaluator.addListener(new IPerformanceEvaluatorListener(){
    public void handleEvent(    PerformanceEvaluatorEvent event){
      boolean previousAntialiasAllowed=antialiasAllowed;
      antialiasAllowed=event.getIndicePerformance() < PerformanceEvaluator.GOOD_PERFORMANCE_INDICE;
      if (previousAntialiasAllowed != antialiasAllowed && !drawableComposite.getBgDrawableComposite().isDisposed() && drawableComposite.getBgDrawableComposite().getDisplay() != null) {
        new AsynchronousThreading(0,false,drawableComposite.getBgDrawableComposite().getDisplay(),new Runnable(){
          public void run(){
            refreshBackground();
          }
        }
).start();
      }
    }
  }
);
}

Fixed version (ground truth):
void init(){
  iPerformanceEvaluatorListener=new IPerformanceEvaluatorListener(){
    public void handleEvent(    PerformanceEvaluatorEvent event){
      boolean previousAntialiasAllowed=antialiasAllowed;
      antialiasAllowed=event.getIndicePerformance() < PerformanceEvaluator.GOOD_PERFORMANCE_INDICE;
      if (previousAntialiasAllowed != antialiasAllowed && !drawableComposite.getBgDrawableComposite().isDisposed() && drawableComposite.getBgDrawableComposite().getDisplay() != null) {
        asynchronousThreading1=new AsynchronousThreading(0,false,drawableComposite.getBgDrawableComposite().getDisplay(),new Runnable(){
          public void run(){
            refreshBackground();
          }
        }
);
        asynchronousThreading1.start();
      }
    }
  }
;
  performanceEvaluator.addListener(iPerformanceEvaluatorListener);
}
Program: 126124
Project: 126124
Buggy source:
public void handleEvent(PerformanceEvaluatorEvent event){
  boolean previousAntialiasAllowed=antialiasAllowed;
  antialiasAllowed=event.getIndicePerformance() < PerformanceEvaluator.GOOD_PERFORMANCE_INDICE;
  if (previousAntialiasAllowed != antialiasAllowed && !drawableComposite.getBgDrawableComposite().isDisposed() && drawableComposite.getBgDrawableComposite().getDisplay() != null) {
    new AsynchronousThreading(0,false,drawableComposite.getBgDrawableComposite().getDisplay(),new Runnable(){
      public void run(){
        refreshBackground();
      }
    }
).start();
  }
}

Fixed version (ground truth):
public void handleEvent(PerformanceEvaluatorEvent event){
  boolean previousAntialiasAllowed=antialiasAllowed;
  antialiasAllowed=event.getIndicePerformance() < PerformanceEvaluator.GOOD_PERFORMANCE_INDICE;
  if (previousAntialiasAllowed != antialiasAllowed && !drawableComposite.getBgDrawableComposite().isDisposed() && drawableComposite.getBgDrawableComposite().getDisplay() != null) {
    asynchronousThreading1=new AsynchronousThreading(0,false,drawableComposite.getBgDrawableComposite().getDisplay(),new Runnable(){
      public void run(){
        refreshBackground();
      }
    }
);
    asynchronousThreading1.start();
  }
}
Program: 126125
Project: 126125
Buggy source:
protected void execute(final boolean isFinalExecution,Object data){
  drawableComposite.getBgDrawableComposite().getDisplay().syncExec(new Runnable(){
    public void run(){
      if (isFinalExecution) {
        refreshBackground();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void execute(final boolean isFinalExecution,Object data){
  drawableComposite.getBgDrawableComposite().getDisplay().syncExec(new Runnable(){
    public void run(){
      if (isFinalExecution) {
        refreshBackground();
      }
    }
  }
);
}
Program: 126126
Project: 126126
Buggy source:
private void initTimeLimitForBackgroundRefresh(){
  (new Object(){
    void init(){
      performanceEvaluator.addListener(new IPerformanceEvaluatorListener(){
        public void handleEvent(        PerformanceEvaluatorEvent event){
          boolean previousAntialiasAllowed=antialiasAllowed;
          antialiasAllowed=event.getIndicePerformance() < PerformanceEvaluator.GOOD_PERFORMANCE_INDICE;
          if (previousAntialiasAllowed != antialiasAllowed && !drawableComposite.getBgDrawableComposite().isDisposed() && drawableComposite.getBgDrawableComposite().getDisplay() != null) {
            new AsynchronousThreading(0,false,drawableComposite.getBgDrawableComposite().getDisplay(),new Runnable(){
              public void run(){
                refreshBackground();
              }
            }
).start();
          }
        }
      }
);
    }
  }
).init();
  new AsynchronousThreading(50,new Runnable(){
    public void run(){
      launchEvaluatingPerformanceLoop();
    }
  }
).start();
}

Fixed version (ground truth):
private void initTimeLimitForBackgroundRefresh(){
  (new Object(){
    void init(){
      iPerformanceEvaluatorListener=new IPerformanceEvaluatorListener(){
        public void handleEvent(        PerformanceEvaluatorEvent event){
          boolean previousAntialiasAllowed=antialiasAllowed;
          antialiasAllowed=event.getIndicePerformance() < PerformanceEvaluator.GOOD_PERFORMANCE_INDICE;
          if (previousAntialiasAllowed != antialiasAllowed && !drawableComposite.getBgDrawableComposite().isDisposed() && drawableComposite.getBgDrawableComposite().getDisplay() != null) {
            asynchronousThreading1=new AsynchronousThreading(0,false,drawableComposite.getBgDrawableComposite().getDisplay(),new Runnable(){
              public void run(){
                refreshBackground();
              }
            }
);
            asynchronousThreading1.start();
          }
        }
      }
;
      performanceEvaluator.addListener(iPerformanceEvaluatorListener);
    }
  }
).init();
  asynchronousThreading2=new AsynchronousThreading(50,new Runnable(){
    public void run(){
      launchEvaluatingPerformanceLoop();
    }
  }
);
  asynchronousThreading2.start();
}
Program: 126127
Project: 126127
Buggy source:
public void widgetSelected(SelectionEvent event){
  backgroundRefresher.refreshBackgroundWithLimiter();
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent event){
  backgroundRefresher.refreshBackgroundWithLimiter();
}
Program: 126128
Project: 126128
Buggy source:
/** 
 * DOC amaumont Comment method "addListeners".
 */
private void addListeners(){
  if (WindowSystem.isGTK() && forceDrawLinksGtk) {
    table.addListener(SWT.Paint,new Listener(){
      public void handleEvent(      Event event){
        paintEvent(event);
      }
    }
);
  }
  ControlListener controlListener=new ControlListener(){
    public void controlMoved(    ControlEvent e){
    }
    public void controlResized(    ControlEvent e){
      backgroundRefresher.refreshBackgroundWithLimiter();
    }
  }
;
  table.addControlListener(controlListener);
  if (tableViewerCreator != null) {
    tableViewerCreator.getSelectionHelper().addAfterSelectionListener(new ILineSelectionListener(){
      public void handle(      LineSelectionEvent e){
        controlsLinker.updateLinksStyleAndControlsSelection(table,true);
      }
    }
);
  }
 else {
    table.addSelectionListener(new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        controlsLinker.updateLinksStyleAndControlsSelection(table,true);
      }
    }
);
  }
  ScrollBar vBarTable=table.getVerticalBar();
  SelectionListener scrollListener=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent event){
      backgroundRefresher.refreshBackgroundWithLimiter();
    }
  }
;
  vBarTable.addSelectionListener(scrollListener);
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "addListeners".
 */
private void addListeners(){
  if (WindowSystem.isGTK() && forceDrawLinksGtk) {
    tablePaintListener=new Listener(){
      public void handleEvent(      Event event){
        paintEvent(event);
      }
    }
;
    table.addListener(SWT.Paint,tablePaintListener);
  }
  controlListener=new ControlListener(){
    public void controlMoved(    ControlEvent e){
    }
    public void controlResized(    ControlEvent e){
      backgroundRefresher.refreshBackgroundWithLimiter();
    }
  }
;
  table.addControlListener(controlListener);
  if (tableViewerCreator != null) {
    tableViewerLineSelectionListener=new ILineSelectionListener(){
      public void handle(      LineSelectionEvent e){
        controlsLinker.updateLinksStyleAndControlsSelection(table,true);
      }
    }
;
    tableViewerCreator.getSelectionHelper().addAfterSelectionListener(tableViewerLineSelectionListener);
  }
 else {
    tableSelectionListener=new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        controlsLinker.updateLinksStyleAndControlsSelection(table,true);
      }
    }
;
    table.addSelectionListener(tableSelectionListener);
  }
  ScrollBar vBarTable=table.getVerticalBar();
  scrollListener=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent event){
      backgroundRefresher.refreshBackgroundWithLimiter();
    }
  }
;
  vBarTable.addSelectionListener(scrollListener);
}
Program: 126129
Project: 126129
Buggy source:
public boolean populateTree(ATreeNode treeNode,Object selectedEntity,File fileValue){
  if (fileValue == null || !fileValue.exists() || !fileValue.isFile()) {
    return false;
  }
  FileReader fileReader=null;
  BufferedReader bufferedReader=null;
  try {
    fileReader=new FileReader(fileValue);
    bufferedReader=new BufferedReader(fileReader);
    String line=null;
    StringBuffer jsonBuffer=new StringBuffer();
    while ((line=bufferedReader.readLine()) != null) {
      jsonBuffer.append(line).append("String_Node_Str");
    }
    return populateTree(treeNode,selectedEntity,jsonBuffer.toString());
  }
 catch (  Exception e) {
    CommonExceptionHandler.process(e);
    return false;
  }
 finally {
    if (fileReader != null) {
      try {
        fileReader.close();
      }
 catch (      IOException e) {
      }
    }
    if (bufferedReader != null) {
      try {
        bufferedReader.close();
      }
 catch (      IOException e) {
      }
    }
  }
}

Fixed version (ground truth):
public boolean populateTree(ATreeNode treeNode,Object selectedEntity,File fileValue){
  if (fileValue == null || !fileValue.exists() || !fileValue.isFile()) {
    return false;
  }
  if (selectedEntity instanceof JsonTreeNode) {
    SchemaPopulationUtil.fetchTreeNode((JsonTreeNode)selectedEntity,1);
    treeNode=(ATreeNode)selectedEntity;
  }
 else {
    treeNode=SchemaPopulationUtil.getSchemaTree(fileValue,limit);
  }
  if (treeNode == null) {
    return false;
  }
 else {
    List<JsonTreeNode> input=new ArrayList<JsonTreeNode>();
    input.add((JsonTreeNode)treeNode);
    treeViewer.setInput(input);
    treeViewer.expandToLevel(3);
  }
  return true;
}
Program: 126132
Project: 126132
Buggy source:
@Override public int compare(RepositoryNode o1,RepositoryNode o2){
  if (o1.getContentType() == null) {
    return 1;
  }
  return o1.getContentType().compareTo(o2.getContentType());
}

Fixed version (ground truth):
@Override public int compare(RepositoryNode o1,RepositoryNode o2){
  ERepositoryObjectType type1=o1.getContentType();
  ERepositoryObjectType type2=o2.getContentType();
  if (type1 == null || type2 == null) {
    return 1;
  }
  return type1.compareTo(type2);
}
Program: 126133
Project: 126133
Buggy source:
@Override protected Object[] getSortedChildren(Object parentElementOrTreePath){
  if (parentElementOrTreePath instanceof TalendRepositoryRoot) {
    Object[] objects=(Object[])super.getSortedChildren(parentElementOrTreePath);
    List<RepositoryNode> nodes=new ArrayList<RepositoryNode>();
    for (    Object object : objects) {
      if (object instanceof RepositoryNode) {
        nodes.add((RepositoryNode)object);
      }
    }
    Comparator<RepositoryNode> myComparator=new Comparator<RepositoryNode>(){
      @Override public int compare(      RepositoryNode o1,      RepositoryNode o2){
        if (o1.getContentType() == null) {
          return 1;
        }
        return o1.getContentType().compareTo(o2.getContentType());
      }
    }
;
    RepositoryNode[] nodesArray=nodes.toArray(new RepositoryNode[0]);
    Arrays.sort(nodesArray,myComparator);
    return nodesArray;
  }
  return super.getSortedChildren(parentElementOrTreePath);
}

Fixed version (ground truth):
@Override protected Object[] getSortedChildren(Object parentElementOrTreePath){
  if (parentElementOrTreePath instanceof TalendRepositoryRoot) {
    Object[] objects=(Object[])super.getSortedChildren(parentElementOrTreePath);
    List<RepositoryNode> nodes=new ArrayList<RepositoryNode>();
    for (    Object object : objects) {
      if (object instanceof RepositoryNode) {
        nodes.add((RepositoryNode)object);
      }
    }
    Comparator<RepositoryNode> myComparator=new Comparator<RepositoryNode>(){
      @Override public int compare(      RepositoryNode o1,      RepositoryNode o2){
        ERepositoryObjectType type1=o1.getContentType();
        ERepositoryObjectType type2=o2.getContentType();
        if (type1 == null || type2 == null) {
          return 1;
        }
        return type1.compareTo(type2);
      }
    }
;
    RepositoryNode[] nodesArray=nodes.toArray(new RepositoryNode[0]);
    Arrays.sort(nodesArray,myComparator);
    return nodesArray;
  }
  return super.getSortedChildren(parentElementOrTreePath);
}
Program: 126134
Project: 126134
Buggy source:
/** 
 * DOC sgandon Comment method "updateManualImportedJars".
 * @param importedJars
 */
private void updateManualImportedJars(AtomicInteger enabledButtonCount,String[] importedJars){
  for (  Entry<ModuleToInstall,Button> moduleAndButton : manualInstallButtonMap.entrySet()) {
    String jarName=moduleAndButton.getKey().getName();
    for (    String importedJar : importedJars) {
      if (importedJar.equals(jarName)) {
        moduleAndButton.getValue().setEnabled(false);
        enabledButtonCount.decrementAndGet();
      }
    }
  }
  if (enabledButtonCount.get() == 0) {
    close();
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
      IDesignerCoreService service=(IDesignerCoreService)GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
      if (service != null) {
        service.refreshComponentView();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC sgandon Comment method "updateManualImportedJars".
 * @param importedJars
 */
private void updateManualImportedJars(AtomicInteger enabledButtonCount,String[] importedJars){
  for (  Entry<ModuleToInstall,Button> moduleAndButton : manualInstallButtonMap.entrySet()) {
    String jarName=moduleAndButton.getKey().getName();
    for (    String importedJar : importedJars) {
      if (importedJar.equals(jarName)) {
        moduleAndButton.getValue().setEnabled(false);
        enabledButtonCount.decrementAndGet();
      }
    }
  }
  if (enabledButtonCount.get() == 0) {
    close();
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
      IDesignerCoreService service=(IDesignerCoreService)GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
      if (service != null) {
        service.refreshComponentView();
      }
    }
    ModulesNeededProvider.fireChangedLibrariesListener();
  }
}
Program: 126136
Project: 126136
Buggy source:
public String getMavenUriSnapshot(){
  if (mavenUriSnapshot == null || "String_Node_Str".equals(mavenUriSnapshot)) {
    if (mavenUri != null && !"String_Node_Str".equals(mavenUri)) {
      mavenUriSnapshot=MavenUrlHelper.generateSnapshotMavenUri(mavenUri);
    }
    if (mavenUriSnapshot == null || "String_Node_Str".equals(mavenUriSnapshot)) {
      mavenUriSnapshot=MavenUrlHelper.generateMvnUrlForJarName(getModuleName(),false,true);
    }
  }
  return mavenUriSnapshot;
}

Fixed version (ground truth):
public String getMavenUriSnapshot(){
  MavenArtifact artifact=MavenUrlHelper.parseMvnUrl(getMavenUri());
  if (artifact != null && !MavenConstants.DEFAULT_LIB_GROUP_ID.equals(artifact.getGroupId())) {
    return getMavenUri();
  }
  if (mavenUriSnapshot == null || "String_Node_Str".equals(mavenUriSnapshot)) {
    if (mavenUri != null && !"String_Node_Str".equals(mavenUri)) {
      mavenUriSnapshot=MavenUrlHelper.generateSnapshotMavenUri(mavenUri);
    }
    if (mavenUriSnapshot == null || "String_Node_Str".equals(mavenUriSnapshot)) {
      mavenUriSnapshot=MavenUrlHelper.generateMvnUrlForJarName(getModuleName(),false,true);
    }
  }
  return mavenUriSnapshot;
}
Program: 126137
Project: 126137
Buggy source:
@Override public void widgetSelected(final SelectionEvent e){
  refreshPreview();
  updateStatus(IStatus.OK,null);
}

Fixed version (ground truth):
@Override public void widgetSelected(final SelectionEvent e){
  refreshPreview();
}
Program: 126138
Project: 126138
Buggy source:
@Override protected boolean checkFieldsValue(){
  if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.JAVA)) {
    return checkJavaFieldsValue();
  }
 else   if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.PERL)) {
    return checkPerlFieldsValue();
  }
 else {
    updateStatus(IStatus.ERROR,null);
    return true;
  }
}

Fixed version (ground truth):
@Override protected boolean checkFieldsValue(){
  if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.JAVA)) {
    return checkJavaFieldsValue();
  }
 else   if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.PERL)) {
    return checkPerlFieldsValue();
  }
 else {
    updateStatus(IStatus.ERROR,null);
    return false;
  }
}
Program: 126140
Project: 126140
Buggy source:
@Override public void modifyText(ModifyEvent e){
  if (!isContextMode()) {
    checkFieldsValue();
    getConnection().setMethodName(methodText.getText());
    if (wsdlText.getText() != null && !wsdlText.getText().equals("String_Node_Str")) {
      updateStatus(IStatus.OK,null);
    }
  }
}

Fixed version (ground truth):
@Override public void modifyText(ModifyEvent e){
  if (!isContextMode()) {
    boolean noError=checkFieldsValue();
    getConnection().setMethodName(methodText.getText());
    if (noError && wsdlText.getText() != null && !wsdlText.getText().equals("String_Node_Str")) {
      updateStatus(IStatus.OK,null);
    }
  }
}
Program: 126141
Project: 126141
Buggy source:
@Override public boolean canFinish(){
  boolean flag=ProjectManager.getInstance().isInCurrentMainProject(this.connectionItem);
  if (!flag) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean canFinish(){
  boolean flag=ProjectManager.getInstance().isInCurrentMainProject(this.connectionItem);
  if (!flag) {
    return false;
  }
  if (dynamicWizardPages != null) {
    for (    IWizardPage wizardPage : dynamicWizardPages) {
      if (!wizardPage.isPageComplete()) {
        return false;
      }
    }
  }
  return super.canFinish();
}
Program: 126147
Project: 126147
Buggy source:
/** 
 * DOC sgandon Comment method "getFileBis".
 * @param path
 * @param nativeCode
 * @return
 */
protected File getFile(String path,boolean nativeCode,boolean notifyMissingJar){
  File file=super.getFile(path,nativeCode);
  if (file == null && path.endsWith("String_Node_Str")) {
    URL resourcePathInFragment=findInFragments(generation.getRevision().getBundle(),path);
    if (resourcePathInFragment != null) {
      return null;
    }
    file=MissingJarBundleFileWrapper.lookForMissingJar(path,generation,notifyMissingJar);
  }
  return file;
}

Fixed version (ground truth):
/** 
 * DOC sgandon Comment method "getFileBis".
 * @param path
 * @param nativeCode
 * @return
 */
protected File getFile(String path,boolean nativeCode,boolean notifyMissingJar){
  File file=super.getFile(path,nativeCode);
  if (file == null && path.endsWith("String_Node_Str") && ((generation.getRevision().getTypes() & ModuleRevision.TYPE_FRAGMENT) == 0)) {
    URL resourcePathInFragment=findInFragments(generation.getRevision().getBundle(),path);
    if (resourcePathInFragment != null) {
      return null;
    }
    file=MissingJarBundleFileWrapper.lookForMissingJar(path,generation,notifyMissingJar);
  }
  return file;
}
Program: 126150
Project: 126150
Buggy source:
/** 
 * Makes sure if the hive server2 UI displays. If displaying it, then check the selection. Added by Marvin Wang on Mar 25, 2013.
 * @param distributionIndex
 * @param hiveVersionIndex
 */
protected void updateHiveServerAndMakeSelection(int distributionIndex,int hiveVersionIndex){
  boolean isSupportHiveServer2=HiveConnUtils.isSupportHiveServer2(distributionIndex,hiveVersionIndex);
  if (isSupportHiveServer2) {
    DatabaseConnection conn=getConnection();
    String hiveServerDisplayNames[]=HiveServerVersionUtils.extractAvailableArrayDisplayNames(HiveConnUtils.getHiveVersionObj(distributionIndex,hiveVersionIndex));
    hiveServerVersionCombo.getCombo().setItems(hiveServerDisplayNames);
    String hiveServerKey=conn.getParameters().get(ConnParameterKeys.HIVE_SERVER_VERSION);
    int hiveServerIndex=0;
    if (hiveServerDisplayNames != null && hiveServerKey != null) {
      for (hiveServerIndex=0; hiveServerIndex < hiveServerDisplayNames.length; hiveServerIndex++) {
        if (hiveServerKey.equals(hiveServerDisplayNames)) {
          break;
        }
      }
      if (hiveServerDisplayNames.length <= hiveServerIndex) {
        hiveServerIndex=0;
      }
    }
    hiveServerVersionCombo.select(hiveServerIndex);
  }
  int hiveServerIndex=getRealHiveServerIndex(distributionIndex,hiveVersionIndex,hiveServerVersionCombo.getSelectionIndex());
  int hiveModeIndex=hiveModeCombo.getSelectionIndex();
  updateHiveModeAndMakeSelection(distributionIndex,hiveVersionIndex,hiveModeIndex,hiveServerIndex);
}

Fixed version (ground truth):
/** 
 * Makes sure if the hive server2 UI displays. If displaying it, then check the selection. Added by Marvin Wang on Mar 25, 2013.
 * @param distributionIndex
 * @param hiveVersionIndex
 */
protected void updateHiveServerAndMakeSelection(int distributionIndex,int hiveVersionIndex){
  boolean isSupportHiveServer2=HiveConnUtils.isSupportHiveServer2(distributionIndex,hiveVersionIndex);
  if (isSupportHiveServer2) {
    DatabaseConnection conn=getConnection();
    String hiveServerDisplayNames[]=HiveServerVersionUtils.extractAvailableArrayDisplayNames(HiveConnUtils.getHiveVersionObj(distributionIndex,hiveVersionIndex));
    hiveServerVersionCombo.getCombo().setItems(hiveServerDisplayNames);
    String hiveServerKey=conn.getParameters().get(ConnParameterKeys.HIVE_SERVER_VERSION);
    int hiveServerIndex=0;
    if (hiveServerDisplayNames != null && hiveServerKey != null) {
      for (hiveServerIndex=0; hiveServerIndex < hiveServerDisplayNames.length; hiveServerIndex++) {
        if (hiveServerKey.equals(HiveServerVersionUtils.extractKey(HiveConnUtils.getIndexOfHiveServerByDisplayName(hiveServerDisplayNames[hiveServerIndex])))) {
          break;
        }
      }
    }
    hiveServerVersionCombo.select(hiveServerIndex);
  }
  int hiveServerIndex=getRealHiveServerIndex(distributionIndex,hiveVersionIndex,hiveServerVersionCombo.getSelectionIndex());
  int hiveModeIndex=hiveModeCombo.getSelectionIndex();
  updateHiveModeAndMakeSelection(distributionIndex,hiveVersionIndex,hiveModeIndex,hiveServerIndex);
}
Program: 126151
Project: 126151
Buggy source:
private void setHidAuthenticationForHive(boolean hide){
  if (!hide) {
    GridData keytabGridData=(GridData)useKeyTab.getLayoutData();
    GridData keytabDetailGridData=(GridData)keyTabComponent.getLayoutData();
    if (!isHiveEmbeddedMode()) {
      useKeyTab.setVisible(false);
      keyTabComponent.setVisible(false);
      keytabGridData.exclude=true;
      keytabDetailGridData.exclude=true;
      useKeyTab.setSelection(false);
      getConnection().getParameters().put(ConnParameterKeys.CONN_PARA_KEY_USEKEYTAB,"String_Node_Str");
    }
 else {
      boolean keytabCompositeVisible=useKeyTab.getSelection();
      useKeyTab.setVisible(true);
      keyTabComponent.setVisible(keytabCompositeVisible);
      keytabGridData.exclude=false;
      keytabDetailGridData.exclude=!keytabCompositeVisible;
    }
    useKeyTab.setLayoutData(keytabGridData);
    keyTabComponent.setLayoutData(keytabDetailGridData);
    useKeyTab.getParent().layout();
  }
  GridData hadoopData=(GridData)authenticationGrp.getLayoutData();
  hadoopData.exclude=hide;
  authenticationGrp.setVisible(!hide);
  authenticationGrp.setLayoutData(hadoopData);
  authenticationGrp.layout();
  authenticationGrp.getParent().layout();
}

Fixed version (ground truth):
private void setHidAuthenticationForHive(boolean hide){
  GridData hadoopData=(GridData)authenticationGrp.getLayoutData();
  hadoopData.exclude=hide;
  authenticationGrp.setVisible(!hide);
  authenticationGrp.setLayoutData(hadoopData);
  authenticationGrp.getParent().layout();
}
Program: 126152
Project: 126152
Buggy source:
protected boolean isOptionChecked(String key){
  if (key != null && argumentsMap != null) {
    final Object object=argumentsMap.get(key);
    if (object instanceof Boolean) {
      return (Boolean)object;
    }
 else     if (object instanceof String) {
      return Boolean.parseBoolean((String)object);
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean isOptionChecked(String key,Object... args){
  return ProcessUtils.isOptionChecked(argumentsMap,key,args);
}
Program: 126154
Project: 126154
Buggy source:
/** 
 * add dependencies for pom.
 */
protected void addDependencies(Model model){
  try {
    processorDependenciesManager.updateDependencies(null,model);
    final List<Dependency> dependencies=model.getDependencies();
    String parentId=getJobProcessor().getProperty().getId();
    final Set<JobInfo> clonedChildrenJobInfors=getClonedJobInfos();
    for (    JobInfo jobInfo : clonedChildrenJobInfors) {
      if (jobInfo.getFatherJobInfo() != null && jobInfo.getFatherJobInfo().getJobId().equals(parentId)) {
        if (jobInfo.isTestContainer()) {
          continue;
        }
        Dependency d=PomUtil.createDependency(model.getGroupId(),PomIdsHelper.getJobArtifactId(jobInfo),PomIdsHelper.getJobVersion(jobInfo),null);
        dependencies.add(d);
      }
    }
  }
 catch (  ProcessorException e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
/** 
 * add dependencies for pom.
 */
protected void addDependencies(Model model){
  try {
    processorDependenciesManager.updateDependencies(null,model);
    final List<Dependency> dependencies=model.getDependencies();
    String parentId=getJobProcessor().getProperty().getId();
    final Set<JobInfo> clonedChildrenJobInfors=getJobProcessor().getBuildChildrenJobs();
    for (    JobInfo jobInfo : clonedChildrenJobInfors) {
      if (jobInfo.getFatherJobInfo() != null && jobInfo.getFatherJobInfo().getJobId().equals(parentId)) {
        if (jobInfo.isTestContainer()) {
          continue;
        }
        Dependency d=PomUtil.createDependency(model.getGroupId(),PomIdsHelper.getJobArtifactId(jobInfo),PomIdsHelper.getJobVersion(jobInfo),null);
        dependencies.add(d);
      }
    }
  }
 catch (  ProcessorException e) {
    ExceptionHandler.process(e);
  }
}
Program: 126156
Project: 126156
Buggy source:
@SuppressWarnings("String_Node_Str") @Override protected Model createModel(){
  Model model=super.createModel();
  final IProcessor jProcessor=getJobProcessor();
  final IProcess process=jProcessor.getProcess();
  final String jobName=JavaResourcesHelper.escapeFileName(process.getName());
  String artifact=jobName;
  model.setArtifactId(artifact);
  model.setVersion(process.getVersion());
  Property property=jProcessor.getProperty();
  if (property != null && property.getItem() != null) {
    model.setGroupId(PomIdsHelper.getTestGroupId(property));
    ERepositoryObjectType itemType=ERepositoryObjectType.getItemType(property.getItem());
    if (itemType != null) {
      model.setName(jobName + '(' + itemType.getLabel()+ ')');
    }
  }
  PomUtil.checkParent(model,this.getPomFile());
  addDependencies(model);
  return model;
}

Fixed version (ground truth):
@Override protected Model createModel(){
  Model model=super.createModel();
  final IProcessor jProcessor=getJobProcessor();
  final IProcess process=jProcessor.getProcess();
  final String jobName=JavaResourcesHelper.escapeFileName(process.getName());
  String artifact=jobName;
  model.setArtifactId(artifact);
  model.setVersion(process.getVersion());
  Property property=jProcessor.getProperty();
  if (property != null && property.getItem() != null) {
    model.setGroupId(PomIdsHelper.getTestGroupId(property));
    ERepositoryObjectType itemType=ERepositoryObjectType.getItemType(property.getItem());
    if (itemType != null) {
      model.setName(jobName + '(' + itemType.getLabel()+ ')');
    }
  }
  PomUtil.checkParent(model,this.getPomFile());
  addDependencies(model);
  return model;
}
Program: 126157
Project: 126157
Buggy source:
/** 
 * add dependencies for pom.
 */
protected void addDependencies(Model model){
  try {
    processorDependenciesManager.updateDependencies(null,model);
    final List<Dependency> dependencies=model.getDependencies();
    String parentId=getJobProcessor().getProperty().getId();
    final Set<JobInfo> clonedChildrenJobInfors=getClonedJobInfos();
    for (    JobInfo jobInfo : clonedChildrenJobInfors) {
      if (jobInfo.getFatherJobInfo() != null && jobInfo.getFatherJobInfo().getJobId().equals(parentId)) {
        Dependency d=PomUtil.createDependency(model.getGroupId(),jobInfo.getJobName(),jobInfo.getJobVersion(),null);
        dependencies.add(d);
      }
    }
  }
 catch (  ProcessorException e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
/** 
 * add dependencies for pom.
 */
protected void addDependencies(Model model){
  try {
    processorDependenciesManager.updateDependencies(null,model);
    final List<Dependency> dependencies=model.getDependencies();
    String parentId=getJobProcessor().getProperty().getId();
    final Set<JobInfo> clonedChildrenJobInfors=getJobProcessor().getBuildChildrenJobs();
    for (    JobInfo jobInfo : clonedChildrenJobInfors) {
      if (jobInfo.getFatherJobInfo() != null && jobInfo.getFatherJobInfo().getJobId().equals(parentId)) {
        Dependency d=PomUtil.createDependency(model.getGroupId(),jobInfo.getJobName(),jobInfo.getJobVersion(),null);
        dependencies.add(d);
      }
    }
  }
 catch (  ProcessorException e) {
    ExceptionHandler.process(e);
  }
}
Program: 126159
Project: 126159
Buggy source:
/** 
 * Makes sure if the hive server2 UI displays. If displaying it, then check the selection. Added by Marvin Wang on Mar 25, 2013.
 * @param distributionIndex
 * @param hiveVersionIndex
 */
protected void updateHiveServerAndMakeSelection(int distributionIndex,int hiveVersionIndex){
  boolean isSupportHiveServer2=HiveConnUtils.isSupportHiveServer2(distributionIndex,hiveVersionIndex);
  if (isSupportHiveServer2) {
    DatabaseConnection conn=getConnection();
    String hiveServerDisplayNames[]=HiveServerVersionUtils.extractAvailableArrayDisplayNames(HiveConnUtils.getHiveVersionObj(distributionIndex,hiveVersionIndex));
    hiveServerVersionCombo.getCombo().setItems(hiveServerDisplayNames);
    String hiveServerKey=conn.getParameters().get(ConnParameterKeys.HIVE_SERVER_VERSION);
    hiveServerVersionCombo.select(HiveServerVersionUtils.getIndexofHiveServerByKey(hiveServerKey));
  }
  int hiveServerIndex=hiveServerVersionCombo.getSelectionIndex();
  int hiveModeIndex=hiveModeCombo.getSelectionIndex();
  updateHiveModeAndMakeSelection(distributionIndex,hiveVersionIndex,hiveModeIndex,hiveServerIndex);
}

Fixed version (ground truth):
/** 
 * Makes sure if the hive server2 UI displays. If displaying it, then check the selection. Added by Marvin Wang on Mar 25, 2013.
 * @param distributionIndex
 * @param hiveVersionIndex
 */
protected void updateHiveServerAndMakeSelection(int distributionIndex,int hiveVersionIndex){
  boolean isSupportHiveServer2=HiveConnUtils.isSupportHiveServer2(distributionIndex,hiveVersionIndex);
  if (isSupportHiveServer2) {
    DatabaseConnection conn=getConnection();
    String hiveServerDisplayNames[]=HiveServerVersionUtils.extractAvailableArrayDisplayNames(HiveConnUtils.getHiveVersionObj(distributionIndex,hiveVersionIndex));
    hiveServerVersionCombo.getCombo().setItems(hiveServerDisplayNames);
    String hiveServerKey=conn.getParameters().get(ConnParameterKeys.HIVE_SERVER_VERSION);
    int hiveServerIndex=0;
    if (hiveServerDisplayNames != null && hiveServerKey != null) {
      for (hiveServerIndex=0; hiveServerIndex < hiveServerDisplayNames.length; hiveServerIndex++) {
        if (hiveServerKey.equals(hiveServerDisplayNames)) {
          break;
        }
      }
      if (hiveServerDisplayNames.length <= hiveServerIndex) {
        hiveServerIndex=0;
      }
    }
    hiveServerVersionCombo.select(hiveServerIndex);
  }
  int hiveServerIndex=getRealHiveServerIndex(distributionIndex,hiveVersionIndex,hiveServerVersionCombo.getSelectionIndex());
  int hiveModeIndex=hiveModeCombo.getSelectionIndex();
  updateHiveModeAndMakeSelection(distributionIndex,hiveVersionIndex,hiveModeIndex,hiveServerIndex);
}
Program: 126160
Project: 126160
Buggy source:
protected String getHiveModeKey(){
  int distributionIndex=distributionCombo.getSelectionIndex();
  int hiveVersionIndex=hiveVersionCombo.getSelectionIndex();
  int hiveModeIndex=hiveModeCombo.getSelectionIndex();
  int hiveServerIndex=hiveServerVersionCombo.getSelectionIndex();
  return HiveConnUtils.getHiveModeObjKey(distributionIndex,hiveVersionIndex,hiveModeIndex,hiveServerIndex);
}

Fixed version (ground truth):
protected String getHiveModeKey(){
  int distributionIndex=distributionCombo.getSelectionIndex();
  int hiveVersionIndex=hiveVersionCombo.getSelectionIndex();
  int hiveModeIndex=hiveModeCombo.getSelectionIndex();
  int hiveServerIndex=getRealHiveServerIndex(distributionIndex,hiveVersionIndex,hiveServerVersionCombo.getSelectionIndex());
  return HiveConnUtils.getHiveModeObjKey(distributionIndex,hiveVersionIndex,hiveModeIndex,hiveServerIndex);
}
Program: 126161
Project: 126161
Buggy source:
private boolean isSupportTez(){
  if (isHiveDBConnSelected()) {
    int distributionIndex=distributionCombo.getSelectionIndex();
    int hiveVersionIndex=hiveVersionCombo.getSelectionIndex();
    int hiveModeIndex=hiveModeCombo.getSelectionIndex();
    int hiveServerIndex=hiveServerVersionCombo.getSelectionIndex();
    if (distributionIndex >= 0 && hiveVersionIndex >= 0 && hiveModeIndex >= 0) {
      boolean supportTez=HiveConnUtils.isSupportTez(distributionIndex,hiveVersionIndex,hiveModeIndex,hiveServerIndex);
      return supportTez;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isSupportTez(){
  if (isHiveDBConnSelected()) {
    int distributionIndex=distributionCombo.getSelectionIndex();
    int hiveVersionIndex=hiveVersionCombo.getSelectionIndex();
    int hiveModeIndex=hiveModeCombo.getSelectionIndex();
    int hiveServerIndex=getRealHiveServerIndex(distributionIndex,hiveVersionIndex,hiveServerVersionCombo.getSelectionIndex());
    if (distributionIndex >= 0 && hiveVersionIndex >= 0 && hiveModeIndex >= 0) {
      boolean supportTez=HiveConnUtils.isSupportTez(distributionIndex,hiveVersionIndex,hiveModeIndex,hiveServerIndex);
      return supportTez;
    }
  }
  return false;
}
Program: 126163
Project: 126163
Buggy source:
private boolean isSupportSecurity(){
  int distributionIndex=distributionCombo.getSelectionIndex();
  int hiveVersionIndex=hiveVersionCombo.getSelectionIndex();
  int hiveModeIndex=hiveModeCombo.getSelectionIndex();
  int hiveServerIndex=hiveServerVersionCombo.getSelectionIndex();
  if (distributionIndex >= 0 && hiveVersionIndex >= 0 && hiveModeIndex >= 0) {
    boolean supportSecurity=HiveConnUtils.isSupportSecurity(distributionIndex,hiveVersionIndex,hiveModeIndex,HiveServerVersionInfo.HIVE_SERVER_2.getDisplayName().equals(hiveServerVersionCombo.getText()),hiveServerIndex);
    if (supportSecurity) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isSupportSecurity(){
  int distributionIndex=distributionCombo.getSelectionIndex();
  int hiveVersionIndex=hiveVersionCombo.getSelectionIndex();
  int hiveModeIndex=hiveModeCombo.getSelectionIndex();
  int hiveServerIndex=getRealHiveServerIndex(distributionIndex,hiveVersionIndex,hiveServerVersionCombo.getSelectionIndex());
  if (distributionIndex >= 0 && hiveVersionIndex >= 0 && hiveModeIndex >= 0) {
    boolean supportSecurity=HiveConnUtils.isSupportSecurity(distributionIndex,hiveVersionIndex,hiveModeIndex,HiveServerVersionInfo.HIVE_SERVER_2.getDisplayName().equals(hiveServerVersionCombo.getText()),hiveServerIndex);
    if (supportSecurity) {
      return true;
    }
  }
  return false;
}