nus-yam/ex-repair huggingface dataset:
Program: 120042
Project: 120042
Buggy source:
protected HL7TreeNode addElement(HL7TreeNode current,String currentPath,String newPath,String defaultValue){
  String name=newPath.substring(newPath.lastIndexOf("String_Node_Str") + 1);
  String parentPath="String_Node_Str";
  if (newPath.contains("String_Node_Str")) {
    parentPath=newPath.substring(0,newPath.lastIndexOf("String_Node_Str"));
  }
  HL7TreeNode temp=new Element(name,defaultValue);
  if (current == null) {
    return temp;
  }
  if (currentPath.equals(parentPath)) {
    current.addChild(temp);
  }
 else {
    String[] nods=currentPath.split("String_Node_Str");
    String[] newNods=parentPath.split("String_Node_Str");
    int parentLevel=0;
    int checkLength=nods.length < newNods.length ? nods.length : newNods.length;
    for (int i=1; i < checkLength; i++) {
      if (nods[i].equals(newNods[i])) {
        parentLevel=i;
      }
    }
    HL7TreeNode parent=current;
    for (int i=0; i < nods.length - (parentLevel + 1); i++) {
      HL7TreeNode tmpParent=parent.getParent();
      if (tmpParent == null) {
        break;
      }
      parent=tmpParent;
    }
    if (parent != null) {
      parent.addChild(temp);
    }
  }
  return temp;
}

Fixed version (ground truth):
protected HL7TreeNode addElement(HL7TreeNode current,String currentPath,String newPath,String defaultValue,Map<String,HL7TreeNode> mapNodes){
  HL7TreeNode temp=mapNodes.get(newPath);
  if (temp == null) {
    String name=newPath.substring(newPath.lastIndexOf("String_Node_Str") + 1);
    temp=new Element(name,defaultValue);
    if (current == null) {
      mapNodes.put(newPath,temp);
      return temp;
    }
    mapNodes.put(newPath,temp);
    String parentPath=newPath.substring(0,newPath.lastIndexOf("String_Node_Str"));
    HL7TreeNode parentNode=mapNodes.get(parentPath);
    if (parentNode != null) {
      parentNode.addChild(temp);
    }
 else {
      ExceptionHandler.log("String_Node_Str" + parentPath);
    }
  }
  return temp;
}
Program: 120045
Project: 120045
Buggy source:
public void restoreUIData(){
  List<? extends IElementParameter> list=component.getElementParameters();
  initParamsMap(list);
  reloadSurrogateKeyParameter();
  reloadSourceKeyParameter();
  reloadType0Parameter();
  reloadType1Parameter();
  reloadType2Parameter();
  reloadType3Parameter();
}

Fixed version (ground truth):
public void restoreUIData(){
  List<? extends IElementParameter> list=component.getElementParameters();
  initParamsMap(list);
  reloadSurrogateKeyParameter();
  reloadSourceKeyParameter();
  reloadType0Parameter();
  reloadType1Parameter();
  reloadType2Parameter();
  reloadType3Parameter();
  typeTable.addAll(type1Table != null ? type1Table : Collections.EMPTY_LIST);
  typeTable.addAll(type2Table != null ? type2Table : Collections.EMPTY_LIST);
  typeTable.addAll(getUsedType3Columns(type3Table));
}
Program: 120046
Project: 120046
Buggy source:
public void removeDragItems(String data){
  Table table=tableViewer.getTable();
  table.getSelection();
  TableItem[] items=table.getItems();
  String[] toRemove=data.split("String_Node_Str");
  for (int i=1; i < toRemove.length; i++) {
    for (    TableItem item : items) {
      if (toRemove[i].equals(item.getText())) {
        tableModel.remove(item.getData());
        break;
      }
    }
  }
  table.remove(table.getSelectionIndices());
  tableViewer.refresh();
}

Fixed version (ground truth):
public void removeDragItems(String data){
  Table table=tableViewer.getTable();
  table.getSelection();
  TableItem[] items=table.getItems();
  String[] toRemove=data.split("String_Node_Str");
  for (int i=1; i < toRemove.length; i++) {
    for (    TableItem item : items) {
      if (toRemove[i].equals(item.getText())) {
        tableModel.remove(item.getData());
switch (type) {
case ScdParameterConstants.DROP_COPY_TYPE1FIELDS:
case ScdParameterConstants.DROP_COPY_TYPE2FIELDS:
          if (scdManager.getTypeTable().contains(item.getData())) {
            scdManager.getTypeTable().remove(item.getData());
          }
        break;
case ScdParameterConstants.DROP_COPY_SOURCEKEYS:
      if (scdManager.getSourceKeys().contains(item.getData())) {
        scdManager.getSourceKeys().remove(item.getData());
      }
    break;
}
break;
}
}
}
table.remove(table.getSelectionIndices());
tableViewer.refresh();
}
Program: 120047
Project: 120047
Buggy source:
public void onDropItems(String data,Point position){
  String[] items=data.split("String_Node_Str");
  for (int i=1; i < items.length; i++) {
    tableModel.add(items[i]);
  }
  tableViewer.setInput(tableModel);
}

Fixed version (ground truth):
public void onDropItems(String data,Point position){
  String[] items=data.split("String_Node_Str");
  for (int i=1; i < items.length; i++) {
switch (type) {
case ScdParameterConstants.DROP_COPY_TYPE1FIELDS:
case ScdParameterConstants.DROP_COPY_TYPE2FIELDS:
      if (!scdManager.getTypeTable().contains(items[i])) {
        scdManager.getTypeTable().add(items[i]);
      }
 else {
        continue;
      }
    break;
case ScdParameterConstants.DROP_COPY_SOURCEKEYS:
  if (!scdManager.getSourceKeys().contains(items[i])) {
    scdManager.getSourceKeys().add(items[i]);
  }
 else {
    continue;
  }
break;
}
if (type != ScdParameterConstants.DROP_COPY_SOURCEKEYS) {
tableModel.add(items[i]);
}
}
tableViewer.setInput(tableModel);
}
Program: 120048
Project: 120048
Buggy source:
public boolean isDropAllowed(String data){
  return true;
}

Fixed version (ground truth):
public boolean isDropAllowed(String data){
switch (type) {
case ScdParameterConstants.DROP_COPY_TYPE1FIELDS:
case ScdParameterConstants.DROP_COPY_TYPE2FIELDS:
    List<String> typeTable=scdManager.getTypeTable();
  String[] items=data.split("String_Node_Str");
for (int i=1; i < items.length; i++) {
  if (typeTable.contains(items[i])) {
    return false;
  }
}
break;
case ScdParameterConstants.DROP_COPY_SOURCEKEYS:
List<String> sourceKeys=scdManager.getSourceKeys();
String[] sourceKeyItems=data.split("String_Node_Str");
for (int i=1; i < sourceKeyItems.length; i++) {
if (sourceKeys.contains(sourceKeyItems[i])) {
return false;
}
}
break;
}
return true;
}
Program: 120049
Project: 120049
Buggy source:
/** 
 * DOC hcw FieldSection constructor comment.
 * @param parent
 */
public FieldSection(Composite parent,int width,int height,ScdManager scdManager,boolean toolbarNeeded,boolean editable){
  super(parent,width,height,scdManager,toolbarNeeded);
  dragDropManager=new DragDropManager();
  dragDropManager.addDragSupport(tableViewer.getTable(),this);
  dragDropManager.addDropSupport(tableViewer.getTable(),this);
  tableModel=new ArrayList<String>();
  this.editable=editable;
}

Fixed version (ground truth):
/** 
 * DOC hcyi FieldSection constructor comment.
 * @param parent
 */
public FieldSection(Composite parent,int width,int height,ScdManager scdManager,boolean toolbarNeeded,boolean editable,int type){
  super(parent,width,height,scdManager,toolbarNeeded);
  dragDropManager=new DragDropManager();
  dragDropManager.addDragSupport(tableViewer.getTable(),this);
  dragDropManager.addDropSupport(tableViewer.getTable(),this);
  tableModel=new ArrayList<String>();
  this.editable=editable;
  this.type=type;
}
Program: 120051
Project: 120051
Buggy source:
public Type2Section(Composite parent,int width,int height,ScdManager scdManager){
  super(parent,width,height,scdManager,false,false);
  editorManager=new TableEditorManager();
  dragDropManager=new DragDropManager();
}

Fixed version (ground truth):
public Type2Section(Composite parent,int width,int height,ScdManager scdManager,int type){
  super(parent,width,height,scdManager,false,false,type);
  editorManager=new TableEditorManager();
  dragDropManager=new DragDropManager();
}
Program: 120052
Project: 120052
Buggy source:
public void onDropItems(String data,Point position){
  String[] items=data.split("String_Node_Str");
  for (int i=1; i < items.length; i++) {
    Type3Field field=new Type3Field();
    field.setCurrentValue(items[i]);
    field.setPreviousValue(PREVIOUS_NAME_PREFIX + items[i]);
    tableModel.add(field);
  }
  tableViewer.setInput(tableModel);
}

Fixed version (ground truth):
public void onDropItems(String data,Point position){
  String[] items=data.split("String_Node_Str");
  for (int i=1; i < items.length; i++) {
    Type3Field field=new Type3Field();
    field.setCurrentValue(items[i]);
    field.setPreviousValue(PREVIOUS_NAME_PREFIX + items[i]);
    if (!scdManager.getTypeTable().contains(items[i])) {
      scdManager.getTypeTable().add(items[i]);
    }
 else {
      continue;
    }
    tableModel.add(field);
  }
  tableViewer.setInput(tableModel);
}
Program: 120053
Project: 120053
Buggy source:
public void removeDragItems(String data){
  TableItem[] items=table.getItems();
  String[] toRemove=data.split("String_Node_Str");
  for (int i=1; i < toRemove.length; i++) {
    TableItem itemToRemove=null;
    for (    TableItem item : items) {
      if (toRemove[i].equals(item.getText())) {
        itemToRemove=item;
        break;
      }
    }
    if (itemToRemove != null) {
      tableModel.remove((Type3Field)itemToRemove.getData());
      editorManager.removeEditors(itemToRemove);
    }
  }
  table.remove(table.getSelectionIndices());
  tableViewer.refresh();
}

Fixed version (ground truth):
public void removeDragItems(String data){
  TableItem[] items=table.getItems();
  String[] toRemove=data.split("String_Node_Str");
  for (int i=1; i < toRemove.length; i++) {
    TableItem itemToRemove=null;
    for (    TableItem item : items) {
      if (toRemove[i].equals(item.getText())) {
        itemToRemove=item;
        break;
      }
    }
    if (itemToRemove != null) {
      tableModel.remove((Type3Field)itemToRemove.getData());
      if (scdManager.getTypeTable().contains(toRemove[i])) {
        scdManager.getTypeTable().remove(toRemove[i]);
      }
      editorManager.removeEditors(itemToRemove);
    }
  }
  table.remove(table.getSelectionIndices());
  tableViewer.refresh();
}
Program: 120054
Project: 120054
Buggy source:
public boolean isDropAllowed(String data){
  return true;
}

Fixed version (ground truth):
public boolean isDropAllowed(String data){
  List<String> typeTable=scdManager.getTypeTable();
  String[] items=data.split("String_Node_Str");
  for (int i=1; i < items.length; i++) {
    if (typeTable.contains(items[i])) {
      return false;
    }
  }
  return true;
}
Program: 120055
Project: 120055
Buggy source:
@Override public void drop(DropTargetEvent event){
  if (TextTransfer.getInstance().isSupportedType(event.currentDataType)) {
    String data=(String)event.data;
    Point point=new Point(event.x,event.y);
    delegate.onDropItems(data,point);
    dropped=true;
  }
}

Fixed version (ground truth):
@Override public void drop(DropTargetEvent event){
  if (!delegate.isDropAllowed(currentSelectionText)) {
    event.detail=DND.DROP_NONE;
    return;
  }
  if (TextTransfer.getInstance().isSupportedType(event.currentDataType)) {
    String data=(String)event.data;
    Point point=new Point(event.x,event.y);
    delegate.onDropItems(data,point);
    dropped=true;
  }
}
Program: 120056
Project: 120056
Buggy source:
public void addDropSupport(final Control control,final IDragDropDelegate delegate){
  DropTarget dropTarget=new DropTarget(control,DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT);
  dropTarget.setTransfer(types);
  dropTarget.addDropListener(new DropTargetAdapter(){
    @Override public void dragEnter(    DropTargetEvent event){
      if (!delegate.isDropAllowed(currentSelectionText)) {
        event.detail=DND.DROP_NONE;
        return;
      }
      if (event.detail == DND.DROP_DEFAULT) {
        event.detail=DND.DROP_MOVE;
      }
      for (int i=0, n=event.dataTypes.length; i < n; i++) {
        if (TextTransfer.getInstance().isSupportedType(event.dataTypes[i])) {
          event.currentDataType=event.dataTypes[i];
        }
      }
    }
    @Override public void dragLeave(    DropTargetEvent event){
      event.detail=DND.DROP_NONE;
    }
    @Override public void dragOver(    DropTargetEvent event){
      event.feedback=DND.FEEDBACK_SELECT | DND.FEEDBACK_SCROLL;
    }
    @Override public void drop(    DropTargetEvent event){
      if (TextTransfer.getInstance().isSupportedType(event.currentDataType)) {
        String data=(String)event.data;
        Point point=new Point(event.x,event.y);
        delegate.onDropItems(data,point);
        dropped=true;
      }
    }
  }
);
}

Fixed version (ground truth):
public void addDropSupport(final Control control,final IDragDropDelegate delegate){
  DropTarget dropTarget=new DropTarget(control,DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT);
  dropTarget.setTransfer(types);
  dropTarget.addDropListener(new DropTargetAdapter(){
    @Override public void dragEnter(    DropTargetEvent event){
      if (event.detail == DND.DROP_COPY && !delegate.isDropAllowed(currentSelectionText)) {
        event.detail=DND.DROP_NONE;
        return;
      }
      if (event.detail == DND.DROP_DEFAULT) {
        event.detail=DND.DROP_MOVE;
      }
      for (int i=0, n=event.dataTypes.length; i < n; i++) {
        if (TextTransfer.getInstance().isSupportedType(event.dataTypes[i])) {
          event.currentDataType=event.dataTypes[i];
        }
      }
    }
    @Override public void dragLeave(    DropTargetEvent event){
      event.detail=DND.DROP_NONE;
    }
    @Override public void dragOver(    DropTargetEvent event){
      event.feedback=DND.FEEDBACK_SELECT | DND.FEEDBACK_SCROLL;
    }
    @Override public void drop(    DropTargetEvent event){
      if (!delegate.isDropAllowed(currentSelectionText)) {
        event.detail=DND.DROP_NONE;
        return;
      }
      if (TextTransfer.getInstance().isSupportedType(event.currentDataType)) {
        String data=(String)event.data;
        Point point=new Point(event.x,event.y);
        delegate.onDropItems(data,point);
        dropped=true;
      }
    }
  }
);
}
Program: 120057
Project: 120057
Buggy source:
@Override public void dragEnter(DropTargetEvent event){
  if (!delegate.isDropAllowed(currentSelectionText)) {
    event.detail=DND.DROP_NONE;
    return;
  }
  if (event.detail == DND.DROP_DEFAULT) {
    event.detail=DND.DROP_MOVE;
  }
  for (int i=0, n=event.dataTypes.length; i < n; i++) {
    if (TextTransfer.getInstance().isSupportedType(event.dataTypes[i])) {
      event.currentDataType=event.dataTypes[i];
    }
  }
}

Fixed version (ground truth):
@Override public void dragEnter(DropTargetEvent event){
  if (event.detail == DND.DROP_COPY && !delegate.isDropAllowed(currentSelectionText)) {
    event.detail=DND.DROP_NONE;
    return;
  }
  if (event.detail == DND.DROP_DEFAULT) {
    event.detail=DND.DROP_MOVE;
  }
  for (int i=0, n=event.dataTypes.length; i < n; i++) {
    if (TextTransfer.getInstance().isSupportedType(event.dataTypes[i])) {
      event.currentDataType=event.dataTypes[i];
    }
  }
}
Program: 120058
Project: 120058
Buggy source:
@Override public void setTraceData(Map<String,String> traceData){
  Map<String,String> oldData=this.traceData;
  if (!ObjectUtils.equals(oldData,traceData)) {
    this.traceData=traceData;
    if (traceData != null) {
      String traceValue=traceData.get(ConnectionUtil.getConnectionUnifiedName(this));
      trace.setTrace(traceValue);
    }
 else {
      trace.setTrace(null);
    }
  }
}

Fixed version (ground truth):
@Override public void setTraceData(Map<String,TraceData> traceData){
  if (trace == null) {
    return;
  }
  this.traceData=traceData;
  if (traceData != null) {
    trace.setTrace(traceData.get(ConnectionUtil.getConnectionUnifiedName(this)));
  }
 else {
    trace.setTrace(null);
  }
}
Program: 120059
Project: 120059
Buggy source:
@Override public Map<String,String> getTraceData(){
  return this.traceData;
}

Fixed version (ground truth):
@Override public Map<String,TraceData> getTraceData(){
  return this.traceData;
}
Program: 120060
Project: 120060
Buggy source:
public void setTrace(String trace){
  this.trace=trace;
  firePropertyChange(TRACE_PROP,null,null);
}

Fixed version (ground truth):
public void setTrace(TraceData trace){
  this.trace=trace;
  firePropertyChange(TRACE_PROP,null,null);
}
Program: 120061
Project: 120061
Buggy source:
public String getTrace(){
  return trace;
}

Fixed version (ground truth):
public TraceData getTrace(){
  return trace;
}
Program: 120062
Project: 120062
Buggy source:
@Override protected void refreshVisuals(){
  ConnectionPart connectionPart;
  connectionPart=(ConnectionPart)getParent();
  Connection conn=(Connection)connectionPart.getModel();
  IElementParameter element=conn.getElementParameter(EParameterName.TRACES_CONNECTION_ENABLE.getName());
  Boolean flag=false;
  if (element != null) {
    flag=(Boolean)element.getValue();
  }
  ConnectionTraceFigure htmlFigure=(ConnectionTraceFigure)getFigure();
  ConnectionTrace connectionTrace=(ConnectionTrace)getModel();
  String trace=connectionTrace.getTrace();
  if (trace == null) {
    Point offset=conn.getConnectionLabel().getOffset();
    connectionTrace.getOffset().x=offset.x;
    connectionTrace.getOffset().y=offset.y;
    this.removeEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE);
  }
 else {
    this.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,new ConnTextMovePolicy());
  }
  htmlFigure.setTraceData(trace,flag,conn.checkTraceShowEnable());
  Dimension size=htmlFigure.getPreferredSize();
  connectionTrace.setSize(size);
  String connectionName=((Connection)connectionPart.getModel()).getConnectionLabel().getLabelText();
  Point offset=((ConnectionTrace)getModel()).getOffset();
  ConnectionTraceConstraint constraint=new ConnectionTraceConstraint(connectionName,size,"String_Node_Str",offset,(PolylineConnection)connectionPart.getFigure());
  connectionPart.setLayoutConstraint(this,getFigure(),constraint);
}

Fixed version (ground truth):
@Override protected void refreshVisuals(){
  ConnectionPart connectionPart;
  connectionPart=(ConnectionPart)getParent();
  Connection conn=(Connection)connectionPart.getModel();
  IElementParameter element=conn.getElementParameter(EParameterName.TRACES_CONNECTION_ENABLE.getName());
  Boolean flag=false;
  if (element != null) {
    flag=(Boolean)element.getValue();
  }
  ConnectionTraceFigure htmlFigure=(ConnectionTraceFigure)getFigure();
  ConnectionTrace connectionTrace=(ConnectionTrace)getModel();
  TraceData trace=connectionTrace.getTrace();
  if (trace == null) {
    Point offset=conn.getConnectionLabel().getOffset();
    connectionTrace.getOffset().x=offset.x;
    connectionTrace.getOffset().y=offset.y;
    this.removeEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE);
  }
 else {
    this.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,new ConnTextMovePolicy());
  }
  htmlFigure.setTraceData(trace,flag,conn.checkTraceShowEnable());
  Dimension size=htmlFigure.getPreferredSize();
  connectionTrace.setSize(size);
  String connectionName=((Connection)connectionPart.getModel()).getConnectionLabel().getLabelText();
  Point offset=((ConnectionTrace)getModel()).getOffset();
  ConnectionTraceConstraint constraint=new ConnectionTraceConstraint(connectionName,size,"String_Node_Str",offset,(PolylineConnection)connectionPart.getFigure());
  connectionPart.setLayoutConstraint(this,getFigure(),constraint);
}
Program: 120064
Project: 120064
Buggy source:
@Override public void setTraceData(Map<String,String> traceData){
  Map<String,String> oldData=this.traceData;
  if (!ObjectUtils.equals(oldData,traceData)) {
    this.traceData=traceData;
    if (traceData != null) {
      String traceValue=traceData.get(ConnectionUtil.getConnectionUnifiedName(this));
      trace.setTrace(traceValue);
    }
 else {
      trace.setTrace(null);
    }
  }
}

Fixed version (ground truth):
@Override public void setTraceData(Map<String,TraceData> traceData){
  if (trace == null) {
    return;
  }
  this.traceData=traceData;
  if (traceData != null) {
    trace.setTrace(traceData.get(ConnectionUtil.getConnectionUnifiedName(this)));
  }
 else {
    trace.setTrace(null);
  }
}
Program: 120065
Project: 120065
Buggy source:
@Override public Map<String,String> getTraceData(){
  return this.traceData;
}

Fixed version (ground truth):
@Override public Map<String,TraceData> getTraceData(){
  return this.traceData;
}
Program: 120066
Project: 120066
Buggy source:
public void setTrace(String trace){
  this.trace=trace;
  firePropertyChange(TRACE_PROP,null,null);
}

Fixed version (ground truth):
public void setTrace(TraceData trace){
  this.trace=trace;
  firePropertyChange(TRACE_PROP,null,null);
}
Program: 120067
Project: 120067
Buggy source:
public String getTrace(){
  return trace;
}

Fixed version (ground truth):
public TraceData getTrace(){
  return trace;
}
Program: 120068
Project: 120068
Buggy source:
@Override protected void refreshVisuals(){
  ConnectionPart connectionPart;
  connectionPart=(ConnectionPart)getParent();
  Connection conn=(Connection)connectionPart.getModel();
  IElementParameter element=conn.getElementParameter(EParameterName.TRACES_CONNECTION_ENABLE.getName());
  Boolean flag=false;
  if (element != null) {
    flag=(Boolean)element.getValue();
  }
  ConnectionTraceFigure htmlFigure=(ConnectionTraceFigure)getFigure();
  ConnectionTrace connectionTrace=(ConnectionTrace)getModel();
  String trace=connectionTrace.getTrace();
  if (trace == null) {
    Point offset=conn.getConnectionLabel().getOffset();
    connectionTrace.getOffset().x=offset.x;
    connectionTrace.getOffset().y=offset.y;
    this.removeEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE);
  }
 else {
    this.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,new ConnTextMovePolicy());
  }
  htmlFigure.setTraceData(trace,flag,conn.checkTraceShowEnable());
  Dimension size=htmlFigure.getPreferredSize();
  connectionTrace.setSize(size);
  String connectionName=((Connection)connectionPart.getModel()).getConnectionLabel().getLabelText();
  Point offset=((ConnectionTrace)getModel()).getOffset();
  ConnectionTraceConstraint constraint=new ConnectionTraceConstraint(connectionName,size,"String_Node_Str",offset,(PolylineConnection)connectionPart.getFigure());
  connectionPart.setLayoutConstraint(this,getFigure(),constraint);
}

Fixed version (ground truth):
@Override protected void refreshVisuals(){
  ConnectionPart connectionPart;
  connectionPart=(ConnectionPart)getParent();
  Connection conn=(Connection)connectionPart.getModel();
  IElementParameter element=conn.getElementParameter(EParameterName.TRACES_CONNECTION_ENABLE.getName());
  Boolean flag=false;
  if (element != null) {
    flag=(Boolean)element.getValue();
  }
  ConnectionTraceFigure htmlFigure=(ConnectionTraceFigure)getFigure();
  ConnectionTrace connectionTrace=(ConnectionTrace)getModel();
  TraceData trace=connectionTrace.getTrace();
  if (trace == null) {
    Point offset=conn.getConnectionLabel().getOffset();
    connectionTrace.getOffset().x=offset.x;
    connectionTrace.getOffset().y=offset.y;
    this.removeEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE);
  }
 else {
    this.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,new ConnTextMovePolicy());
  }
  htmlFigure.setTraceData(trace,flag,conn.checkTraceShowEnable());
  Dimension size=htmlFigure.getPreferredSize();
  connectionTrace.setSize(size);
  String connectionName=((Connection)connectionPart.getModel()).getConnectionLabel().getLabelText();
  Point offset=((ConnectionTrace)getModel()).getOffset();
  ConnectionTraceConstraint constraint=new ConnectionTraceConstraint(connectionName,size,"String_Node_Str",offset,(PolylineConnection)connectionPart.getFigure());
  connectionPart.setLayoutConstraint(this,getFigure(),constraint);
}
Program: 120070
Project: 120070
Buggy source:
protected Node createDummyNode(NodeType nType,Hashtable<String,Node> nodesHashtable){
  DummyComponent component=new DummyComponent(nType);
  Node nc;
  nc=new Node(component,this);
  nc.setLocation(new Point(nType.getPosX(),nType.getPosY()));
  Point offset=new Point(nType.getOffsetLabelX(),nType.getOffsetLabelY());
  nc.getNodeLabel().setOffset(offset);
  if (nType.isSetSizeX()) {
    nc.setSize(new Dimension(nType.getSizeX(),nType.getSizeY()));
  }
  loadElementParameters(nc,nType.getElementParameter());
  NodeContainer nodec=null;
  if (nc.isJoblet() || nc.isMapReduce()) {
    nodec=new JobletContainer(nc);
  }
 else {
    nodec=new NodeContainer(nc);
  }
  loadSchema(nc,nType);
  addNodeContainer(nodec);
  nodesHashtable.put(nc.getUniqueName(),nc);
  return nc;
}

Fixed version (ground truth):
protected Node createDummyNode(NodeType nType,Hashtable<String,Node> nodesHashtable){
  DummyComponent component=new DummyComponent(nType);
  Node nc;
  nc=new Node(component,this);
  nc.setLocation(new Point(nType.getPosX(),nType.getPosY()));
  Point offset=new Point(nType.getOffsetLabelX(),nType.getOffsetLabelY());
  nc.getNodeLabel().setOffset(offset);
  if (nType.isSetSizeX()) {
    nc.setSize(new Dimension(nType.getSizeX(),nType.getSizeY()));
  }
  NodeContainer nodec=null;
  if (nc.isJoblet() || nc.isMapReduce()) {
    nodec=new JobletContainer(nc);
  }
 else {
    nodec=new NodeContainer(nc);
  }
  loadSchema(nc,nType);
  addNodeContainer(nodec);
  nodesHashtable.put(nc.getUniqueName(),nc);
  return nc;
}
Program: 120075
Project: 120075
Buggy source:
public void renameInputConnection(String oldName,String newName){
  List<Map<String,String>> listRoot=(List<Map<String,String>>)this.getElementParameter(ROOT).getValue();
  boolean flagRoot=false;
  String schemaId=oldName + "String_Node_Str";
  for (  Map<String,String> map : listRoot) {
    String rowName=map.get(COLUMN);
    if (rowName == null) {
      continue;
    }
    if (rowName.equals(oldName)) {
      map.put(COLUMN,newName);
      flagRoot=true;
    }
 else     if (rowName.startsWith(schemaId)) {
      rowName=newName + rowName.substring(rowName.indexOf("String_Node_Str"));
      map.put(COLUMN,rowName);
      flagRoot=true;
    }
  }
  if (flagRoot) {
    this.getElementParameter(ROOT).setValue(listRoot);
  }
}

Fixed version (ground truth):
public void renameInputConnection(String oldName,String newName){
  INode node=getOriginalNode();
  if (oldName != null) {
    IElementParameter elementParameter=this.getElementParameter("String_Node_Str");
    if (elementParameter != null) {
      Object listItemsValue=elementParameter.getValue();
      if (listItemsValue instanceof List) {
        for (        Object obj : (List)listItemsValue) {
          if (obj instanceof Map) {
            Object row=((Map)obj).get("String_Node_Str");
            if (oldName.equals(row)) {
              ((Map)obj).put("String_Node_Str",newName);
            }
          }
        }
      }
    }
  }
  if (node != null && !EmfComponent.REPOSITORY.equals(node.getPropertyValue(EParameterName.PROPERTY_TYPE.getName()))) {
    List<Map<String,String>> listRoot=(List<Map<String,String>>)this.getElementParameter(ROOT).getValue();
    boolean flagRoot=false;
    String schemaId=oldName + "String_Node_Str";
    for (    Map<String,String> map : listRoot) {
      String rowName=map.get(COLUMN);
      if (rowName == null) {
        continue;
      }
      if (rowName.equals(oldName)) {
        map.put(COLUMN,newName);
        flagRoot=true;
      }
 else       if (rowName.startsWith(schemaId)) {
        rowName=newName + rowName.substring(rowName.indexOf("String_Node_Str"));
        map.put(COLUMN,rowName);
        flagRoot=true;
      }
    }
    if (flagRoot) {
      this.getElementParameter(ROOT).setValue(listRoot);
    }
  }
}
Program: 120076
Project: 120076
Buggy source:
protected HL7TreeNode addElement(HL7TreeNode current,String currentPath,String newPath,String defaultValue){
  String name=newPath.substring(newPath.lastIndexOf("String_Node_Str") + 1);
  String parentPath="String_Node_Str";
  if (newPath.contains("String_Node_Str")) {
    parentPath=newPath.substring(0,newPath.lastIndexOf("String_Node_Str"));
  }
  HL7TreeNode temp=new Element(name,defaultValue);
  if (current == null) {
    return temp;
  }
  if (currentPath.equals(parentPath)) {
    current.addChild(temp);
  }
 else {
    String[] nods=currentPath.split("String_Node_Str");
    String[] newNods=parentPath.split("String_Node_Str");
    int parentLevel=0;
    int checkLength=nods.length < newNods.length ? nods.length : newNods.length;
    for (int i=1; i < checkLength; i++) {
      if (nods[i].equals(newNods[i])) {
        parentLevel=i;
      }
    }
    HL7TreeNode parent=current;
    for (int i=0; i < nods.length - (parentLevel + 1); i++) {
      HL7TreeNode tmpParent=parent.getParent();
      if (tmpParent == null) {
        break;
      }
      parent=tmpParent;
    }
    if (parent != null)     parent.addChild(temp);
  }
  return temp;
}

Fixed version (ground truth):
protected HL7TreeNode addElement(HL7TreeNode current,String currentPath,String newPath,String defaultValue,Map<String,HL7TreeNode> mapNodes){
  HL7TreeNode temp=mapNodes.get(newPath);
  if (temp == null) {
    String name=newPath.substring(newPath.lastIndexOf("String_Node_Str") + 1);
    temp=new Element(name,defaultValue);
    if (current == null) {
      mapNodes.put(newPath,temp);
      return temp;
    }
    mapNodes.put(newPath,temp);
    String parentPath=newPath.substring(0,newPath.lastIndexOf("String_Node_Str"));
    HL7TreeNode parentNode=mapNodes.get(parentPath);
    if (parentNode != null) {
      parentNode.addChild(temp);
    }
 else {
      ExceptionHandler.log("String_Node_Str" + parentPath);
    }
  }
  return temp;
}
Program: 120078
Project: 120078
Buggy source:
protected Command createButtonCommand(Button button){
  IElementParameter switchParam=elem.getElementParameter(EParameterName.REPOSITORY_ALLOW_AUTO_SWITCH.getName());
  String paramName=(String)button.getData(PARAMETER_NAME);
  IElementParameter param=elem.getElementParameter(paramName);
  Object data=button.getData(NAME);
  if (data != null && data.equals(REPOSITORY_CHOICE)) {
    String propertyType=(String)elem.getPropertyValue(EParameterName.SCHEMA_TYPE.getName());
    if (EmfComponent.BUILTIN.equals(propertyType)) {
      MessageDialog.openWarning(button.getShell(),"String_Node_Str","String_Node_Str");
      return null;
    }
    ERepositoryObjectType type=ERepositoryObjectType.METADATA_VALIDATION_RULES;
    RepositoryReviewDialog dialog=new RepositoryReviewDialog(button.getShell(),type,param.getRepositoryValue(),new ViewerFilter[]{new ValidationRuleFilter()});
    if (dialog.open() == RepositoryReviewDialog.OK) {
      RepositoryNode node=dialog.getResult();
      while (node.getObject().getProperty().getItem() == null || (!(node.getObject().getProperty().getItem() instanceof ConnectionItem))) {
        node=node.getParent();
      }
      if (switchParam != null) {
        switchParam.setValue(Boolean.FALSE);
      }
      String id=dialog.getResult().getObject().getProperty().getId();
      if (id.equals(elem.getPropertyValue(paramName))) {
        return null;
      }
      return new PropertyChangeCommand(elem,EParameterName.REPOSITORY_VALIDATION_RULE_TYPE.getName(),id);
    }
  }
  return null;
}

Fixed version (ground truth):
protected Command createButtonCommand(Button button){
  IElementParameter switchParam=elem.getElementParameter(EParameterName.REPOSITORY_ALLOW_AUTO_SWITCH.getName());
  String paramName=(String)button.getData(PARAMETER_NAME);
  IElementParameter param=elem.getElementParameter(paramName);
  Object data=button.getData(NAME);
  if (data != null && data.equals(REPOSITORY_CHOICE)) {
    String propertyType=(String)elem.getPropertyValue(EParameterName.SCHEMA_TYPE.getName());
    if (EmfComponent.BUILTIN.equals(propertyType)) {
      MessageDialog.openWarning(button.getShell(),"String_Node_Str","String_Node_Str");
      return null;
    }
    ERepositoryObjectType type=ERepositoryObjectType.METADATA_VALIDATION_RULES;
    RepositoryReviewDialog dialog=new RepositoryReviewDialog(button.getShell(),type,param.getRepositoryValue(),new ViewerFilter[]{new ValidationRuleFilter()},elem);
    if (dialog.open() == RepositoryReviewDialog.OK) {
      RepositoryNode node=dialog.getResult();
      while (node.getObject().getProperty().getItem() == null || (!(node.getObject().getProperty().getItem() instanceof ConnectionItem))) {
        node=node.getParent();
      }
      if (switchParam != null) {
        switchParam.setValue(Boolean.FALSE);
      }
      String id=dialog.getResult().getObject().getProperty().getId();
      if (id.equals(elem.getPropertyValue(paramName))) {
        return null;
      }
      return new PropertyChangeCommand(elem,EParameterName.REPOSITORY_VALIDATION_RULE_TYPE.getName(),id);
    }
  }
  return null;
}
Program: 120079
Project: 120079
Buggy source:
public static List<IRepositoryViewObject> getRelatedValidationRuleObjs(String schemaId){
  List<IRepositoryViewObject> rulesObjs=new ArrayList<IRepositoryViewObject>();
  if (schemaId != null) {
    try {
      IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
      List<IRepositoryViewObject> members=factory.getAll(ERepositoryObjectType.METADATA_VALIDATION_RULES);
      if (members != null && members.size() > 0) {
        for (        IRepositoryViewObject member : members) {
          if (member != null && member.getProperty() != null) {
            Item item=member.getProperty().getItem();
            if (item != null && item instanceof ValidationRulesConnectionItem) {
              ValidationRulesConnectionItem validItem=(ValidationRulesConnectionItem)item;
              ValidationRulesConnection connection=(ValidationRulesConnection)validItem.getConnection();
              if (connection != null && schemaId.equals(connection.getBaseSchema()) && !rulesObjs.contains(member)) {
                rulesObjs.add(member);
              }
            }
          }
        }
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  return rulesObjs;
}

Fixed version (ground truth):
public static List<IRepositoryViewObject> getRelatedValidationRuleObjs(String schemaId){
  List<IRepositoryViewObject> rulesObjs=new ArrayList<IRepositoryViewObject>();
  if (schemaId != null) {
    try {
      IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
      List<IRepositoryViewObject> members=factory.getAll(ERepositoryObjectType.METADATA_VALIDATION_RULES);
      if (members != null && members.size() > 0) {
        for (        IRepositoryViewObject member : members) {
          if (member != null && member.getProperty() != null) {
            Item item=member.getProperty().getItem();
            if (item != null && item instanceof ValidationRulesConnectionItem) {
              ValidationRulesConnectionItem validItem=(ValidationRulesConnectionItem)item;
              ValidationRulesConnection connection=(ValidationRulesConnection)validItem.getConnection();
              if (connection != null && !rulesObjs.contains(member)) {
                rulesObjs.add(member);
              }
            }
          }
        }
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  return rulesObjs;
}
Program: 120080
Project: 120080
Buggy source:
protected Command createButtonCommand(Button button){
  IElementParameter switchParam=elem.getElementParameter(EParameterName.REPOSITORY_ALLOW_AUTO_SWITCH.getName());
  String paramName=(String)button.getData(PARAMETER_NAME);
  IElementParameter param=elem.getElementParameter(paramName);
  Object data=button.getData(NAME);
  if (data != null && data.equals(REPOSITORY_CHOICE)) {
    String propertyType=(String)elem.getPropertyValue(EParameterName.SCHEMA_TYPE.getName());
    if (EmfComponent.BUILTIN.equals(propertyType)) {
      MessageDialog.openWarning(button.getShell(),"String_Node_Str","String_Node_Str");
      return null;
    }
    ERepositoryObjectType type=ERepositoryObjectType.METADATA_VALIDATION_RULES;
    RepositoryReviewDialog dialog=new RepositoryReviewDialog(button.getShell(),type,param.getRepositoryValue(),new ViewerFilter[]{new ValidationRuleFilter()});
    if (dialog.open() == RepositoryReviewDialog.OK) {
      RepositoryNode node=dialog.getResult();
      while (node.getObject().getProperty().getItem() == null || (!(node.getObject().getProperty().getItem() instanceof ConnectionItem))) {
        node=node.getParent();
      }
      if (switchParam != null) {
        switchParam.setValue(Boolean.FALSE);
      }
      String id=dialog.getResult().getObject().getProperty().getId();
      if (id.equals(elem.getPropertyValue(paramName))) {
        return null;
      }
      return new PropertyChangeCommand(elem,EParameterName.REPOSITORY_VALIDATION_RULE_TYPE.getName(),id);
    }
  }
  return null;
}

Fixed version (ground truth):
protected Command createButtonCommand(Button button){
  IElementParameter switchParam=elem.getElementParameter(EParameterName.REPOSITORY_ALLOW_AUTO_SWITCH.getName());
  String paramName=(String)button.getData(PARAMETER_NAME);
  IElementParameter param=elem.getElementParameter(paramName);
  Object data=button.getData(NAME);
  if (data != null && data.equals(REPOSITORY_CHOICE)) {
    String propertyType=(String)elem.getPropertyValue(EParameterName.SCHEMA_TYPE.getName());
    if (EmfComponent.BUILTIN.equals(propertyType)) {
      MessageDialog.openWarning(button.getShell(),"String_Node_Str","String_Node_Str");
      return null;
    }
    ERepositoryObjectType type=ERepositoryObjectType.METADATA_VALIDATION_RULES;
    RepositoryReviewDialog dialog=new RepositoryReviewDialog(button.getShell(),type,param.getRepositoryValue(),new ViewerFilter[]{new ValidationRuleFilter()},elem);
    if (dialog.open() == RepositoryReviewDialog.OK) {
      RepositoryNode node=dialog.getResult();
      while (node.getObject().getProperty().getItem() == null || (!(node.getObject().getProperty().getItem() instanceof ConnectionItem))) {
        node=node.getParent();
      }
      if (switchParam != null) {
        switchParam.setValue(Boolean.FALSE);
      }
      String id=dialog.getResult().getObject().getProperty().getId();
      if (id.equals(elem.getPropertyValue(paramName))) {
        return null;
      }
      return new PropertyChangeCommand(elem,EParameterName.REPOSITORY_VALIDATION_RULE_TYPE.getName(),id);
    }
  }
  return null;
}
Program: 120081
Project: 120081
Buggy source:
public static List<IRepositoryViewObject> getRelatedValidationRuleObjs(String schemaId){
  List<IRepositoryViewObject> rulesObjs=new ArrayList<IRepositoryViewObject>();
  if (schemaId != null) {
    try {
      IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
      List<IRepositoryViewObject> members=factory.getAll(ERepositoryObjectType.METADATA_VALIDATION_RULES);
      if (members != null && members.size() > 0) {
        for (        IRepositoryViewObject member : members) {
          if (member != null && member.getProperty() != null) {
            Item item=member.getProperty().getItem();
            if (item != null && item instanceof ValidationRulesConnectionItem) {
              ValidationRulesConnectionItem validItem=(ValidationRulesConnectionItem)item;
              ValidationRulesConnection connection=(ValidationRulesConnection)validItem.getConnection();
              if (connection != null && schemaId.equals(connection.getBaseSchema()) && !rulesObjs.contains(member)) {
                rulesObjs.add(member);
              }
            }
          }
        }
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  return rulesObjs;
}

Fixed version (ground truth):
public static List<IRepositoryViewObject> getRelatedValidationRuleObjs(String schemaId){
  List<IRepositoryViewObject> rulesObjs=new ArrayList<IRepositoryViewObject>();
  if (schemaId != null) {
    try {
      IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
      List<IRepositoryViewObject> members=factory.getAll(ERepositoryObjectType.METADATA_VALIDATION_RULES);
      if (members != null && members.size() > 0) {
        for (        IRepositoryViewObject member : members) {
          if (member != null && member.getProperty() != null) {
            Item item=member.getProperty().getItem();
            if (item != null && item instanceof ValidationRulesConnectionItem) {
              ValidationRulesConnectionItem validItem=(ValidationRulesConnectionItem)item;
              ValidationRulesConnection connection=(ValidationRulesConnection)validItem.getConnection();
              if (connection != null && !rulesObjs.contains(member)) {
                rulesObjs.add(member);
              }
            }
          }
        }
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  return rulesObjs;
}
Program: 120082
Project: 120082
Buggy source:
private void collectNodes(Map<String,Item> items,RepositoryNode repositoryNode){
  IRepositoryViewObject repositoryObject=repositoryNode.getObject();
  if (repositoryObject != null) {
    if (repositoryObject.getRepositoryObjectType().isResourceItem()) {
      Item item=repositoryObject.getProperty().getItem();
      items.put(item.getProperty().getId(),item);
    }
  }
 else {
    if (repositoryNode.getParent() != null && repositoryNode.getParent().getObject() != null) {
      Item item=repositoryNode.getParent().getObject().getProperty().getItem();
      items.put(item.getProperty().getId(),item);
    }
  }
  if (filteredCheckboxTree != null && !isHadoopClusterNode(repositoryNode)) {
    IContentProvider contentProvider=filteredCheckboxTree.getViewer().getContentProvider();
    if (contentProvider instanceof ITreeContentProvider) {
      Object[] children=((ITreeContentProvider)contentProvider).getChildren(repositoryNode);
      collectNodes(items,children);
    }
  }
}

Fixed version (ground truth):
private void collectNodes(Map<String,Item> items,RepositoryNode repositoryNode){
  IRepositoryViewObject repositoryObject=repositoryNode.getObject();
  if (repositoryObject != null) {
    if (repositoryObject.getRepositoryObjectType().isResourceItem()) {
      Item item=repositoryObject.getProperty().getItem();
      items.put(item.getProperty().getId(),item);
    }
  }
 else {
    if (repositoryNode.getParent() != null && repositoryNode.getParent().getObject() != null) {
      Item item=repositoryNode.getParent().getObject().getProperty().getItem();
      items.put(item.getProperty().getId(),item);
    }
  }
  if (filteredCheckboxTree != null && !isHadoopClusterNode(repositoryNode)) {
    IContentProvider contentProvider=filteredCheckboxTree.getViewer().getContentProvider();
    if (contentProvider instanceof ITreeContentProvider) {
      if (selectRepositoryNode(getItemsTreeViewer(),repositoryNode)) {
        Object[] children=((ITreeContentProvider)contentProvider).getChildren(repositoryNode);
        collectNodes(items,children);
      }
    }
  }
}
Program: 120083
Project: 120083
Buggy source:
private void collectNodes(Map<String,Item> items,Object[] objects){
  for (  Object object : objects) {
    if (object instanceof RepositoryNode) {
      RepositoryNode repositoryNode=(RepositoryNode)object;
      IRepositoryViewObject repositoryObject=repositoryNode.getObject();
      if (repositoryObject != null) {
        if (repositoryObject.getRepositoryObjectType().isResourceItem()) {
          Item item=repositoryObject.getProperty().getItem();
          items.put(item.getProperty().getId(),item);
        }
      }
 else {
        if (repositoryNode.getParent() != null && repositoryNode.getParent().getObject() != null) {
          Item item=repositoryNode.getParent().getObject().getProperty().getItem();
          items.put(item.getProperty().getId(),item);
        }
      }
      if (filteredCheckboxTree != null && !isHadoopClusterNode(repositoryNode)) {
        IContentProvider contentProvider=filteredCheckboxTree.getViewer().getContentProvider();
        if (contentProvider instanceof ITreeContentProvider) {
          Object[] children=((ITreeContentProvider)contentProvider).getChildren(repositoryNode);
          collectNodes(items,children);
        }
      }
    }
 else {
      for (      IExtendedRepositoryNodeHandler nodeHandler : RepositoryContentManager.getExtendedNodeHandler()) {
        Property property=nodeHandler.getProperty(object);
        if (property != null) {
          items.put(property.getId(),property.getItem());
        }
      }
    }
  }
}

Fixed version (ground truth):
private void collectNodes(Map<String,Item> items,Object[] objects){
  for (  Object object : objects) {
    if (object instanceof RepositoryNode) {
      RepositoryNode repositoryNode=(RepositoryNode)object;
      IRepositoryViewObject repositoryObject=repositoryNode.getObject();
      if (repositoryObject != null) {
        if (repositoryObject.getRepositoryObjectType().isResourceItem()) {
          Item item=repositoryObject.getProperty().getItem();
          items.put(item.getProperty().getId(),item);
        }
      }
 else {
        if (repositoryNode.getParent() != null && repositoryNode.getParent().getObject() != null) {
          Item item=repositoryNode.getParent().getObject().getProperty().getItem();
          items.put(item.getProperty().getId(),item);
        }
      }
      if (filteredCheckboxTree != null && !isHadoopClusterNode(repositoryNode)) {
        IContentProvider contentProvider=filteredCheckboxTree.getViewer().getContentProvider();
        if (contentProvider instanceof ITreeContentProvider) {
          if (selectRepositoryNode(getItemsTreeViewer(),repositoryNode)) {
            Object[] children=((ITreeContentProvider)contentProvider).getChildren(repositoryNode);
            collectNodes(items,children);
          }
        }
      }
    }
 else {
      for (      IExtendedRepositoryNodeHandler nodeHandler : RepositoryContentManager.getExtendedNodeHandler()) {
        Property property=nodeHandler.getProperty(object);
        if (property != null) {
          items.put(property.getId(),property.getItem());
        }
      }
    }
  }
}
Program: 120085
Project: 120085
Buggy source:
protected Control createDialogArea(Composite parent){
  Composite container=(Composite)super.createDialogArea(parent);
  TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(),"String_Node_Str");
  GridData data=(GridData)container.getLayoutData();
  data.minimumHeight=400;
  data.heightHint=400;
  data.minimumWidth=500;
  data.widthHint=500;
  container.setLayoutData(data);
  textFilter=new ViewerTextFilter();
  createFilterField(container);
  treeViewer=provider.createViewer(container);
  treeViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      getButton(IDialogConstants.OK_ID).setEnabled(isValidSelection(event));
    }
  }
);
  treeViewer.addDoubleClickListener(new IDoubleClickListener(){
    public void doubleClick(    DoubleClickEvent event){
      if (getButton(IDialogConstants.OK_ID).isEnabled()) {
        okPressed();
      }
    }
  }
);
  treeViewer.addFilter(textFilter);
  treeViewer.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      return filterByType(viewer,parentElement,element);
    }
  }
);
  return container;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  Composite container=(Composite)super.createDialogArea(parent);
  TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(),"String_Node_Str");
  GridData data=(GridData)container.getLayoutData();
  data.minimumHeight=400;
  data.heightHint=400;
  data.minimumWidth=500;
  data.widthHint=500;
  container.setLayoutData(data);
  textFilter=new ViewerTextFilter();
  createFilterField(container);
  treeViewer=provider.createViewer(container);
  treeViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      getButton(IDialogConstants.OK_ID).setEnabled(isValidSelection(event));
    }
  }
);
  treeViewer.addDoubleClickListener(new IDoubleClickListener(){
    @Override public void doubleClick(    DoubleClickEvent event){
      if (getButton(IDialogConstants.OK_ID).isEnabled()) {
        okPressed();
      }
    }
  }
);
  treeViewer.addFilter(textFilter);
  treeViewer.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      return filterByType(viewer,parentElement,element);
    }
  }
);
  return container;
}
Program: 120086
Project: 120086
Buggy source:
public void doubleClick(DoubleClickEvent event){
  if (getButton(IDialogConstants.OK_ID).isEnabled()) {
    okPressed();
  }
}

Fixed version (ground truth):
@Override public void doubleClick(DoubleClickEvent event){
  if (getButton(IDialogConstants.OK_ID).isEnabled()) {
    okPressed();
  }
}