nus-yam/ex-repair huggingface dataset:
Program: 185194
Project: 185194
Buggy source:
public PlotSettingsComboBox(T... choices){
  List<ItemWrapper<T>> wrappedChoices=new ArrayList<ItemWrapper<T>>();
  for (  T item : choices) {
    ItemWrapper<T> wrapper=new ItemWrapper<T>(item);
    wrappedChoices.add(wrapper);
    items.put(item,wrapper);
  }
  comboBox=new JComboBox(choices);
  add(comboBox);
}

Fixed version (ground truth):
public PlotSettingsComboBox(T... choices){
  List<ItemWrapper<T>> wrappedChoices=new ArrayList<ItemWrapper<T>>();
  for (  T item : choices) {
    ItemWrapper<T> wrapper=new ItemWrapper<T>(item);
    wrappedChoices.add(wrapper);
    items.put(item,wrapper);
  }
  comboBox=new JComboBox(wrappedChoices.toArray());
  if (choices.length > 0)   setSelection(choices[0]);
  add(comboBox);
}
Program: 185195
Project: 185195
Buggy source:
@Override public boolean isDirty(){
  if (selection == null)   return false;
  return !selection.isSelected();
}

Fixed version (ground truth):
@Override public boolean isDirty(){
  if (selection == null)   return false;
  return !buttonGroup.isSelected(selection.getModel());
}
Program: 185196
Project: 185196
Buggy source:
public PlotSettingsRadioButtonGroup(T... options){
  setLayout(new GridBagLayout());
  GridBagConstraints gbc=new GridBagConstraints();
  gbc.anchor=GridBagConstraints.WEST;
  gbc.gridx=0;
  gbc.gridy=0;
  for (  T option : options) {
    JRadioButton button=new JRadioButton(option.toString());
    button.addActionListener(this);
    buttonGroup.add(button);
    add(button,gbc);
    gbc.gridy++;
    buttons.put(option,button);
  }
}

Fixed version (ground truth):
public PlotSettingsRadioButtonGroup(T... options){
  setLayout(new GridBagLayout());
  GridBagConstraints gbc=new GridBagConstraints();
  gbc.anchor=GridBagConstraints.WEST;
  gbc.gridx=0;
  gbc.gridy=0;
  for (  T option : options) {
    JRadioButton button=new JRadioButton(option.toString());
    buttonGroup.add(button);
    button.addActionListener(this);
    add(button,gbc);
    gbc.gridy++;
    buttons.put(option,button);
  }
  if (options.length > 0) {
    setSelection(options[0]);
  }
}
Program: 185197
Project: 185197
Buggy source:
@Override public void focusLost(FocusEvent arg0){
}

Fixed version (ground truth):
@Override public void focusLost(FocusEvent e){
  if (e.isTemporary())   return;
  updateNonTimeAxisControls();
}
Program: 185198
Project: 185198
Buggy source:
@Override public void focusGained(FocusEvent arg0){
  touched();
}

Fixed version (ground truth):
@Override public void focusGained(FocusEvent e){
  if (e.isTemporary())   return;
  companionButton.setSelected(true);
  updateNonTimeAxisControls();
}
Program: 185200
Project: 185200
Buggy source:
@Override public void mouseClicked(MouseEvent arg0){
  touched();
}

Fixed version (ground truth):
@Override public void mouseClicked(MouseEvent e){
  companionButton.setSelected(true);
  companionButton.requestFocusInWindow();
}
Program: 185201
Project: 185201
Buggy source:
public void setFrom(AxisGroup group,boolean inverted){
  clear();
  int min=inverted ? 1 : 0;
  int max=inverted ? 0 : 1;
  minMaxPanel[min].add(group.getMinControls());
  minMaxPanel[max].add(group.getMaxControls());
  minMaxLabel[min].setText(group.getMinText());
  minMaxLabel[max].setText(group.getMaxText());
  spanPanel.add(group.getSpanControls());
  axisTitle.setText("String_Node_Str" + group.getTitle() + "String_Node_Str");
  revalidate();
}

Fixed version (ground truth):
public void setFrom(AxisGroup group,boolean inverted){
  clear();
  int min=inverted ? 1 : 0;
  int max=inverted ? 0 : 1;
  minMaxPanel[min].add(group.getMinControls());
  minMaxPanel[max].add(group.getMaxControls());
  minMaxLabel[min].setText(group.getMinText());
  minMaxLabel[max].setText(group.getMaxText());
  spanPanel.add(group.getSpanControls());
  axisTitle.setText("String_Node_Str" + group.getTitle() + "String_Node_Str");
  layout=new SpringLayout();
  setLayout(layout);
  initialLayout();
  revalidate();
}
Program: 185202
Project: 185202
Buggy source:
public AxisPanel(){
  for (  JLabel l : minMaxLabel)   l.setFont(l.getFont().deriveFont(Font.BOLD));
  setLayout(new GridBagLayout());
  initialLayout();
}

Fixed version (ground truth):
public AxisPanel(){
  for (  JLabel l : minMaxLabel)   l.setFont(l.getFont().deriveFont(Font.BOLD));
  setLayout(layout);
  add(minMaxPanel[0]);
  add(minMaxPanel[1]);
  add(minMaxLabel[0]);
  add(minMaxLabel[1]);
  add(spanPanel);
  add(axisTitle);
}
Program: 185203
Project: 185203
Buggy source:
public double getValue(){
  return 0;
}

Fixed version (ground truth):
public Double getValue(){
  String data=getText();
  if (data == null) {
    return null;
  }
  if (data.length() < 3) {
    logger.error("String_Node_Str" + data + "String_Node_Str");
    return null;
  }
  Double result=null;
  try {
    result=Double.parseDouble(data.substring(1,data.length() - 1));
  }
 catch (  NumberFormatException e) {
    logger.error("String_Node_Str" + data.substring(1,data.length() - 1) + "String_Node_Str");
  }
  return result;
}
Program: 185205
Project: 185205
Buggy source:
PlotDataCursor(PlotterPlot plot){
  parentPlot=plot;
  dateFormat=TimeFormatUtils.makeDataFormat(parentPlot.getTimeFormatSetting());
  if (plot.getTimeFormatSetting() != null) {
    timeSystemFormattedLabel.setTimeSystemAxisLabelName(parentPlot.getTimeSystemSetting());
  }
  setupTimeSystemLabel();
  setupXYDisplay();
  setupMarqueeZoom();
  setupSlopeLineDisplay();
  pin=plot.getPlotAbstraction().createPin();
}

Fixed version (ground truth):
PlotDataCursor(PlotterPlot plot){
  parentPlot=plot;
  dateFormat=TimeFormatUtils.makeDataFormat(parentPlot.getTimeFormatSetting());
  if (plot.getTimeSystemSetting() != null) {
    timeSystemFormattedLabel.setTimeSystemAxisLabelName(parentPlot.getTimeSystemSetting());
  }
  setupTimeSystemLabel();
  setupXYDisplay();
  setupMarqueeZoom();
  setupSlopeLineDisplay();
  pin=plot.getPlotAbstraction().createPin();
}
Program: 185206
Project: 185206
Buggy source:
@Override public String getTimeSystemSetting(){
  return this.get(PlotConstants.TIME_FORMAT_SETTING,String.class);
}

Fixed version (ground truth):
@Override public String getTimeSystemSetting(){
  return this.get(PlotConstants.TIME_SYSTEM_SETTING,String.class);
}
Program: 185207
Project: 185207
Buggy source:
@Override public void addDataSet(String lowerCase,Color plottingColor,String displayName){
}

Fixed version (ground truth):
@Override public void addDataSet(String lowerCase,Color plottingColor,AbstractLegendEntry legend){
}
Program: 185208
Project: 185208
Buggy source:
public MultiColTable(AbstractComponent component,ViewSettings settings){
  super(new GridLayout(1,0));
  model=new MultiColTableModel(component,this,settings);
  table=new JTable(model);
  table.setAutoCreateRowSorter(true);
  table.setPreferredScrollableViewportSize(new Dimension(400,750));
  table.setFillsViewportHeight(true);
  table.setDefaultRenderer(Object.class,new MuliColTableCellRender());
  for (int colIndex=0; colIndex < model.getColumnCount(); colIndex++) {
    setColumnHeaderBorderState(colIndex,new BorderState("String_Node_Str"));
    setColumnHeaderBorderColor(colIndex,Color.black);
  }
  scroll=new JScrollPane(table);
  add(scroll);
}

Fixed version (ground truth):
public MultiColTable(AbstractComponent component,ViewSettings settings){
  super(new GridLayout(1,0));
  model=new MultiColTableModel(component,this,settings);
  table=new JTable(model);
  table.setAutoCreateRowSorter(true);
  table.setPreferredScrollableViewportSize(new Dimension(400,750));
  table.setFillsViewportHeight(true);
  DynamicValueCellRender dynamicValueCellRender=new DynamicValueCellRender();
  table.getColumnModel().getColumn(ColumnType.VALUE.ordinal()).setCellRenderer(dynamicValueCellRender);
  table.getColumnModel().getColumn(ColumnType.RAW.ordinal()).setCellRenderer(dynamicValueCellRender);
  for (int colIndex=0; colIndex < model.getColumnCount(); colIndex++) {
    setColumnHeaderBorderState(colIndex,new BorderState("String_Node_Str"));
    setColumnHeaderBorderColor(colIndex,Color.black);
  }
  scroll=new JScrollPane(table);
  add(scroll);
}
Program: 185209
Project: 185209
Buggy source:
public Object getValueAt(int r,int c){
  ColumnType colType=settings.getColumnAtIndex(c);
  Object cellDatum=null;
  AbstractComponent cellComponent=childrenList.get(r);
switch (colType) {
case ID:
    cellDatum=ABCD_6789;
  break;
case TITLE:
cellDatum=THRM_T_BITBOX1;
break;
case FSW_NAME:
cellDatum=ADC_RPAM_A_REU_PRT12;
break;
case RAW:
cellDatum=_2;
break;
case VALUE:
cellDatum=getValueForComponent(cellComponent);
break;
case UNIT:
cellDatum=DEQ_C;
break;
case ERT:
cellDatum=_22_59_24_448;
break;
case SCLK:
cellDatum=_0334154108_25000;
break;
case SCET:
cellDatum=_2010_250T21_26_25_762;
break;
}
if (cellDatum == null) {
return "String_Node_Str";
}
 else {
return cellDatum;
}
}

Fixed version (ground truth):
public Object getValueAt(int r,int c){
  ColumnType colType=settings.getColumnAtIndex(c);
  Object cellDatum=null;
  AbstractComponent cellComponent=childrenList.get(r);
switch (colType) {
case ID:
    cellDatum=ABCD_6789;
  break;
case TITLE:
cellDatum=THRM_T_BITBOX1;
break;
case FSW_NAME:
cellDatum=ADC_RPAM_A_REU_PRT12;
break;
case RAW:
cellDatum=getValueForComponent(cellComponent);
break;
case VALUE:
cellDatum=getValueForComponent(cellComponent);
break;
case UNIT:
cellDatum=DEQ_C;
break;
case ERT:
cellDatum=_22_59_24_448;
break;
case SCLK:
cellDatum=_0334154108_25000;
break;
case SCET:
cellDatum=_2010_250T21_26_25_762;
break;
}
if (cellDatum == null) {
return "String_Node_Str";
}
 else {
return cellDatum;
}
}
Program: 185210
Project: 185210
Buggy source:
/** 
 * Sets the value of an object updated by a data feed. This change is propogated to all table cells displaying that object.
 * @param id the identifier for the object updated
 * @param value the new value to display
 */
public void setValue(String id,Object value){
  values.put(id,value);
  List<Integer> locations=componentLocations.get(id);
  if (locations != null) {
    for (    Integer row : locations) {
      fireTableCellUpdated(row,ColumnType.VALUE.ordinal());
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the value of an object updated by a data feed. This change is propogated to all table cells displaying that object.
 * @param id the identifier for the object updated
 * @param value the new value to display
 */
public void setValue(String id,Object value){
  values.put(id,value);
  List<Integer> locations=componentLocations.get(id);
  if (locations != null) {
    for (    Integer row : locations) {
      fireTableCellUpdated(row,ColumnType.VALUE.ordinal());
      fireTableCellUpdated(row,ColumnType.RAW.ordinal());
    }
  }
}
Program: 185211
Project: 185211
Buggy source:
@Override public ExecutionResult execute(PolicyContext context){
  ExecutionResult trueResult=new ExecutionResult(context,true,"String_Node_Str");
  AbstractComponent component=context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(),AbstractComponent.class);
  if (!checkArguments(context,component))   return trueResult;
  ViewType viewType=context.getProperty(PolicyContext.PropertyName.VIEW_TYPE.getName(),ViewType.class);
  ViewInfo targetViewInfo=context.getProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(),ViewInfo.class);
  if (viewType == ViewType.OBJECT || viewType == ViewType.CENTER) {
    if (hasPermission(component)) {
      if (DropboxCanvasView.class.isAssignableFrom(targetViewInfo.getViewClass()))       return new ExecutionResult(context,false,"String_Node_Str");
    }
 else {
      if (!(DropboxCanvasView.class.isAssignableFrom(targetViewInfo.getViewClass())))       return new ExecutionResult(context,false,"String_Node_Str");
    }
  }
  return trueResult;
}

Fixed version (ground truth):
@Override public ExecutionResult execute(PolicyContext context){
  ExecutionResult trueResult=new ExecutionResult(context,true,"String_Node_Str");
  AbstractComponent component=context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(),AbstractComponent.class);
  if (!checkArguments(context,component))   return trueResult;
  ViewType viewType=context.getProperty(PolicyContext.PropertyName.VIEW_TYPE.getName(),ViewType.class);
  ViewInfo targetViewInfo=context.getProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(),ViewInfo.class);
  if (viewType == ViewType.OBJECT || viewType == ViewType.CENTER) {
    if (DropboxCanvasView.class.isAssignableFrom(targetViewInfo.getViewClass()) || targetViewInfo.getViewName().equals("String_Node_Str"))     return new ExecutionResult(context,true,"String_Node_Str");
  }
  return new ExecutionResult(context,false,"String_Node_Str");
}
Program: 185212
Project: 185212
Buggy source:
void layoutPanel(){
  removeAll();
  add(spanTag);
  add(boxStrut);
  add(spanValue);
  add(Box.createHorizontalStrut(INTERCONTROL_HORIZONTAL_SPACING + 3));
  add(new JLabel(BUNDLE.getString("String_Node_Str")));
  add(Box.createHorizontalStrut(INTERCONTROL_HORIZONTAL_SPACING + 3));
  add(timeSpanValue.getYearSpanValue());
}

Fixed version (ground truth):
void layoutPanel(){
  removeAll();
  add(spanTag);
  add(boxStrut);
  add(spanValue);
  if (spanValue instanceof TimeSpanTextField) {
    add(Box.createHorizontalStrut(INTERCONTROL_HORIZONTAL_SPACING + 3));
    add(new JLabel(BUNDLE.getString("String_Node_Str")));
    add(Box.createHorizontalStrut(INTERCONTROL_HORIZONTAL_SPACING + 3));
    add(timeSpanValue.getYearSpanValue());
  }
}
Program: 185213
Project: 185213
Buggy source:
private Properties getPersistenceProperties() throws IOException {
  Properties properties=new Properties();
  InputStream is=ClassLoader.getSystemClassLoader().getResourceAsStream(PERSISTENCE_PROPS);
  if (is == null)   throw new IOException("String_Node_Str" + PERSISTENCE_PROPS);
  try {
    properties.load(is);
  }
  finally {
    is.close();
  }
  final String dbUser="String_Node_Str";
  final String dbPassword="String_Node_Str";
  final String dbConnectionURL="String_Node_Str";
  final String dbName="String_Node_Str";
  final String dbProperties="String_Node_Str";
  final String jdbcUrlProperty="String_Node_Str";
  if (System.getProperty(jdbcUrlProperty) != null) {
    properties.put(jdbcUrlProperty,System.getProperty(jdbcUrlProperty));
  }
  properties.put("String_Node_Str",System.getProperty(dbUser,properties.getProperty(dbUser)));
  properties.put("String_Node_Str",System.getProperty(dbPassword,properties.getProperty(dbPassword)));
  String connectionURL=System.getProperty(dbConnectionURL,properties.getProperty(dbConnectionURL)) + System.getProperty(dbName,properties.getProperty(dbName)) + "String_Node_Str"+ System.getProperty(dbProperties,properties.getProperty(dbProperties));
  if (!properties.containsKey(jdbcUrlProperty)) {
    properties.put(jdbcUrlProperty,connectionURL);
  }
  return properties;
}

Fixed version (ground truth):
private Properties getPersistenceProperties() throws IOException {
  Properties properties=new Properties();
  InputStream is=ClassLoader.getSystemClassLoader().getResourceAsStream(PERSISTENCE_PROPS);
  if (is == null)   throw new IOException("String_Node_Str" + PERSISTENCE_PROPS);
  try {
    properties.load(is);
  }
  finally {
    is.close();
  }
  final String dbUser="String_Node_Str";
  final String dbPassword="String_Node_Str";
  final String dbConnectionURL="String_Node_Str";
  final String dbName="String_Node_Str";
  final String dbProperties="String_Node_Str";
  final String jdbcUrlProperty="String_Node_Str";
  if (System.getProperty(jdbcUrlProperty) != null) {
    properties.put(jdbcUrlProperty,System.getProperty(jdbcUrlProperty));
  }
  final String userName=System.getProperty(dbUser,properties.getProperty(dbUser));
  final String pw=System.getProperty(dbPassword,properties.getProperty(dbPassword));
  if (userName != null) {
    properties.put("String_Node_Str",userName);
  }
  if (pw != null) {
    properties.put("String_Node_Str",pw);
  }
  String connectionURL=System.getProperty(dbConnectionURL,properties.getProperty(dbConnectionURL)) + System.getProperty(dbName,properties.getProperty(dbName)) + "String_Node_Str"+ System.getProperty(dbProperties,properties.getProperty(dbProperties));
  if (!properties.containsKey(jdbcUrlProperty)) {
    properties.put(jdbcUrlProperty,connectionURL);
  }
  return properties;
}
Program: 185214
Project: 185214
Buggy source:
private void setMaxAlarmIconToAlarmOpendedByUser(){
  changeButtonIcon(nonTimeMaxLimitButton,nonTimeMaxLimitAlarmOpenedByUserIcon);
}

Fixed version (ground truth):
private void setMaxAlarmIconToAlarmOpendedByUser(){
  changeButtonIcon(nonTimeMaxLimitButton,nonTimeMaxLimitAlarmOpenedByUserIcon,BUNDLE.getString("String_Node_Str"));
}
Program: 185215
Project: 185215
Buggy source:
private void setMaxAlarmIconToAlarmClosedByUser(){
  changeButtonIcon(nonTimeMaxLimitButton,nonTimeMaxLimitAlarmClosedByUserIcon);
}

Fixed version (ground truth):
private void setMaxAlarmIconToAlarmClosedByUser(){
  changeButtonIcon(nonTimeMaxLimitButton,nonTimeMaxLimitAlarmClosedByUserIcon,BUNDLE.getString("String_Node_Str"));
}
Program: 185216
Project: 185216
Buggy source:
/** 
 * Set the enabled state of the manager.
 * @param state true if manager is enabled, false otherwise. 
 */
void setEnabled(boolean state){
  if (state) {
    if (cachedNonTimeMinAlarm != LimitAlarmState.NO_ALARM) {
      nonTimeMinAlarm=cachedNonTimeMaxAlarm;
    }
    if (cachedNonTimeMaxAlarm != LimitAlarmState.NO_ALARM) {
      nonTimeMaxAlarm=cachedNonTimeMaxAlarm;
    }
    isEnabled=true;
  }
 else {
    isEnabled=false;
    hideAllLimitButtons();
    cacheCurrentAlarmState();
    nonTimeMinAlarm=LimitAlarmState.NO_ALARM;
    nonTimeMaxAlarm=LimitAlarmState.NO_ALARM;
  }
}

Fixed version (ground truth):
/** 
 * Set the enabled state of the manager.
 * @param state true if manager is enabled, false otherwise. 
 */
void setEnabled(boolean state){
  if (state) {
    if (cachedNonTimeMinAlarm != LimitAlarmState.NO_ALARM) {
      nonTimeMinAlarm=cachedNonTimeMaxAlarm;
    }
    if (cachedNonTimeMaxAlarm != LimitAlarmState.NO_ALARM) {
      nonTimeMaxAlarm=cachedNonTimeMaxAlarm;
    }
    showAllLimitButtons();
    isEnabled=true;
  }
 else {
    isEnabled=false;
    hideAllLimitButtons();
    cacheCurrentAlarmState();
    nonTimeMinAlarm=LimitAlarmState.NO_ALARM;
    nonTimeMaxAlarm=LimitAlarmState.NO_ALARM;
  }
}
Program: 185217
Project: 185217
Buggy source:
private void setMinAlarmIconToAlarmOpendedByUser(){
  changeButtonIcon(nonTimeMinLimitButton,nonTimeMinLimitAlarmOpenedByUserIcon);
}

Fixed version (ground truth):
private void setMinAlarmIconToAlarmOpendedByUser(){
  changeButtonIcon(nonTimeMinLimitButton,nonTimeMinLimitAlarmOpenedByUserIcon,BUNDLE.getString("String_Node_Str"));
}
Program: 185218
Project: 185218
Buggy source:
private void setMinAlarmIconToAlarmClosedByUser(){
  changeButtonIcon(nonTimeMinLimitButton,nonTimeMinLimitAlarmClosedByUserIcon);
}

Fixed version (ground truth):
private void setMinAlarmIconToAlarmClosedByUser(){
  changeButtonIcon(nonTimeMinLimitButton,nonTimeMinLimitAlarmClosedByUserIcon,BUNDLE.getString("String_Node_Str"));
}
Program: 185219
Project: 185219
Buggy source:
private void setMaxAlarmIconToAlarmRaised(){
  changeButtonIcon(nonTimeMaxLimitButton,nonTimeMaxLimitAlarmRaisedIcon);
}

Fixed version (ground truth):
private void setMaxAlarmIconToAlarmRaised(){
  changeButtonIcon(nonTimeMaxLimitButton,nonTimeMaxLimitAlarmRaisedIcon,BUNDLE.getString("String_Node_Str"));
}
Program: 185220
Project: 185220
Buggy source:
private void setMinAlarmIconToAlarmRaised(){
  changeButtonIcon(nonTimeMinLimitButton,nonTimeMinLimitAlarmRaisedIcon);
}

Fixed version (ground truth):
private void setMinAlarmIconToAlarmRaised(){
  changeButtonIcon(nonTimeMinLimitButton,nonTimeMinLimitAlarmRaisedIcon,BUNDLE.getString("String_Node_Str"));
}
Program: 185221
Project: 185221
Buggy source:
private void changeButtonIcon(JButton button,ImageIcon newIcon){
  button.setIcon(newIcon);
}

Fixed version (ground truth):
private void changeButtonIcon(JButton button,ImageIcon newIcon,String tooltip){
  button.setIcon(newIcon);
  button.setToolTipText(tooltip);
}
Program: 185222
Project: 185222
Buggy source:
public static Shape getShape(String character,FontRenderContext frc){
  Font font=PlotLineGlobalConfiguration.getMarkerFont();
  Shape shape=font.createGlyphVector(frc,character).getGlyphOutline(0);
  Rectangle bounds=shape.getBounds();
  shape=AffineTransform.getTranslateInstance(-bounds.width / 2,bounds.height / 2).createTransformedShape(shape);
  return shape;
}

Fixed version (ground truth):
public static Shape getShape(String character,FontRenderContext frc){
  Font font=PlotLineGlobalConfiguration.getMarkerFont();
  Shape shape=font.createGlyphVector(frc,character).getGlyphOutline(0);
  Rectangle bounds=shape.getBounds();
  shape=AffineTransform.getTranslateInstance(-bounds.width / (double)2,bounds.height / (double)2).createTransformedShape(shape);
  return shape;
}
Program: 185223
Project: 185223
Buggy source:
@Override public boolean verify(JComponent component){
  TimeSpanTextField field=(TimeSpanTextField)component;
  String days=field.getText().substring(DAYS_POSITION,3);
  String hours=field.getText().substring(HOURS_POSITION,6);
  String minutes=field.getText().substring(MINUTES_POSITION,9);
  String seconds=field.getText().substring(SECONDS_POSITION,12);
  int daysValue=Integer.parseInt(days);
  int hoursValue=Integer.parseInt(hours);
  int minutesValue=Integer.parseInt(minutes);
  int secondsValue=Integer.parseInt(seconds);
  if (secondsValue >= 60) {
    minutesValue+=Double.valueOf(Math.floor(secondsValue / 60)).intValue();
    secondsValue=secondsValue % 60;
  }
  if (minutesValue >= 60) {
    hoursValue+=Double.valueOf(Math.floor(minutesValue / 60)).intValue();
    minutesValue=minutesValue % 60;
  }
  if (hoursValue >= 24) {
    daysValue+=Double.valueOf(Math.floor(hoursValue / 24)).intValue();
    hoursValue=hoursValue % 24;
  }
  if (daysValue > 366) {
    field.setSelectionStart(DAYS_POSITION);
    field.setSelectionEnd(3);
    return false;
  }
  setTimeValue(daysValue,hoursValue,minutesValue,secondsValue);
  return field.isEditValid();
}

Fixed version (ground truth):
@Override public boolean verify(JComponent component){
  TimeSpanTextField field=(TimeSpanTextField)component;
  String days=field.getText().substring(DAYS_POSITION,3);
  String hours=field.getText().substring(HOURS_POSITION,6);
  String minutes=field.getText().substring(MINUTES_POSITION,9);
  String seconds=field.getText().substring(SECONDS_POSITION,12);
  int daysValue=Integer.parseInt(days);
  int hoursValue=Integer.parseInt(hours);
  int minutesValue=Integer.parseInt(minutes);
  int secondsValue=Integer.parseInt(seconds);
  if (secondsValue >= 60) {
    minutesValue+=secondsValue / 60;
    secondsValue=secondsValue % 60;
  }
  if (minutesValue >= 60) {
    hoursValue+=minutesValue / 60;
    minutesValue=minutesValue % 60;
  }
  if (hoursValue >= 24) {
    daysValue+=hoursValue / 24;
    hoursValue=hoursValue % 24;
  }
  if (daysValue > 366) {
    field.setSelectionStart(DAYS_POSITION);
    field.setSelectionEnd(3);
    return false;
  }
  setTimeValue(daysValue,hoursValue,minutesValue,secondsValue);
  return field.isEditValid();
}
Program: 185224
Project: 185224
Buggy source:
@Override public boolean verify(JComponent component){
  TimeTextField field=(TimeTextField)component;
  String text=field.getText();
  if (text == null || text.length() == 0) {
    return true;
  }
  String days=text.substring(DAYS_POSITION,3);
  String hours=text.substring(HOURS_POSITION,6);
  String minutes=text.substring(MINUTES_POSITION,9);
  String seconds=text.substring(SECONDS_POSITION,12);
  int daysValue=Integer.parseInt(days);
  int hoursValue=Integer.parseInt(hours);
  int minutesValue=Integer.parseInt(minutes);
  int secondsValue=Integer.parseInt(seconds);
  if (daysValue == 0) {
    field.setSelectionStart(DAYS_POSITION);
    field.setSelectionEnd(3);
    return false;
  }
  if (secondsValue >= 60) {
    minutesValue+=Double.valueOf(Math.floor(secondsValue / 60)).intValue();
    secondsValue=secondsValue % 60;
  }
  if (minutesValue >= 60) {
    hoursValue+=Double.valueOf(Math.floor(minutesValue / 60)).intValue();
    minutesValue=minutesValue % 60;
  }
  if (hoursValue >= 24) {
    daysValue+=Double.valueOf(Math.floor(hoursValue / 24)).intValue();
    hoursValue=hoursValue % 24;
  }
  if ((modelCalendar.isLeapYear(modelCalendar.get(Calendar.YEAR)) && daysValue > 366) || (!modelCalendar.isLeapYear(modelCalendar.get(Calendar.YEAR)) && daysValue > 365)) {
    yearValue=(modelCalendar.get(Calendar.YEAR) + Double.valueOf(Math.floor(daysValue / 365)).intValue());
    daysValue=(daysValue % 365) + 1;
  }
  setTimeValue(daysValue,hoursValue,minutesValue,secondsValue);
  return field.isEditValid();
}

Fixed version (ground truth):
@Override public boolean verify(JComponent component){
  TimeTextField field=(TimeTextField)component;
  String text=field.getText();
  if (text == null || text.length() == 0) {
    return true;
  }
  String days=text.substring(DAYS_POSITION,3);
  String hours=text.substring(HOURS_POSITION,6);
  String minutes=text.substring(MINUTES_POSITION,9);
  String seconds=text.substring(SECONDS_POSITION,12);
  int daysValue=Integer.parseInt(days);
  int hoursValue=Integer.parseInt(hours);
  int minutesValue=Integer.parseInt(minutes);
  int secondsValue=Integer.parseInt(seconds);
  if (daysValue == 0) {
    field.setSelectionStart(DAYS_POSITION);
    field.setSelectionEnd(3);
    return false;
  }
  if (secondsValue >= 60) {
    minutesValue+=secondsValue / 60;
    secondsValue=secondsValue % 60;
  }
  if (minutesValue >= 60) {
    hoursValue+=minutesValue / 60;
    minutesValue=minutesValue % 60;
  }
  if (hoursValue >= 24) {
    daysValue+=hoursValue / 24;
    hoursValue=hoursValue % 24;
  }
  if ((modelCalendar.isLeapYear(modelCalendar.get(Calendar.YEAR)) && daysValue > 366) || (!modelCalendar.isLeapYear(modelCalendar.get(Calendar.YEAR)) && daysValue > 365)) {
    yearValue=(modelCalendar.get(Calendar.YEAR) + Double.valueOf(Math.floor(daysValue / 365)).intValue());
    daysValue=(daysValue % 365) + 1;
  }
  setTimeValue(daysValue,hoursValue,minutesValue,secondsValue);
  return field.isEditValid();
}
Program: 185226
Project: 185226
Buggy source:
@Test public void testMinAlarmOnly(){
  PlotView testPlot=new PlotView.Builder(PlotterPlot.class).nonTimeAxisMinSubsequentSetting(NonTimeAxisSubsequentBoundsSetting.FIXED).nonTimeAxisMaxSubsequentSetting(NonTimeAxisSubsequentBoundsSetting.FIXED).nonTimeVaribleAxisMaxValue(10).nonTimeVaribleAxisMinValue(0).build();
  testPlot.setManifestation(mockPlotViewManifestation);
  testPlot.setCompressionEnabled(false);
  Assert.assertFalse(testPlot.isCompresionEnabled());
  Assert.assertEquals(testPlot.getNonTimeMaxAlarmState(0),LimitAlarmState.NO_ALARM);
  Assert.assertEquals(testPlot.getNonTimeMinAlarmState(0),LimitAlarmState.NO_ALARM);
  testPlot.addDataSet("String_Node_Str");
  Assert.assertEquals(testPlot.getNonTimeMaxAlarmState(0),LimitAlarmState.NO_ALARM);
  Assert.assertEquals(testPlot.getNonTimeMinAlarmState(0),LimitAlarmState.NO_ALARM);
  testPlot.addData("String_Node_Str",System.currentTimeMillis(),1);
  Assert.assertEquals(testPlot.getNonTimeMaxAlarmState(0),LimitAlarmState.NO_ALARM);
  Assert.assertEquals(testPlot.getNonTimeMinAlarmState(0),LimitAlarmState.ALARM_RAISED);
  testPlot.addData("String_Node_Str",System.currentTimeMillis(),-1);
  Assert.assertEquals(testPlot.getNonTimeMaxAlarmState(0),LimitAlarmState.NO_ALARM);
  Assert.assertEquals(testPlot.getNonTimeMinAlarmState(0),LimitAlarmState.ALARM_RAISED);
}

Fixed version (ground truth):
@Test public void testMinAlarmOnly(){
  PlotView testPlot=new PlotView.Builder(PlotterPlot.class).nonTimeAxisMinSubsequentSetting(NonTimeAxisSubsequentBoundsSetting.FIXED).nonTimeAxisMaxSubsequentSetting(NonTimeAxisSubsequentBoundsSetting.FIXED).nonTimeVaribleAxisMaxValue(10).nonTimeVaribleAxisMinValue(0).build();
  testPlot.setManifestation(mockPlotViewManifestation);
  testPlot.setCompressionEnabled(false);
  Assert.assertFalse(testPlot.isCompresionEnabled());
  Assert.assertEquals(testPlot.getNonTimeMaxAlarmState(0),LimitAlarmState.NO_ALARM);
  Assert.assertEquals(testPlot.getNonTimeMinAlarmState(0),LimitAlarmState.NO_ALARM);
  testPlot.addDataSet("String_Node_Str");
  Assert.assertEquals(testPlot.getNonTimeMaxAlarmState(0),LimitAlarmState.NO_ALARM);
  Assert.assertEquals(testPlot.getNonTimeMinAlarmState(0),LimitAlarmState.NO_ALARM);
  testPlot.addData("String_Node_Str",System.currentTimeMillis(),1);
  Assert.assertEquals(testPlot.getNonTimeMaxAlarmState(0),LimitAlarmState.NO_ALARM);
  Assert.assertEquals(testPlot.getNonTimeMinAlarmState(0),LimitAlarmState.NO_ALARM);
  testPlot.addData("String_Node_Str",System.currentTimeMillis(),-1);
  Assert.assertEquals(testPlot.getNonTimeMaxAlarmState(0),LimitAlarmState.NO_ALARM);
  Assert.assertEquals(testPlot.getNonTimeMinAlarmState(0),LimitAlarmState.ALARM_RAISED);
}
Program: 185229
Project: 185229
Buggy source:
private void ensureViewPropertiesLoaded(){
}

Fixed version (ground truth):
private synchronized void ensureViewPropertiesLoaded(){
}
Program: 185230
Project: 185230
Buggy source:
private void ensureViewPropertiesLoaded(){
}

Fixed version (ground truth):
private synchronized void ensureViewPropertiesLoaded(){
}
Program: 185231
Project: 185231
Buggy source:
@Override public void mouseReleased(MouseEvent e){
  if (canvas != null) {
    xyPlot.getContents().remove(canvas);
    Point2D startCoord=convertPointToLogicalCoord(mouseStartX,mouseStartY);
    Point2D endCoord=convertPointToLogicalCoord(mouseEndX,mouseEndY);
    XYAxis xAxis=xyPlot.getXAxis();
    if (endCoord.getX() > startCoord.getX()) {
      xAxis.setStart(startCoord.getX());
      xAxis.setEnd(endCoord.getX());
    }
 else {
      xAxis.setStart(endCoord.getX());
      xAxis.setEnd(startCoord.getX());
    }
    XYAxis yAxis=xyPlot.getYAxis();
    if (endCoord.getY() > startCoord.getY()) {
      yAxis.setStart(startCoord.getY());
      yAxis.setEnd(endCoord.getY());
    }
 else {
      yAxis.setStart(endCoord.getY());
      yAxis.setEnd(startCoord.getY());
    }
    plotLocalControlsManager.pinXYAxes();
    marqueeRect=null;
    canvas=null;
    xyPlot.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  }
}

Fixed version (ground truth):
@Override public void mouseReleased(MouseEvent e){
  if (canvas != null) {
    xyPlot.getContents().remove(canvas);
    Point2D startCoord=convertPointToLogicalCoord(mouseStartX,mouseStartY);
    Point2D endCoord=convertPointToLogicalCoord(mouseEndX,mouseEndY);
    XYAxis xAxis=xyPlot.getXAxis();
    if (endCoord.getX() > startCoord.getX()) {
      xAxis.setStart(startCoord.getX());
      xAxis.setEnd(endCoord.getX());
    }
 else {
      xAxis.setStart(endCoord.getX());
      xAxis.setEnd(startCoord.getX());
    }
    XYAxis yAxis=xyPlot.getYAxis();
    if (endCoord.getY() > startCoord.getY()) {
      yAxis.setStart(startCoord.getY());
      yAxis.setEnd(endCoord.getY());
    }
 else {
      yAxis.setStart(endCoord.getY());
      yAxis.setEnd(startCoord.getY());
    }
    plotLocalControlsManager.pinXYAxesAfterZoomedIn();
    marqueeRect=null;
    canvas=null;
    xyPlot.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  }
}
Program: 185233
Project: 185233
Buggy source:
@Override public FeedProvider.RenderingInfo evaluate(Map<String,List<Map<String,String>>> data,List<FeedProvider> providers){
  Executor e=getExecutor();
  FeedProvider.RenderingInfo ri=null;
  if (e != null) {
    if (getData().isPassThrough()) {
      for (      FeedProvider fp : providers) {
        if (fp.getSubscriptionId().startsWith("String_Node_Str")) {
          if (fp.getSubscriptionId().substring(4).equals(getData().getPassThroughParameterId())) {
            List<Map<String,String>> values=data.get("String_Node_Str" + getData().getPassThroughParameterId());
            if (values != null) {
              ri=fp.getRenderingInfo(values.get(values.size() - 1));
            }
          }
        }
 else {
          if (fp.getSubscriptionId().equals(getData().getPassThroughParameterId())) {
            List<Map<String,String>> values=data.get(getData().getPassThroughParameterId());
            if (values != null) {
              ri=fp.getRenderingInfo(values.get(values.size() - 1));
            }
          }
        }
      }
    }
 else {
      ri=e.evaluate(data,providers);
      if (ri == null) {
        ri=new FeedProvider.RenderingInfo(getData().getFallThroughDisplayValue(),Color.red,"String_Node_Str",Color.red,false);
      }
    }
  }
 else {
    LoggerFactory.getLogger(MultiComponent.class).error("String_Node_Str" + getLanguage());
    ri=new FeedProvider.RenderingInfo("String_Node_Str",Color.red,"String_Node_Str",Color.red,false);
  }
  return ri;
}

Fixed version (ground truth):
@Override public FeedProvider.RenderingInfo evaluate(Map<String,List<Map<String,String>>> data,List<FeedProvider> providers){
  Executor e=getExecutor();
  FeedProvider.RenderingInfo ri=null;
  if (e != null) {
    if (getData().isPassThrough()) {
      for (      FeedProvider fp : providers) {
        if (fp.getSubscriptionId().equals(getData().getPassThroughParameterId())) {
          List<Map<String,String>> values=data.get(getData().getPassThroughParameterId());
          if (values != null && !values.isEmpty()) {
            ri=fp.getRenderingInfo(values.get(values.size() - 1));
          }
        }
      }
    }
 else {
      ri=e.evaluate(data,providers);
      if (ri == null) {
        ri=new FeedProvider.RenderingInfo(getData().getFallThroughDisplayValue(),Color.red,"String_Node_Str",Color.red,false);
      }
    }
  }
 else {
    LoggerFactory.getLogger(MultiComponent.class).error("String_Node_Str" + getLanguage());
    ri=new FeedProvider.RenderingInfo("String_Node_Str",Color.red,"String_Node_Str",Color.red,false);
  }
  return ri;
}
Program: 185234
Project: 185234
Buggy source:
/** 
 * Create a map of feedID and values
 * @param providers
 * @param data
 * @return
 */
private Map<String,Double> getValuesFromFeed(List<FeedProvider> providers,Map<String,List<Map<String,String>>> data){
  FeedProvider.RenderingInfo result=null;
  Map<String,Double> valuesMap=new ConcurrentHashMap<String,Double>();
  for (  FeedProvider fp : providers) {
    String feedId=fp.getSubscriptionId();
    List<Map<String,String>> values=data.get(feedId);
    if (values != null) {
      result=fp.getRenderingInfo(values.get(values.size() - 1));
      if (result.getValueText() != null) {
        valuesMap.put(feedId,Double.valueOf(result.getValueText()));
        ;
      }
    }
  }
  return valuesMap;
}

Fixed version (ground truth):
/** 
 * Create a map of feedID and values
 * @param providers
 * @param data
 * @return
 */
private Map<String,Double> getValuesFromFeed(List<FeedProvider> providers,Map<String,List<Map<String,String>>> data){
  FeedProvider.RenderingInfo result=null;
  Map<String,Double> valuesMap=new ConcurrentHashMap<String,Double>();
  for (  FeedProvider fp : providers) {
    String feedId=fp.getSubscriptionId();
    List<Map<String,String>> values=data.get(feedId);
    if (values != null && !values.isEmpty()) {
      result=fp.getRenderingInfo(values.get(values.size() - 1));
      if (result.getValueText() != null) {
        valuesMap.put(feedId,Double.valueOf(result.getValueText()));
        ;
      }
    }
  }
  return valuesMap;
}
Program: 185235
Project: 185235
Buggy source:
/** 
 * Creates a new component based on the collection of source components.
 * @param sourceComponents the collection of components.
 * @return newly created abstract component.
 */
AbstractComponent createNewMulti(Collection<AbstractComponent> sourceComponents){
  MultiCreationServiceImpl e=new MultiCreationServiceImpl();
  AbstractComponent ac=e.createMulti(MultiEvaluator.LANGUAGE_STRING,"String_Node_Str");
  ((MultiComponent)ac).getData().setFallThroughDisplayValue("String_Node_Str");
  if (sourceComponents.size() == 1) {
    ((MultiComponent)ac).getData().setPassThrough(true);
    ((MultiComponent)ac).getData().setPassThroughParameterId(sourceComponents.iterator().next().getExternalKey());
  }
 else {
    ((MultiComponent)ac).getData().setPassThrough(false);
  }
  ac.addDelegateComponents(sourceComponents);
  return ac;
}

Fixed version (ground truth):
/** 
 * Creates a new component based on the collection of source components.
 * @param sourceComponents the collection of components.
 * @return newly created abstract component.
 */
AbstractComponent createNewMulti(Collection<AbstractComponent> sourceComponents){
  MultiCreationServiceImpl e=new MultiCreationServiceImpl();
  AbstractComponent ac=e.createMulti(MultiEvaluator.LANGUAGE_STRING,"String_Node_Str");
  ((MultiComponent)ac).getData().setFallThroughDisplayValue("String_Node_Str");
  if (sourceComponents.size() == 1) {
    ((MultiComponent)ac).getData().setPassThrough(true);
    FeedProvider fp=sourceComponents.iterator().next().getCapability(FeedProvider.class);
    ((MultiComponent)ac).getData().setPassThroughParameterId(fp.getSubscriptionId());
  }
 else {
    ((MultiComponent)ac).getData().setPassThrough(false);
  }
  ac.addDelegateComponents(sourceComponents);
  return ac;
}
Program: 185238
Project: 185238
Buggy source:
@BeforeMethod public void setUp(){
  MockitoAnnotations.initMocks(this);
  robot=BasicRobot.robotWithCurrentAwtHierarchy();
  tList=new ArrayList<AbstractComponent>();
  tList.add(ac);
  Mockito.when(mockExpManifestation.getExpressions()).thenReturn(ruleList);
  Mockito.when(ruleList.size()).thenReturn(2);
  Mockito.when(mockExpManifestation.getMulti()).thenReturn(mc);
  Mockito.when(mc.getData()).thenReturn(multiData);
  Mockito.when(ac.getExternalKey()).thenReturn("String_Node_Str");
  Mockito.when(multiData.isPassThrough()).thenReturn(false);
  Mockito.when(mc.getComponents()).thenReturn(Collections.<AbstractComponent>emptyList());
  Mockito.when(mockExpManifestation.getSelectedTelemetry()).thenReturn(ac);
  Mockito.when(mockExpManifestation.getTelemetry()).thenReturn(tList);
  GuiActionRunner.execute(new GuiTask(){
    @Override protected void executeInEDT() throws Throwable {
      controlPanel=new MultiExpressionsFormattingControlsPanel(mockExpManifestation);
      JFrame frame=new JFrame(TITLE);
      frame.setPreferredSize(new Dimension(950,600));
      frame.setName(TITLE);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      controlPanel.setOpaque(true);
      frame.setContentPane(controlPanel);
      frame.pack();
      frame.setVisible(true);
    }
  }
);
}

Fixed version (ground truth):
@BeforeMethod public void setUp(){
  MockitoAnnotations.initMocks(this);
  robot=BasicRobot.robotWithCurrentAwtHierarchy();
  tList=new ArrayList<AbstractComponent>();
  tList.add(ac);
  FeedProvider mockfp=Mockito.mock(FeedProvider.class);
  Mockito.when(mockExpManifestation.getExpressions()).thenReturn(ruleList);
  Mockito.when(ruleList.size()).thenReturn(2);
  Mockito.when(mockExpManifestation.getMulti()).thenReturn(mc);
  Mockito.when(mc.getData()).thenReturn(multiData);
  Mockito.when(ac.getExternalKey()).thenReturn("String_Node_Str");
  Mockito.when(ac.getCapability(FeedProvider.class)).thenReturn(mockfp);
  Mockito.when(mockfp.getSubscriptionId()).thenReturn("String_Node_Str");
  Mockito.when(multiData.isPassThrough()).thenReturn(false);
  Mockito.when(mc.getComponents()).thenReturn(Collections.<AbstractComponent>emptyList());
  Mockito.when(mockExpManifestation.getSelectedTelemetry()).thenReturn(ac);
  Mockito.when(mockExpManifestation.getTelemetry()).thenReturn(tList);
  GuiActionRunner.execute(new GuiTask(){
    @Override protected void executeInEDT() throws Throwable {
      controlPanel=new MultiExpressionsFormattingControlsPanel(mockExpManifestation);
      JFrame frame=new JFrame(TITLE);
      frame.setPreferredSize(new Dimension(950,600));
      frame.setName(TITLE);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      controlPanel.setOpaque(true);
      frame.setContentPane(controlPanel);
      frame.pack();
      frame.setVisible(true);
    }
  }
);
}
Program: 185239
Project: 185239
Buggy source:
@Override protected ThriftMessage decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buffer) throws Exception {
  if (!buffer.readable()) {
    return null;
  }
  short firstByte=buffer.getUnsignedByte(0);
  if (firstByte >= 0x80) {
    return new ThriftMessage(tryDecodeUnframedMessage(ctx,channel,buffer,inputProtocolFactory),ThriftTransportType.UNFRAMED);
  }
 else   if (buffer.readableBytes() < MESSAGE_FRAME_SIZE) {
    return null;
  }
 else {
    return new ThriftMessage(tryDecodeFramedMessage(ctx,channel,buffer,true),ThriftTransportType.FRAMED);
  }
}

Fixed version (ground truth):
@Override protected ThriftMessage decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buffer) throws Exception {
  if (!buffer.readable()) {
    return null;
  }
  short firstByte=buffer.getUnsignedByte(0);
  if (firstByte >= 0x80) {
    ChannelBuffer messageBuffer=tryDecodeUnframedMessage(ctx,channel,buffer,inputProtocolFactory);
    if (messageBuffer == null) {
      return null;
    }
    return new ThriftMessage(messageBuffer,ThriftTransportType.UNFRAMED);
  }
 else   if (buffer.readableBytes() < MESSAGE_FRAME_SIZE) {
    return null;
  }
 else {
    ChannelBuffer messageBuffer=tryDecodeFramedMessage(ctx,channel,buffer,true);
    if (messageBuffer == null) {
      return null;
    }
    return new ThriftMessage(messageBuffer,ThriftTransportType.FRAMED);
  }
}
Program: 185240
Project: 185240
Buggy source:
public HttpClientConnector(URI uri){
  super(HostAndPort.fromParts(checkNotNull(uri).getHost(),checkNotNull(uri).getPort()));
  checkArgument(uri.isAbsolute() && !uri.isOpaque(),"String_Node_Str");
  checkArgument(uri.getScheme().compareTo("String_Node_Str") != 0 && uri.getScheme().compareTo("String_Node_Str") != 0,"String_Node_Str");
  this.endpointUri=uri;
}

Fixed version (ground truth):
public HttpClientConnector(URI uri){
  super(HostAndPort.fromParts(checkNotNull(uri).getHost(),getPort(uri)));
  checkArgument(uri.isAbsolute() && !uri.isOpaque(),"String_Node_Str");
  this.endpointUri=uri;
}
Program: 185241
Project: 185241
Buggy source:
public static void main(String[] args) throws Exception {
  final NiftyBootstrap bootstrap=Guice.createInjector(Stage.PRODUCTION,new NiftyModule(){
    @Override protected void configureNifty(){
      bind().toInstance(new ThriftServerDefBuilder().listen(8080).withProcessor(new scribe.Processor(new scribe.Iface(){
        @Override public ResultCode Log(        List<LogEntry> messages) throws TException {
          for (          LogEntry message : messages) {
            log.info("String_Node_Str",message.getCategory(),message.getMessage());
          }
          return ResultCode.OK;
        }
      }
)).build());
    }
  }
.withNettyConfig(NettyConfigProvider.class)).getInstance(NiftyBootstrap.class);
  bootstrap.start();
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      bootstrap.stop();
    }
  }
);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  final NiftyBootstrap bootstrap=Guice.createInjector(Stage.PRODUCTION,new NiftyModule(){
    @Override protected void configureNifty(){
      bind().toInstance(new ThriftServerDefBuilder().listen(8080).withProcessor(new scribe.Processor<scribe.Iface>(new scribe.Iface(){
        @Override public ResultCode Log(        List<LogEntry> messages) throws TException {
          for (          LogEntry message : messages) {
            log.info("String_Node_Str",message.getCategory(),message.getMessage());
          }
          return ResultCode.OK;
        }
      }
)).build());
      withNettyConfig(NettyConfigProvider.class);
    }
  }
).getInstance(NiftyBootstrap.class);
  bootstrap.start();
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      bootstrap.stop();
    }
  }
);
}
Program: 185242
Project: 185242
Buggy source:
@Override protected void configureNifty(){
  bind().toInstance(new ThriftServerDefBuilder().listen(8080).withProcessor(new scribe.Processor(new scribe.Iface(){
    @Override public ResultCode Log(    List<LogEntry> messages) throws TException {
      for (      LogEntry message : messages) {
        log.info("String_Node_Str",message.getCategory(),message.getMessage());
      }
      return ResultCode.OK;
    }
  }
)).build());
}

Fixed version (ground truth):
@Override protected void configureNifty(){
  bind().toInstance(new ThriftServerDefBuilder().listen(8080).withProcessor(new scribe.Processor<scribe.Iface>(new scribe.Iface(){
    @Override public ResultCode Log(    List<LogEntry> messages) throws TException {
      for (      LogEntry message : messages) {
        log.info("String_Node_Str",message.getCategory(),message.getMessage());
      }
      return ResultCode.OK;
    }
  }
)).build());
  withNettyConfig(NettyConfigProvider.class);
}
Program: 185243
Project: 185243
Buggy source:
public static void main(String[] args) throws Exception {
  ConfigurationFactory cf=new ConfigurationFactory(new ConfigurationLoader().loadProperties());
  AbstractModule exampleModule=new AbstractModule(){
    @Override public void configure(){
      ConfigurationModule.bindConfig(binder()).to(ExampleConfig.class);
      binder().bind(NiftyBootstrap.class).in(Singleton.class);
    }
  }
;
  Guice.createInjector(Stage.PRODUCTION,new ConfigurationModule(cf),new ValidationErrorModule(new ConfigurationValidator(cf,null).validate(exampleModule)),new LifeCycleModule(),exampleModule,new NiftyModule(){
    @Override protected void configureNifty(){
      bind().toProvider(ExampleThriftServerProvider.class);
    }
  }
.withDefaultNettyConfig()).getInstance(LifeCycleManager.class).start();
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  ConfigurationFactory cf=new ConfigurationFactory(new ConfigurationLoader().loadProperties());
  AbstractModule exampleModule=new AbstractModule(){
    @Override public void configure(){
      ConfigurationModule.bindConfig(binder()).to(ExampleConfig.class);
      binder().bind(NiftyBootstrap.class).in(Singleton.class);
    }
  }
;
  Guice.createInjector(Stage.PRODUCTION,new ConfigurationModule(cf),new ValidationErrorModule(new ConfigurationValidator(cf,null).validate(exampleModule)),new LifeCycleModule(),exampleModule,new NiftyModule(){
    @Override protected void configureNifty(){
      bind().toProvider(ExampleThriftServerProvider.class);
      withDefaultNettyConfig();
    }
  }
).getInstance(LifeCycleManager.class).start();
}
Program: 185244
Project: 185244
Buggy source:
@Override protected void configureNifty(){
  bind().toProvider(ExampleThriftServerProvider.class);
}

Fixed version (ground truth):
@Override protected void configureNifty(){
  bind().toProvider(ExampleThriftServerProvider.class);
  withDefaultNettyConfig();
}
Program: 185245
Project: 185245
Buggy source:
public ThriftTypeReference getCollectionElementThriftTypeReference(Type javaType){
  if (isStructType(javaType)) {
    deferredTypesWorkList.get().add(javaType);
    return getThriftTypeReference(javaType,Recursiveness.FORCED);
  }
 else {
    return getThriftTypeReference(javaType,Recursiveness.NOT_ALLOWED);
  }
}

Fixed version (ground truth):
public ThriftTypeReference getCollectionElementThriftTypeReference(Type javaType){
  if (isStructType(javaType)) {
    return getThriftTypeReference(javaType,Recursiveness.FORCED);
  }
 else {
    return getThriftTypeReference(javaType,Recursiveness.NOT_ALLOWED);
  }
}
Program: 185246
Project: 185246
Buggy source:
public ThriftTypeReference getMapKeyThriftTypeReference(Type javaType){
  if (isStructType(javaType)) {
    deferredTypesWorkList.get().add(javaType);
    return getThriftTypeReference(javaType,Recursiveness.FORCED);
  }
 else {
    return getThriftTypeReference(javaType,Recursiveness.NOT_ALLOWED);
  }
}

Fixed version (ground truth):
public ThriftTypeReference getMapKeyThriftTypeReference(Type javaType){
  if (isStructType(javaType)) {
    return getThriftTypeReference(javaType,Recursiveness.FORCED);
  }
 else {
    return getThriftTypeReference(javaType,Recursiveness.NOT_ALLOWED);
  }
}