nus-yam/ex-repair huggingface dataset:
Program: 51806
Project: 51806
Buggy source:
public TimelineView(AbstractComponent ac,ViewInfo vi){
  super(ac=PlatformAccess.getPlatform().getPersistenceProvider().getComponent(ac.getComponentId()),vi);
  getContentPane().setLayout(new BorderLayout());
  getContentPane().add(upperPanel,BorderLayout.NORTH);
  upperPanel.setLayout(new BoxLayout(upperPanel,BoxLayout.Y_AXIS));
  upperPanel.setOpaque(false);
  upperPanel.add(Box.createVerticalStrut(TIMELINE_ROW_SPACING));
  getContentPane().setBackground(backgroundColor);
  for (  AbstractComponent child : ac.getComponents()) {
    addTopLevelActivity(child);
  }
  upperPanel.add(new CollapsibleContainer(GraphView.VIEW_INFO.createView(ac)));
}

Fixed version (ground truth):
public TimelineView(AbstractComponent ac,ViewInfo vi){
  super(vi.getViewType().equals(ViewType.EMBEDDED) ? ac : (ac=PlatformAccess.getPlatform().getPersistenceProvider().getComponent(ac.getComponentId())),vi);
  getContentPane().setLayout(new BorderLayout());
  getContentPane().add(upperPanel,BorderLayout.NORTH);
  upperPanel.setLayout(new BoxLayout(upperPanel,BoxLayout.Y_AXIS));
  upperPanel.setOpaque(false);
  upperPanel.add(Box.createVerticalStrut(TIMELINE_ROW_SPACING));
  getContentPane().setBackground(backgroundColor);
  for (  AbstractComponent child : ac.getComponents()) {
    addTopLevelActivity(child);
  }
  upperPanel.add(new CollapsibleContainer(GraphView.VIEW_INFO.createView(ac)));
}
Program: 51807
Project: 51807
Buggy source:
private void constrainActivities(DurationCapability source,boolean isStart){
  int sign=isStart ? 1 : -1;
  long movingEdge=isStart ? source.getStart() : source.getEnd();
  long mostOverlapping=movingEdge;
  DurationCapability durationCapabilityToShift=null;
  for (  AbstractComponent child : getComponents()) {
    DurationCapability dc=child.getCapability(DurationCapability.class);
    if (dc != source && overlaps(dc,source)) {
      long movedEdge=isStart ? dc.getEnd() : dc.getStart();
      if (movedEdge * sign > mostOverlapping * sign) {
        mostOverlapping=movedEdge;
        durationCapabilityToShift=dc;
      }
    }
  }
  if (durationCapabilityToShift != null) {
    long delta=movingEdge - mostOverlapping;
    durationCapabilityToShift.setStart(durationCapabilityToShift.getStart() + delta);
    durationCapabilityToShift.setEnd(durationCapabilityToShift.getEnd() + delta);
    constrainActivities(durationCapabilityToShift,isStart);
  }
}

Fixed version (ground truth):
private void constrainActivities(DurationCapability source,boolean isStart){
  int sign=isStart ? 1 : -1;
  long movingEdge=isStart ? source.getStart() : source.getEnd();
  long mostOverlapping=movingEdge;
  DurationCapability durationCapabilityToShift=null;
  for (  AbstractComponent child : getComponents()) {
    DurationCapability dc=child.getCapability(DurationCapability.class);
    if (dc != source && overlaps(dc,source)) {
      long movedEdge=isStart ? dc.getEnd() : dc.getStart();
      if (movedEdge * sign > mostOverlapping * sign) {
        mostOverlapping=movedEdge;
        durationCapabilityToShift=dc;
      }
    }
  }
  if (durationCapabilityToShift != null) {
    long delta=movingEdge - mostOverlapping;
    durationCapabilityToShift.setStart(durationCapabilityToShift.getStart() + delta);
    durationCapabilityToShift.setEnd(durationCapabilityToShift.getEnd() + delta);
    constrainActivities(durationCapabilityToShift,delta < 0);
  }
}
Program: 51809
Project: 51809
Buggy source:
@Override public void mouseDragged(MouseEvent e){
  if (activeHandle != null) {
    boolean isTowardStart=e.getXOnScreen() < priorX;
    int xDiff=e.getXOnScreen() - initialX;
    long tDiff=(long)(xDiff / parentView.getPixelScale());
    long currentTimeDiff=activeHandle.changesStart ? (durationCapability.getStart() - initialStart) : (durationCapability.getEnd() - initialEnd);
    tDiff=clamp(tDiff,activeHandle.changesStart ? initialStart : initialEnd,activeHandle.changesStart ? parentView.getStart() : initialStart,activeHandle.changesEnd ? parentView.getEnd() : initialEnd);
    tDiff-=currentTimeDiff;
    if (Math.abs(tDiff) > (durationCapability.getEnd() - durationCapability.getStart()) / 2) {
      tDiff=(durationCapability.getEnd() - durationCapability.getStart()) / 2 * (tDiff > 0 ? 1 : -1);
    }
    if (activeHandle.changesStart) {
      durationCapability.setStart(durationCapability.getStart() + tDiff);
    }
    if (activeHandle.changesEnd) {
      durationCapability.setEnd(durationCapability.getEnd() + tDiff);
    }
    if (parentComponent != null) {
      parentComponent.constrainChildren(durationCapability,isTowardStart);
    }
    parentView.revalidate();
    parentView.repaint();
    parentView.stateChanged(null);
    Object src=e.getSource();
    if (src instanceof Component) {
      ((Component)src).invalidate();
      ((Component)src).validate();
      ((Component)src).repaint();
    }
    parentView.getManifestedComponent().save();
    priorX=e.getXOnScreen();
  }
}

Fixed version (ground truth):
@Override public void mouseDragged(MouseEvent e){
  if (activeHandle != null) {
    int xDiff=e.getXOnScreen() - initialX;
    if (xDiff == 0)     return;
    long tDiff=(long)(xDiff / parentView.getPixelScale());
    long currentTimeDiff=activeHandle.changesStart ? (durationCapability.getStart() - initialStart) : (durationCapability.getEnd() - initialEnd);
    tDiff=clamp(tDiff,activeHandle.changesStart ? initialStart : initialEnd,activeHandle.changesStart ? parentView.getStart() : initialStart,activeHandle.changesEnd ? parentView.getEnd() : initialEnd);
    tDiff-=currentTimeDiff;
    if (tDiff == 0)     return;
    long timeStep=(long)(1 / parentView.getPixelScale());
    boolean isTowardStart=tDiff < 0;
    for (long t=0; t <= Math.abs(tDiff); t+=timeStep) {
      long delta=(tDiff < 0 ? -1 : 1) * ((t == 0) ? (Math.abs(tDiff) % timeStep) : timeStep);
      if (activeHandle.changesStart) {
        durationCapability.setStart(durationCapability.getStart() + delta);
      }
      if (activeHandle.changesEnd) {
        durationCapability.setEnd(durationCapability.getEnd() + delta);
      }
      if (parentComponent != null) {
        parentComponent.constrainChildren(durationCapability,isTowardStart);
      }
    }
    parentView.revalidate();
    parentView.repaint();
    parentView.stateChanged(null);
    Object src=e.getSource();
    if (src instanceof Component) {
      ((Component)src).invalidate();
      ((Component)src).validate();
      ((Component)src).repaint();
    }
    parentView.getManifestedComponent().save();
    priorX=e.getXOnScreen();
  }
}
Program: 51810
Project: 51810
Buggy source:
@Override public long getStart(){
  return parent != null ? parent.getStart() : centerTime - (long)((masterDuration.getEnd() - masterDuration.getStart()) / getZoom()) / 2;
}

Fixed version (ground truth):
@Override public long getStart(){
  return parent != null ? parent.getStart() : centerTime - (long)(((double)(masterDuration.getEnd() - masterDuration.getStart()) / getZoom()) / 2.0);
}
Program: 51811
Project: 51811
Buggy source:
@Override public long getEnd(){
  return parent != null ? parent.getStart() : centerTime + (long)((masterDuration.getEnd() - masterDuration.getStart()) / getZoom()) / 2;
}

Fixed version (ground truth):
@Override public long getEnd(){
  return parent != null ? parent.getStart() : centerTime + (long)(((double)(masterDuration.getEnd() - masterDuration.getStart()) / getZoom()) / 2.0);
}
Program: 51812
Project: 51812
Buggy source:
public double getPixelScale(){
  return parent != null ? parent.getPixelScale() : getZoom() * (double)(getWidth() - getLeftPadding() - getRightPadding()) / (double)(getEnd() - getStart());
}

Fixed version (ground truth):
public double getPixelScale(){
  return parent != null ? parent.getPixelScale() : (double)(getWidth() - getLeftPadding() - getRightPadding()) / (double)(getEnd() - getStart());
}
Program: 51813
Project: 51813
Buggy source:
@Override public void stateChanged(ChangeEvent e){
  revalidate();
  repaint();
  contentPane.revalidate();
  contentPane.repaint();
  for (  ChangeListener l : changeListeners) {
    l.stateChanged(e);
  }
}

Fixed version (ground truth):
@Override public void stateChanged(ChangeEvent e){
  updateLabels();
  revalidate();
  repaint();
  contentPane.revalidate();
  contentPane.repaint();
  for (  ChangeListener l : changeListeners) {
    l.stateChanged(e);
  }
}
Program: 51814
Project: 51814
Buggy source:
@Override public List<PropertyDescriptor> getFieldDescriptors(){
  List<PropertyDescriptor> fields=new ArrayList<PropertyDescriptor>();
  PropertyDescriptor duration=new PropertyDescriptor("String_Node_Str",new TextPropertyEditor(this),VisualControlDescriptor.TextField);
  duration.setFieldMutable(true);
  fields.add(duration);
  return fields;
}

Fixed version (ground truth):
@Override public List<PropertyDescriptor> getFieldDescriptors(){
  List<PropertyDescriptor> fields=new ArrayList<PropertyDescriptor>();
  PropertyDescriptor duration=new PropertyDescriptor("String_Node_Str",new DurationPropertyEditor(this),VisualControlDescriptor.TextField);
  duration.setFieldMutable(true);
  PropertyDescriptor power=new PropertyDescriptor("String_Node_Str",new PowerPropertyEditor(this),VisualControlDescriptor.TextField);
  power.setFieldMutable(true);
  PropertyDescriptor comm=new PropertyDescriptor("String_Node_Str",new CommPropertyEditor(this),VisualControlDescriptor.TextField);
  comm.setFieldMutable(true);
  fields.add(duration);
  fields.add(power);
  fields.add(comm);
  return fields;
}
Program: 51815
Project: 51815
Buggy source:
@Override public AbstractComponent createActivity(AbstractComponent parent){
  ComponentRegistry registry=ActivityCreationServiceImpl.registry.get();
  ActivityComponent activity=registry.newInstance(ActivityComponent.class,parent);
  activity.getModel().getData().setDuration(0.0);
  activity.save();
  return activity;
}

Fixed version (ground truth):
@Override public AbstractComponent createActivity(AbstractComponent parent){
  ComponentRegistry registry=ActivityCreationServiceImpl.registry.get();
  ActivityComponent activity=registry.newInstance(ActivityComponent.class,parent);
  activity.getModel().getData().setDuration(0.0);
  activity.getModel().getData().setPower(0);
  activity.getModel().getData().setComm(0);
  activity.save();
  return activity;
}
Program: 51816
Project: 51816
Buggy source:
@Override public List<PropertyDescriptor> getFieldDescriptors(){
  List<PropertyDescriptor> fields=new ArrayList<PropertyDescriptor>();
  PropertyDescriptor duration=new PropertyDescriptor("String_Node_Str",new TextPropertyEditor(this),VisualControlDescriptor.TextField);
  duration.setFieldMutable(true);
  fields.add(duration);
  return fields;
}

Fixed version (ground truth):
@Override public List<PropertyDescriptor> getFieldDescriptors(){
  List<PropertyDescriptor> fields=new ArrayList<PropertyDescriptor>();
  PropertyDescriptor duration=new PropertyDescriptor("String_Node_Str",new DurationPropertyEditor(this),VisualControlDescriptor.TextField);
  duration.setFieldMutable(true);
  fields.add(duration);
  return fields;
}
Program: 51817
Project: 51817
Buggy source:
@Override public List<PropertyDescriptor> getFieldDescriptors(){
  List<PropertyDescriptor> fields=new ArrayList<PropertyDescriptor>();
  PropertyDescriptor duration=new PropertyDescriptor("String_Node_Str",new TextPropertyEditor(this),VisualControlDescriptor.TextField);
  duration.setFieldMutable(true);
  fields.add(duration);
  return fields;
}

Fixed version (ground truth):
@Override public List<PropertyDescriptor> getFieldDescriptors(){
  List<PropertyDescriptor> fields=new ArrayList<PropertyDescriptor>();
  PropertyDescriptor duration=new PropertyDescriptor("String_Node_Str",new DurationPropertyEditor(this),VisualControlDescriptor.TextField);
  duration.setFieldMutable(true);
  fields.add(duration);
  return fields;
}
Program: 51818
Project: 51818
Buggy source:
@Override public Collection<ViewInfo> getViews(String componentTypeId){
  if (componentTypeId.equals(ActivityComponent.class.getName())) {
    return Arrays.asList(new ViewInfo(TimelineView.class,TimelineView.VIEW_ROLE_NAME,ViewType.OBJECT),new ViewInfo(TimelineView.class,TimelineView.VIEW_ROLE_NAME,TimelineView.class.getName(),ViewType.EMBEDDED,null,null,true,ActivityComponent.class),new ViewInfo(TimelineView.class,TimelineView.VIEW_ROLE_NAME,TimelineView.class.getName(),ViewType.CENTER,null,null,true,ActivityComponent.class));
  }
  return Collections.emptyList();
}

Fixed version (ground truth):
@Override public Collection<ViewInfo> getViews(String componentTypeId){
  if (componentTypeId.equals(ActivityComponent.class.getName())) {
    return Arrays.asList(new ViewInfo(ActivityOverviewView.class,ActivityOverviewView.VIEW_ROLE_NAME,ActivityOverviewView.class.getName(),ViewType.EMBEDDED,null,null,true,ActivityComponent.class),new ViewInfo(ActivityOverviewView.class,ActivityOverviewView.VIEW_ROLE_NAME,ActivityOverviewView.class.getName(),ViewType.OBJECT,null,null,true,ActivityComponent.class),new ViewInfo(ActivityOverviewView.class,ActivityOverviewView.VIEW_ROLE_NAME,ActivityOverviewView.class.getName(),ViewType.CENTER,null,null,true,ActivityComponent.class));
  }
  return Collections.emptyList();
}
Program: 51819
Project: 51819
Buggy source:
@Override public AbstractComponent createComp(ComponentRegistry comp,AbstractComponent targetComponent){
  String displayName=name.getText().trim();
  AbstractComponent component=null;
  component=comp.newInstance(componentClass,targetComponent);
  component.setDisplayName(displayName);
  component.save();
  return component;
}

Fixed version (ground truth):
@Override public AbstractComponent createComp(ComponentRegistry comp,AbstractComponent targetComponent){
  String displayName=name.getText().trim();
  AbstractComponent component=null;
  component=comp.newInstance(componentClass,targetComponent);
  component.setDisplayName(displayName);
  ActivityComponent activityComponent=(ActivityComponent)component;
  ActivityData data=activityComponent.getData();
  Date currentTime=Calendar.getInstance().getTime();
  data.setStartDate(currentTime);
  data.setEndDate(currentTime);
  data.setPower(0);
  data.setComm(0);
  component.save();
  return component;
}
Program: 51821
Project: 51821
Buggy source:
@Override public AbstractComponent createComp(ComponentRegistry comp,AbstractComponent targetComponent){
  String displayName=name.getText().trim();
  AbstractComponent component=null;
  component=comp.newInstance(componentClass,targetComponent);
  component.setDisplayName(displayName);
  component.save();
  return component;
}

Fixed version (ground truth):
@Override public AbstractComponent createComp(ComponentRegistry comp,AbstractComponent targetComponent){
  String displayName=name.getText().trim();
  AbstractComponent component=null;
  component=comp.newInstance(componentClass,targetComponent);
  component.setDisplayName(displayName);
  DecisionComponent decisionComponent=(DecisionComponent)component;
  DecisionData data=decisionComponent.getData();
  Date currentTime=Calendar.getInstance().getTime();
  data.setStartDate(currentTime);
  data.setEndDate(currentTime);
  component.save();
  return component;
}
Program: 51822
Project: 51822
Buggy source:
private void assignDecisionLevel(DecisionWrapper dw){
  for (int group=0; group < activityMap.size(); group++) {
    List<ActivityWrapper> list=activityMap.get(group);
    for (    ActivityWrapper aw : list) {
      if (dw.parentActivity == aw.activityComponent) {
        dw.group=group;
        dw.level=aw.level - 1;
      }
    }
  }
}

Fixed version (ground truth):
private void assignDecisionLevel(DecisionWrapper dw){
  for (int group=0; group < activityMap.size(); group++) {
    List<ActivityWrapper> list=activityMap.get(group);
    for (    ActivityWrapper aw : list) {
      if (dw.parentActivity == aw.activityComponent) {
        dw.group=group;
        dw.level=aw.level - 1;
        return;
      }
    }
  }
}
Program: 51823
Project: 51823
Buggy source:
private void assignLevel(ActivityWrapper node){
  for (  ActivityWrapper child : node.children) {
    assignLevel(child);
  }
  if (node.children.isEmpty())   node.level=0;
 else {
    int maxLevel=0;
    for (    ActivityWrapper child : node.children) {
      if (child.level > maxLevel)       maxLevel=child.level;
    }
    node.level=maxLevel + 1;
    for (    ActivityWrapper child : node.children) {
      child.level=node.level - 1;
    }
  }
}

Fixed version (ground truth):
private void assignLevel(ActivityWrapper node){
  for (  ActivityWrapper child : node.children) {
    assignLevel(child);
  }
  if (node.activityComponent == null)   return;
 else   if (node.children.isEmpty())   node.level=0;
 else {
    int maxLevel=0;
    for (    ActivityWrapper child : node.children) {
      if (child.level > maxLevel)       maxLevel=child.level;
    }
    node.level=maxLevel + 1;
    for (    ActivityWrapper child : node.children) {
      child.level=node.level - 1;
    }
  }
}
Program: 51825
Project: 51825
Buggy source:
private void paintActivity(Graphics2D g2,ActivityComponent ac,int yStart){
  ActivityData data=ac.getModel().getData();
  if (globalStartTime == null || globalEndTime == null)   return;
  long timeDiff=globalEndTime.getTime() - globalStartTime.getTime();
  int xd=xEnd - xStart;
  int x1=xStart + (int)((data.getStartTime().getTime() - globalStartTime.getTime()) * xd / timeDiff);
  int x2=xStart + (int)((data.getEndTime().getTime() - globalStartTime.getTime()) * xd / timeDiff);
  int durationWidth=x2 - x1;
  Rectangle rectangle=new Rectangle(x1,yStart + 15,durationWidth,35);
  ActivityWidget widget=new ActivityWidget(ac,rectangle);
  activityWidgets.add(widget);
  int arcWidthAndHeight=TIME_UNIT_PIX / 2;
  g2.setColor(DURATION_COLOR);
  g2.fillRoundRect(rectangle.x,rectangle.y,rectangle.width,rectangle.height,arcWidthAndHeight,arcWidthAndHeight);
  g2.setStroke(SOLID_2PT_LINE_STROKE);
  g2.setColor(LINE_COLOR);
  g2.drawRoundRect(rectangle.x,rectangle.y,rectangle.width,rectangle.height,arcWidthAndHeight,arcWidthAndHeight);
  String name=getTruncatedString(g2,ac.getDisplayName(),widget);
  int charsWidth=getFontMetrics(getFont()).charsWidth(name.toCharArray(),0,name.length());
  int charHeight=getFontMetrics(getFont()).getHeight();
  g2.setColor(TEXT_COLOR);
  g2.drawString(name,x1 + durationWidth / 2 - charsWidth / 2,yStart + 15 + 14+ charHeight / 2);
}

Fixed version (ground truth):
private void paintActivity(Graphics2D g2,ActivityComponent ac,int yStart){
  ActivityData data=ac.getModel().getData();
  if (globalStartTime == null || globalEndTime == null)   return;
  long timeDiff=globalEndTime.getTime() - globalStartTime.getTime();
  if (timeDiff == 0)   return;
  int xd=xEnd - xStart;
  int x1=xStart + (int)((data.getStartTime().getTime() - globalStartTime.getTime()) * xd / timeDiff);
  int x2=xStart + (int)((data.getEndTime().getTime() - globalStartTime.getTime()) * xd / timeDiff);
  int durationWidth=x2 - x1;
  Rectangle rectangle=new Rectangle(x1,yStart + 15,durationWidth,35);
  ActivityWidget widget=new ActivityWidget(ac,rectangle);
  activityWidgets.add(widget);
  int arcWidthAndHeight=TIME_UNIT_PIX / 2;
  g2.setColor(DURATION_COLOR);
  g2.fillRoundRect(rectangle.x,rectangle.y,rectangle.width,rectangle.height,arcWidthAndHeight,arcWidthAndHeight);
  g2.setStroke(SOLID_2PT_LINE_STROKE);
  g2.setColor(LINE_COLOR);
  g2.drawRoundRect(rectangle.x,rectangle.y,rectangle.width,rectangle.height,arcWidthAndHeight,arcWidthAndHeight);
  String title=getTruncatedString(g2,ac.getDisplayName() + "String_Node_Str" + getFormattedDurationText(data.getStartTime(),data.getEndTime()),widget);
  int charsWidth=getFontMetrics(getFont()).charsWidth(title.toCharArray(),0,title.length());
  int charHeight=getFontMetrics(getFont()).getHeight();
  g2.setColor(TEXT_COLOR);
  g2.drawString(title,x1 + durationWidth / 2 - charsWidth / 2,yStart + 15 + 14+ charHeight / 2);
}
Program: 51827
Project: 51827
Buggy source:
public LogEntryComponent<T> addEntry(T entry,List<AbstractComponent> components){
  PlatformAccess.getPlatform().getPersistenceProvider().startRelatedOperations();
  LogEntryComponent<T> child;
  child=PlatformAccess.getPlatform().getComponentRegistry().newInstance(getEntryComponentClass(),this);
  child.initialize(entry,components);
  child.setDisplayName(new UNIXTimeInstant(child.getEntry().getEntryTime()).toString());
  child.save();
  PlatformAccess.getPlatform().getPersistenceProvider().completeRelatedOperations(true);
  return child;
}

Fixed version (ground truth):
public LogEntryComponent<T> addEntry(T entry,List<AbstractComponent> components){
  LogEntryComponent<T> child;
  child=PlatformAccess.getPlatform().getComponentRegistry().newInstance(getEntryComponentClass(),this);
  PlatformAccess.getPlatform().getPersistenceProvider().startRelatedOperations();
  child.initialize(entry,components);
  child.setDisplayName(new UNIXTimeInstant(child.getEntry().getEntryTime()).toString());
  child.save();
  PlatformAccess.getPlatform().getPersistenceProvider().completeRelatedOperations(true);
  return child;
}
Program: 51829
Project: 51829
Buggy source:
private JComponent buildEntryPanel(LogEntry<? extends String> entry,JComponent panel,GridBagConstraints gbc){
  gbc.gridx=0;
  gbc.weightx=0.0;
  panel.add(new EditableTimeLabel(entry),gbc);
  gbc.gridx=1;
  gbc.weightx=1.0;
  JLabel contents=new JLabel("String_Node_Str" + (entry == logEntry ? "String_Node_Str" : "String_Node_Str") + entry.getEntry().replaceAll("String_Node_Str","String_Node_Str")+ (entry == logEntry ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
  panel.add(contents,gbc);
  if (entry == logEntry)   highlightedComponents.add(contents);
  JPanel referencePanel=new JPanel();
  referencePanel.setLayout(new BoxLayout(referencePanel,BoxLayout.PAGE_AXIS));
  referencePanel.setOpaque(false);
  ComponentRegistry registry=ComponentRegistryAccess.getComponentRegistry();
  for (  String reference : entry.getReferencedIDs()) {
    AbstractComponent comp=registry.getComponent(reference);
    if (comp != null) {
      referencePanel.add(new NotebookPanel(comp,entry.getEntryTime()));
    }
  }
  gbc.gridx=2;
  gbc.weightx=0.0;
  panel.add(referencePanel,gbc);
  return panel;
}

Fixed version (ground truth):
private JComponent buildEntryPanel(LogEntry<? extends String> entry,JComponent panel,GridBagConstraints gbc){
  gbc.gridx=0;
  gbc.weightx=0.0;
  panel.add(new EditableTimeLabel(entry),gbc);
  gbc.gridx=1;
  gbc.weightx=1.0;
  JLabel contents=new JLabel("String_Node_Str" + (entry == logEntry ? "String_Node_Str" : "String_Node_Str") + entry.getEntry().replaceAll("String_Node_Str","String_Node_Str")+ (entry == logEntry ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
  panel.add(contents,gbc);
  if (entry != null && logEntry != null && entry.getEntryTime() == logEntry.getEntryTime()) {
    highlightedComponents.add(contents);
  }
  JPanel referencePanel=new JPanel();
  referencePanel.setLayout(new BoxLayout(referencePanel,BoxLayout.PAGE_AXIS));
  referencePanel.setOpaque(false);
  ComponentRegistry registry=ComponentRegistryAccess.getComponentRegistry();
  for (  String reference : entry.getReferencedIDs()) {
    AbstractComponent comp=registry.getComponent(reference);
    if (comp != null) {
      referencePanel.add(new NotebookPanel(comp,entry.getEntryTime()));
    }
  }
  gbc.gridx=2;
  gbc.weightx=0.0;
  panel.add(referencePanel,gbc);
  return panel;
}
Program: 51831
Project: 51831
Buggy source:
@Override public void onRowSelection(RowSelectionEvent event){
  try {
    if (getOnselect() != null && getOnselect().trim().length() > 0) {
      getXulDomContainer().invoke(getOnselect(),new Object[]{});
    }
    Integer[] selectedRows=table.getSelectedRows().toArray(new Integer[table.getSelectedRows().size()]);
    int[] rows=new int[selectedRows.length];
    for (int i=0; i < selectedRows.length; i++) {
      rows[i]=selectedRows[i];
    }
    GwtTree.this.setSelectedRows(rows);
    GwtTree.this.colCollection=getColumns().getChildNodes();
    if (GwtTree.this.isShowalleditcontrols() == false) {
      if (curSelectedRow > -1) {
        Object[] curSelectedRowOriginal=new Object[getColumns().getColumnCount()];
        for (int j=0; j < getColumns().getColumnCount(); j++) {
          curSelectedRowOriginal[j]=getColumnEditor(j,curSelectedRow);
        }
        table.replaceRow(curSelectedRow,curSelectedRowOriginal);
      }
      curSelectedRow=rows[0];
      Object[] newRow=new Object[getColumns().getColumnCount()];
      for (int j=0; j < getColumns().getColumnCount(); j++) {
        newRow[j]=getColumnEditor(j,rows[0]);
      }
      table.replaceRow(rows[0],newRow);
    }
  }
 catch (  XulException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void onRowSelection(RowSelectionEvent event){
  try {
    Integer[] selectedRows=table.getSelectedRows().toArray(new Integer[table.getSelectedRows().size()]);
    if (getOnselect() != null && getOnselect().trim().length() > 0) {
      getXulDomContainer().invoke(getOnselect(),new Object[]{selectedRows.length > 0 ? selectedRows[0] : null});
    }
    int[] rows=new int[selectedRows.length];
    for (int i=0; i < selectedRows.length; i++) {
      rows[i]=selectedRows[i];
    }
    GwtTree.this.setSelectedRows(rows);
    GwtTree.this.colCollection=getColumns().getChildNodes();
    if (GwtTree.this.isShowalleditcontrols() == false) {
      if (curSelectedRow > -1) {
        Object[] curSelectedRowOriginal=new Object[getColumns().getColumnCount()];
        for (int j=0; j < getColumns().getColumnCount(); j++) {
          curSelectedRowOriginal[j]=getColumnEditor(j,curSelectedRow);
        }
        table.replaceRow(curSelectedRow,curSelectedRowOriginal);
      }
      curSelectedRow=rows[0];
      Object[] newRow=new Object[getColumns().getColumnCount()];
      for (int j=0; j < getColumns().getColumnCount(); j++) {
        newRow[j]=getColumnEditor(j,rows[0]);
      }
      table.replaceRow(rows[0],newRow);
    }
  }
 catch (  XulException e) {
    e.printStackTrace();
  }
}
Program: 51832
Project: 51832
Buggy source:
public JfaceMenuitem(Element self,XulComponent parent,XulDomContainer domContainer,String tagName,int pos,Action action){
  super("String_Node_Str");
  this.parent=parent;
  this.domContainer=domContainer;
  if (parent.getManagedObject() != null && parent.getManagedObject() instanceof IMenuManager) {
    createItem(self,parent,pos,true);
  }
}

Fixed version (ground truth):
private JfaceMenuitem(Element self,XulComponent parent,XulDomContainer domContainer,String tagName,int pos,Action action,boolean shouldCreate,boolean autoAdd){
  super("String_Node_Str");
  this.parent=parent;
  this.domContainer=domContainer;
  if (shouldCreate) {
    createItem(self,parent,pos,autoAdd);
  }
}
Program: 51833
Project: 51833
Buggy source:
@Override public void addChildAt(Element c,int pos){
  if (pos != -1) {
    super.addChildAt(c,pos);
  }
 else {
    super.addChild(c);
  }
  IContributionItem items[]=menu.getItems();
  for (  IContributionItem item : items) {
    if (item.getId() != null && item.getId().equals(c.getAttributeValue("String_Node_Str")) && !item.isVisible()) {
      item.setVisible(true);
      return;
    }
  }
  IAction action=null;
  IContributionItem contribs=null;
  if (c instanceof JfaceMenuitem) {
    JfaceMenuitem item=(JfaceMenuitem)c;
    Object man=item.getManagedObject();
    if (man instanceof IAction) {
      action=(IAction)item.getManagedObject();
    }
 else     if (man == null) {
    }
 else {
    }
  }
 else   if (c instanceof JfaceMenu) {
    JfaceMenu item=(JfaceMenu)c;
    contribs=item.getJfaceMenu();
  }
  if (action == null && contribs == null) {
    return;
  }
  String id=null;
  if (pos == 0 && pos < menu.getItems().length) {
    id=menu.getItems()[1].getId();
  }
 else   if (pos > 0 && pos < menu.getItems().length) {
    id=menu.getItems()[pos].getId();
  }
  if (id != null) {
    if (action != null) {
      menu.insertBefore(id,action);
    }
 else {
      menu.insertBefore(id,contribs);
    }
  }
 else {
    if (action != null) {
      menu.add(action);
    }
 else {
      menu.add(contribs);
    }
  }
}

Fixed version (ground truth):
@Override public void addChildAt(Element c,int pos){
  if (pos != -1) {
    super.addChildAt(c,pos);
  }
 else {
    super.addChild(c);
  }
  IContributionItem items[]=menu.getItems();
  for (  IContributionItem item : items) {
    if (item.getId() != null && item.getId().equals(c.getAttributeValue("String_Node_Str")) && !item.isVisible()) {
      item.setVisible(true);
      return;
    }
  }
  IAction action=null;
  IContributionItem contribs=null;
  if (c instanceof JfaceMenuitem) {
    JfaceMenuitem item=(JfaceMenuitem)c;
    Object man=item.getManagedObject();
    if (man instanceof IAction) {
      action=(IAction)item.getManagedObject();
    }
 else     if (man instanceof IContributionItem) {
      contribs=(IContributionItem)man;
    }
 else     if (man == null) {
    }
 else {
    }
  }
 else   if (c instanceof JfaceMenu) {
    JfaceMenu item=(JfaceMenu)c;
    contribs=item.getJfaceMenu();
  }
  if (action == null && contribs == null) {
    return;
  }
  String id=null;
  if (pos == 0 && pos < menu.getItems().length) {
    id=menu.getItems()[1].getId();
  }
 else   if (pos > 0 && pos < menu.getItems().length) {
    id=menu.getItems()[pos].getId();
  }
  if (id != null) {
    if (action != null) {
      menu.insertBefore(id,action);
    }
 else {
      menu.insertBefore(id,contribs);
    }
  }
 else {
    if (action != null) {
      menu.add(action);
    }
 else {
      menu.add(contribs);
    }
  }
}
Program: 51834
Project: 51834
Buggy source:
public JComponent getJComponent(){
  return (JComponent)getManagedObject();
}

Fixed version (ground truth):
public JComponent getJComponent(){
  return getManagedObject() instanceof JComponent ? (JComponent)getManagedObject() : null;
}
Program: 51835
Project: 51835
Buggy source:
public SwingDialog(Element self,XulComponent parent,XulDomContainer domContainer,String tagName){
  super("String_Node_Str");
  ID=self.getAttributeValue("String_Node_Str");
  this.parent=parent;
  this.domContainer=domContainer;
  this.orientation=Orient.VERTICAL;
  container=new JPanel(new GridBagLayout());
  setManagedObject(container);
  resetContainer();
}

Fixed version (ground truth):
public SwingDialog(Element self,XulComponent parent,XulDomContainer domContainer,String tagName){
  super("String_Node_Str");
  ID=self.getAttributeValue("String_Node_Str");
  this.parent=parent;
  this.domContainer=domContainer;
  this.orientation=Orient.VERTICAL;
  container=new JPanel(new GridBagLayout());
  setManagedObject("String_Node_Str");
  resetContainer();
}
Program: 51840
Project: 51840
Buggy source:
@Bindable public void setSelectedFile(String name){
  if (name == null || name.length() <= 0) {
    hiddenPanel.remove(upload);
    upload=new FileUpload();
    upload.setName("String_Node_Str");
    upload.setVisible(true);
    upload.setHeight(getHeight() + "String_Node_Str");
    upload.setWidth(getWidth() + "String_Node_Str");
    upload.addChangeHandler(new ChangeHandler(){
      public void onChange(      ChangeEvent event){
        setSelectedFile(upload.getFilename());
      }
    }
);
    hiddenPanel.add(upload,"String_Node_Str");
  }
  uploadTextBox.setValue(name);
  firePropertyChange("String_Node_Str",null,name);
}

Fixed version (ground truth):
@Bindable public void setSelectedFile(String name){
  if (name == null || name.length() <= 0) {
    hiddenPanel.remove(upload);
    upload=new FileUpload();
    upload.setStylePrimaryName("String_Node_Str");
    upload.setName("String_Node_Str");
    upload.setVisible(true);
    upload.setHeight(getHeight() + "String_Node_Str");
    upload.setWidth(getWidth() + "String_Node_Str");
    upload.addChangeHandler(new ChangeHandler(){
      public void onChange(      ChangeEvent event){
        setSelectedFile(upload.getFilename());
      }
    }
);
    hiddenPanel.add(upload,"String_Node_Str");
  }
  uploadTextBox.setValue(name);
  firePropertyChange("String_Node_Str",null,name);
}
Program: 51841
Project: 51841
Buggy source:
/** 
 * called once the drag is finished
 * @param nativeEvent swt event
 * @param effect drop effect, used to detemine if removing is necessary
 */
protected void onSwtDragFinished(DropEffectType effect){
  throw new UnsupportedOperationException("String_Node_Str" + getClass());
}

Fixed version (ground truth):
/** 
 * called once the drag is finished
 * @param effect drop effect, used to detemine if removing is necessary
 * @param event
 */
protected void onSwtDragFinished(DropEffectType effect,DropEvent event){
  throw new UnsupportedOperationException("String_Node_Str" + getClass());
}
Program: 51842
Project: 51842
Buggy source:
public void drop(DropTargetEvent nativeEvent){
  DropEvent event=new DropEvent();
  DataTransfer dataTransfer=new DataTransfer();
  XulSwtDndType types[]=(XulSwtDndType[])nativeEvent.data;
  SwtElement xulDndSource=null;
  try {
    if (types != null) {
      List<Object> objs=new ArrayList<Object>();
      for (int i=0; i < types.length; i++) {
        if (i == 0) {
          xulDndSource=types[i].getXulSource();
        }
        objs.add(types[i].getValue());
      }
      dataTransfer.setData(objs);
      dataTransfer.setDropEffect(lookupXulEffect(nativeEvent.detail));
    }
 else {
      nativeEvent.detail=DND.DROP_NONE;
      return;
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  event.setDataTransfer(dataTransfer);
  event.setAccepted(true);
  event.setNativeEvent(nativeEvent);
  resolveDndParentAndIndex(event);
  final String method=getOndrop();
  if (method != null) {
    try {
      Document doc=getDocument();
      XulRoot window=(XulRoot)doc.getRootElement();
      final XulDomContainer con=window.getXulDomContainer();
      con.invoke(method,new Object[]{event});
    }
 catch (    XulException e) {
      logger.error("String_Node_Str" + method,e);
    }
  }
  if (!event.isAccepted()) {
    nativeEvent.detail=DND.DROP_NONE;
    return;
  }
  if (xulDndSource == null) {
    throw new RuntimeException("String_Node_Str");
  }
  xulDndSource.onSwtDragFinished(lookupXulEffect(nativeEvent.detail));
  onSwtDragDropAccepted(event);
}

Fixed version (ground truth):
public void drop(DropTargetEvent nativeEvent){
  DropEvent event=new DropEvent();
  DataTransfer dataTransfer=new DataTransfer();
  XulSwtDndType types[]=(XulSwtDndType[])nativeEvent.data;
  SwtElement xulDndSource=null;
  try {
    if (types != null) {
      List<Object> objs=new ArrayList<Object>();
      for (int i=0; i < types.length; i++) {
        if (i == 0) {
          xulDndSource=types[i].getXulSource();
        }
        objs.add(types[i].getValue());
      }
      dataTransfer.setData(objs);
      dataTransfer.setDropEffect(lookupXulEffect(nativeEvent.detail));
    }
 else {
      nativeEvent.detail=DND.DROP_NONE;
      return;
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  event.setDataTransfer(dataTransfer);
  event.setAccepted(true);
  event.setNativeEvent(nativeEvent);
  resolveDndParentAndIndex(event);
  final String method=getOndrop();
  if (method != null) {
    try {
      Document doc=getDocument();
      XulRoot window=(XulRoot)doc.getRootElement();
      final XulDomContainer con=window.getXulDomContainer();
      con.invoke(method,new Object[]{event});
    }
 catch (    XulException e) {
      logger.error("String_Node_Str" + method,e);
    }
  }
  if (!event.isAccepted()) {
    nativeEvent.detail=DND.DROP_NONE;
    return;
  }
  if (xulDndSource == null) {
    throw new RuntimeException("String_Node_Str");
  }
  xulDndSource.onSwtDragFinished(lookupXulEffect(nativeEvent.detail),event);
  onSwtDragDropAccepted(event);
}
Program: 51844
Project: 51844
Buggy source:
@Override protected void onSwtDragFinished(DropEffectType effect){
  if (effect == DropEffectType.MOVE) {
    if (elements != null) {
      throw new UnsupportedOperationException("String_Node_Str");
    }
 else {
      int[] indices=listBox.getSelectionIndices();
      for (int i=indices.length - 1; i >= 0; i--) {
        removeChild(getChildNodes().get(indices[i]));
      }
      listBox.remove(indices);
    }
  }
}

Fixed version (ground truth):
@Override protected void onSwtDragFinished(DropEffectType effect,DropEvent event){
  if (effect == DropEffectType.MOVE) {
    if (elements != null) {
      throw new UnsupportedOperationException("String_Node_Str");
    }
 else {
      int[] indices=listBox.getSelectionIndices();
      for (int i=indices.length - 1; i >= 0; i--) {
        removeChild(getChildNodes().get(indices[i]));
      }
      listBox.remove(indices);
    }
  }
}
Program: 51845
Project: 51845
Buggy source:
private void removeItemFromElements(Object item){
  String method=toGetter(((XulTreeCol)this.getColumns().getChildNodes().get(0)).getChildrenbinding());
  removeItem(elements,method,item);
}

Fixed version (ground truth):
private void removeItemFromElements(Object item,DropEvent event){
  String method=toGetter(((XulTreeCol)this.getColumns().getChildNodes().get(0)).getChildrenbinding());
  removeItem(elements,method,item,event);
}
Program: 51846
Project: 51846
Buggy source:
@Override protected void onSwtDragFinished(DropEffectType effect){
  if (effect == DropEffectType.MOVE) {
    if (elements != null) {
      for (      Object item : cachedDndItems) {
        removeItemFromElements(item);
      }
      cachedDndItems=null;
      setElements(elements);
    }
 else {
      if (isHierarchical()) {
        tree.remove(tree.getSelection());
      }
 else {
        table.remove(table.getSelection());
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void onSwtDragFinished(DropEffectType effect,DropEvent event){
  if (effect == DropEffectType.MOVE) {
    if (elements != null) {
      for (      Object item : cachedDndItems) {
        removeItemFromElements(item,event);
      }
      cachedDndItems=null;
      setElements(elements);
    }
 else {
      if (isHierarchical()) {
        tree.remove(tree.getSelection());
      }
 else {
        table.remove(table.getSelection());
      }
    }
  }
}
Program: 51847
Project: 51847
Buggy source:
private void removeItem(Object parent,String childrenMethodProperty,Object toRemove){
  Collection children=getChildCollection(parent,childrenMethodProperty);
  if (children == null) {
    return;
  }
  Iterator iter=children.iterator();
  while (iter.hasNext()) {
    Object next=iter.next();
    if (next == toRemove) {
      children.remove(toRemove);
      return;
    }
    removeItem(next,childrenMethodProperty,toRemove);
  }
}

Fixed version (ground truth):
private void removeItem(Object parent,String childrenMethodProperty,Object toRemove,DropEvent event){
  Collection children=getChildCollection(parent,childrenMethodProperty);
  if (children == null) {
    return;
  }
  Iterator iter=children.iterator();
  int pos=0;
  while (iter.hasNext()) {
    Object next=iter.next();
    if (next == toRemove) {
      if (event.getDropParent() == children && event.getDropIndex() > pos) {
        event.setDropIndex(event.getDropIndex() - 1);
      }
      children.remove(toRemove);
      return;
    }
    removeItem(next,childrenMethodProperty,toRemove,event);
    pos++;
  }
}
Program: 51849
Project: 51849
Buggy source:
private void populateTable(){
  int rowCount=getRootChildren().getItemCount();
  colCollection=getColumns().getChildNodes();
  int colCount=colCollection.size();
  currentData=new Object[rowCount][colCount];
  for (int i=0; i < rowCount; i++) {
    for (int j=0; j < colCount; j++) {
      currentData[i][j]=getColumnEditor(j,i);
    }
  }
  table.populateTable(currentData);
  int totalFlex=0;
  boolean allFlexing=true;
  for (int i=0; i < colCount; i++) {
    XulTreeCol col=(XulTreeCol)colCollection.get(i);
    String sortDirection=col.getSortDirection();
    if (col.isSortActive()) {
      isSortable=true;
      table.setSortingEnabled(true);
      table.sortColumn(i,sortDirection != null && sortDirection.equals("String_Node_Str") ? true : false);
    }
    int fx=colCollection.get(i).getFlex();
    totalFlex+=fx;
    if (fx == 0) {
      allFlexing=false;
    }
  }
  if (isSortable) {
    for (int i=0; i < colCount; i++) {
      table.setColumnSortable(i,true);
    }
  }
  if (totalFlex > 0) {
    table.fillWidth();
  }
 else {
    table.noFill();
  }
  if (allFlexing) {
    table.suppressHorizontalScrolling();
  }
  colCollection=new ArrayList<XulComponent>();
  if (this.selectedRows != null && this.selectedRows.length > 0) {
    for (int i=0; i < this.selectedRows.length; i++) {
      int idx=this.selectedRows[i];
      if (idx > -1 && idx < currentData.length) {
        table.selectRow(idx);
      }
    }
  }
}

Fixed version (ground truth):
private void populateTable(){
  int rowCount=getRootChildren().getItemCount();
  colCollection=getColumns().getChildNodes();
  int colCount=colCollection.size();
  currentData=new Object[rowCount][colCount];
  for (int i=0; i < rowCount; i++) {
    for (int j=0; j < colCount; j++) {
      currentData[i][j]=getColumnEditor(j,i);
    }
  }
  table.populateTable(currentData,elements);
  int totalFlex=0;
  boolean allFlexing=true;
  for (int i=0; i < colCount; i++) {
    XulTreeCol col=(XulTreeCol)colCollection.get(i);
    String sortDirection=col.getSortDirection();
    if (col.isSortActive()) {
      isSortable=true;
      table.setSortingEnabled(true);
      table.sortColumn(i,sortDirection != null && sortDirection.equals("String_Node_Str") ? true : false);
    }
    int fx=colCollection.get(i).getFlex();
    totalFlex+=fx;
    if (fx == 0) {
      allFlexing=false;
    }
  }
  if (isSortable) {
    for (int i=0; i < colCount; i++) {
      table.setColumnSortable(i,true);
    }
  }
  if (totalFlex > 0) {
    table.fillWidth();
  }
 else {
    table.noFill();
  }
  if (allFlexing) {
    table.suppressHorizontalScrolling();
  }
  colCollection=new ArrayList<XulComponent>();
  if (this.selectedRows != null && this.selectedRows.length > 0) {
    for (int i=0; i < this.selectedRows.length; i++) {
      int idx=this.selectedRows[i];
      if (idx > -1 && idx < currentData.length) {
        table.selectRow(idx);
      }
    }
  }
}
Program: 51850
Project: 51850
Buggy source:
public void init(com.google.gwt.xml.client.Element srcEle,XulDomContainer container){
  super.init(srcEle,container);
  setOnselect(srcEle.getAttribute("String_Node_Str"));
  setOnedit(srcEle.getAttribute("String_Node_Str"));
  setSeltype(srcEle.getAttribute("String_Node_Str"));
  setOndrop(srcEle.getAttribute("String_Node_Str"));
  setOndrag(srcEle.getAttribute("String_Node_Str"));
  setDrageffect(srcEle.getAttribute("String_Node_Str"));
  setDropvetoer(srcEle.getAttribute("String_Node_Str"));
  if (StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str")) == false) {
    this.setShowalleditcontrols(srcEle.getAttribute("String_Node_Str").equals("String_Node_Str"));
  }
  this.setEditable("String_Node_Str".equals(srcEle.getAttribute("String_Node_Str")));
  this.domContainer=container;
}

Fixed version (ground truth):
public void init(com.google.gwt.xml.client.Element srcEle,XulDomContainer container){
  super.init(srcEle,container);
  setOnselect(srcEle.getAttribute("String_Node_Str"));
  setOnedit(srcEle.getAttribute("String_Node_Str"));
  setSeltype(srcEle.getAttribute("String_Node_Str"));
  if (StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str")) == false) {
    setOndrop(srcEle.getAttribute("String_Node_Str"));
  }
  if (StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str")) == false) {
    setOndrag(srcEle.getAttribute("String_Node_Str"));
  }
  if (StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str")) == false) {
    setDrageffect(srcEle.getAttribute("String_Node_Str"));
  }
  setDropvetoer(srcEle.getAttribute("String_Node_Str"));
  if (StringUtils.isEmpty(srcEle.getAttribute("String_Node_Str")) == false) {
    this.setShowalleditcontrols(srcEle.getAttribute("String_Node_Str").equals("String_Node_Str"));
  }
  this.setEditable("String_Node_Str".equals(srcEle.getAttribute("String_Node_Str")));
  this.domContainer=container;
}
Program: 51851
Project: 51851
Buggy source:
@Bindable public void setDisabled(boolean dis){
  this.disabled=dis;
  if (button != null) {
    if (dis) {
      button.addStyleDependentName("String_Node_Str");
    }
 else {
      button.addStyleDependentName("String_Node_Str");
    }
  }
 else   if (imageButton != null) {
    imageButton.setEnabled(!dis);
  }
 else   if (customButton != null) {
    customButton.setEnabled(!dis);
  }
}

Fixed version (ground truth):
@Bindable public void setDisabled(boolean dis){
  this.disabled=dis;
  if (button != null) {
    if (dis) {
      button.addStyleDependentName("String_Node_Str");
    }
 else {
      button.removeStyleDependentName("String_Node_Str");
    }
  }
 else   if (imageButton != null) {
    imageButton.setEnabled(!dis);
  }
 else   if (customButton != null) {
    customButton.setEnabled(!dis);
  }
}
Program: 51852
Project: 51852
Buggy source:
public void onClick(ClickEvent event){
  try {
    setChecked(radioButton.getValue());
    if (isCustomValue() && isChecked()) {
      customValueTextBox.setEnabled(true);
    }
    if (command != null && command.length() > 0) {
      GwtRadio.this.getXulDomContainer().invoke(command,new Object[]{});
    }
  }
 catch (  XulException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void onClick(ClickEvent event){
  try {
    fireChangedEvents(radioButton.getValue());
    if (isCustomValue() && isChecked()) {
      customValueTextBox.setEnabled(true);
    }
    if (command != null && command.length() > 0) {
      GwtRadio.this.getXulDomContainer().invoke(command,new Object[]{});
    }
  }
 catch (  XulException e) {
    e.printStackTrace();
  }
}
Program: 51853
Project: 51853
Buggy source:
@Bindable public void setChecked(boolean checked){
  boolean previousVal=this.checked;
  if (checked != radioButton.getValue()) {
    radioButton.setValue(checked);
  }
  this.checked=checked;
  this.firePropertyChange("String_Node_Str",null,checked);
}

Fixed version (ground truth):
@Bindable public void setChecked(boolean checked){
  System.out.println("String_Node_Str" + checked + "String_Node_Str"+ ((checked != this.checked) ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ ((checked != radioButton.getValue()) ? "String_Node_Str" : "String_Node_Str"));
  if (checked != radioButton.getValue()) {
    radioButton.setValue(checked,false);
  }
  fireChangedEvents(checked);
}
Program: 51854
Project: 51854
Buggy source:
public GwtRadio(){
  super(ELEMENT_NAME);
  radioContainer=new HorizontalPanel();
  radioContainer.setSpacing(0);
  customValueTextBox=new TextBox();
  customValueTextBox.setEnabled(false);
  String id="String_Node_Str";
  if (currentGroup != null) {
    id=currentGroup.getId();
  }
  radioButton=new RadioButton(id);
  radioContainer.add(radioButton);
  setManagedObject(radioContainer);
  radioContainer.setStylePrimaryName("String_Node_Str");
  radioButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      try {
        setChecked(radioButton.getValue());
        if (isCustomValue() && isChecked()) {
          customValueTextBox.setEnabled(true);
        }
        if (command != null && command.length() > 0) {
          GwtRadio.this.getXulDomContainer().invoke(command,new Object[]{});
        }
      }
 catch (      XulException e) {
        e.printStackTrace();
      }
    }
  }
);
}

Fixed version (ground truth):
public GwtRadio(){
  super(ELEMENT_NAME);
  radioContainer=new HorizontalPanel();
  radioContainer.setSpacing(0);
  customValueTextBox=new TextBox();
  customValueTextBox.setEnabled(false);
  String id="String_Node_Str";
  if (currentGroup != null) {
    id=currentGroup.getId();
  }
  radioButton=new RadioButton(id);
  radioContainer.add(radioButton);
  setManagedObject(radioContainer);
  radioContainer.setStylePrimaryName("String_Node_Str");
  radioButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      try {
        fireChangedEvents(radioButton.getValue());
        if (isCustomValue() && isChecked()) {
          customValueTextBox.setEnabled(true);
        }
        if (command != null && command.length() > 0) {
          GwtRadio.this.getXulDomContainer().invoke(command,new Object[]{});
        }
      }
 catch (      XulException e) {
        e.printStackTrace();
      }
    }
  }
);
}