nus-yam/ex-repair huggingface dataset:
Program: 81532
Project: 81532
Buggy source:
/** 
 * Configure the attribute table
 */
private void configureTable(){
  if (!(heatMapModel == null)) {
    String[] attributes=PlateUtils.getPlateAttributeTitles(heatMapModel.getPlateAttributes());
    String[] selectedAttributes=heatMapModel.getSortAttributesSelectionTitles();
    tableData=new String[attributes.length][1];
    DefaultTableModel model=new DefaultTableModel(tableData,columnNames);
    table.setModel(model);
    int index=0;
    List<Integer> selectionIndex=new ArrayList<Integer>();
    for (    String attribute : attributes) {
      if (ArrayUtils.contains(selectedAttributes,attribute)) {
        selectionIndex.add(index);
      }
      model.setValueAt("String_Node_Str",index,0);
      model.setValueAt(attribute,index++,1);
    }
    for (    Integer position : selectionIndex) {
      listSelectionModel.addSelectionInterval(position,position);
    }
  }
  repaint();
}

Fixed version (ground truth):
/** 
 * Configure the attribute table
 */
private void configureTable(){
  if (!(heatMapModel == null)) {
    String[] attributes=PlateUtils.getPlateAttributeTitles(heatMapModel.getPlateAttributes());
    String[] selectedAttributes=heatMapModel.getSortAttributesSelectionTitles();
    tableData=new String[attributes.length][1];
    DefaultTableModel model=new DefaultTableModel(tableData,columnNames);
    table.setModel(model);
    int index=0;
    for (    String attribute : attributes) {
      model.setValueAt("String_Node_Str",index,0);
      model.setValueAt(attribute,index++,1);
    }
    if (selectedAttributes != null) {
      for (      String attribute : selectedAttributes) {
        int position=ArrayUtils.indexOf(attributes,attribute);
        listSelectionModel.addSelectionInterval(position,position);
      }
    }
  }
  repaint();
}
Program: 81533
Project: 81533
Buggy source:
/** 
 * Create the "reference population parameter" setting model with the default columns name as defined by   {@link PlateUtils}.
 * @return "reference population parameter" setting model
 */
static SettingsModelString createReferenceParameterSettingModel(){
  return new SettingsModelString(REFERENCE_POPULATIONS_SETTING_NAME,PlateUtils.SCREEN_MODEL_TREATMENT);
}

Fixed version (ground truth):
/** 
 * Create the "reference population parameter" setting model with the default columns name as defined by   {@link PlateUtils}.
 * @return "reference population parameter" setting model
 */
static SettingsModelString createReferenceParameterSettingModel(){
  return new SettingsModelString(REFERENCE_PARAMETER_SETTING_NAME,PlateUtils.SCREEN_MODEL_TREATMENT);
}
Program: 81534
Project: 81534
Buggy source:
/** 
 * Get a color at a particular fraction of the gradient.
 * @param painter to fetch the color from
 * @param input fraction [0...1]
 * @return the color at the input fraction
 */
public static Color getColorAt(LinearGradientPaint painter,float input){
  int lowerIndex=0;
  int upperIndex=1;
  float lowerBound=0;
  float upperBound=1;
  float[] fractions=painter.getFractions();
  Color[] colors=painter.getColors();
  if (input > 1) {
    input=1f;
  }
  if (input < 0) {
    input=0f;
  }
  int index=0;
  for (  float fraction : fractions) {
    if (fraction < input) {
      lowerBound=fraction;
      lowerIndex=index;
    }
 else     if (fraction == input) {
      return colors[index];
    }
 else     if (fraction > input) {
      upperBound=fraction;
      upperIndex=index;
    }
    index++;
  }
  float rescaled=(input - lowerBound) / (upperBound - lowerBound);
  return interpolateColor(colors[lowerIndex],colors[upperIndex],rescaled);
}

Fixed version (ground truth):
/** 
 * Get a color at a particular fraction of the gradient.
 * @param painter to fetch the color from
 * @param input fraction [0...1]
 * @return the color at the input fraction
 */
public static Color getColorAt(LinearGradientPaint painter,float input){
  int lowerIndex=0;
  int upperIndex=1;
  float lowerBound=0;
  float upperBound=1;
  float[] fractions=painter.getFractions();
  Color[] colors=painter.getColors();
  if (input > 1) {
    input=1f;
  }
  if (input < 0) {
    input=0f;
  }
  int index=0;
  for (  float fraction : fractions) {
    if (fraction < input) {
      lowerBound=fraction;
      lowerIndex=index;
    }
 else     if (fraction == input) {
      return colors[index];
    }
    index++;
  }
  index=0;
  for (  float fraction : fractions) {
    if (fraction > input) {
      upperBound=fraction;
      upperIndex=index;
      break;
    }
    index++;
  }
  float rescaled=(input - lowerBound) / (upperBound - lowerBound);
  return interpolateColor(colors[lowerIndex],colors[upperIndex],rescaled);
}
Program: 81536
Project: 81536
Buggy source:
/** 
 * Linear interpolator between two colors
 * @param color1 first bound
 * @param color2 second bound
 * @param fraction [0...1]
 * @return interpolation: color2+(color2-color1) * fraction
 */
public static Color interpolateColor(final Color color1,final Color color2,final float fraction){
  assert(Float.compare(fraction,0f) >= 0 && Float.compare(fraction,1f) <= 0);
  final float INT_TO_FLOAT_CONST=1f / 255f;
  final float RED1=color1.getRed() * INT_TO_FLOAT_CONST;
  final float GREEN1=color1.getGreen() * INT_TO_FLOAT_CONST;
  final float BLUE1=color1.getBlue() * INT_TO_FLOAT_CONST;
  final float ALPHA1=color1.getAlpha() * INT_TO_FLOAT_CONST;
  final float RED2=color2.getRed() * INT_TO_FLOAT_CONST;
  final float GREEN2=color2.getGreen() * INT_TO_FLOAT_CONST;
  final float BLUE2=color2.getBlue() * INT_TO_FLOAT_CONST;
  final float ALPHA2=color2.getAlpha() * INT_TO_FLOAT_CONST;
  final float DELTA_RED=RED2 - RED1;
  final float DELTA_GREEN=GREEN2 - GREEN1;
  final float DELTA_BLUE=BLUE2 - BLUE1;
  final float DELTA_ALPHA=ALPHA2 - ALPHA1;
  float red=RED1 + (DELTA_RED * fraction);
  float green=GREEN1 + (DELTA_GREEN * fraction);
  float blue=BLUE1 + (DELTA_BLUE * fraction);
  float alpha=ALPHA1 + (DELTA_ALPHA * fraction);
  red=red < 0f ? 0f : red;
  red=red > 1f ? 1f : red;
  green=green < 0f ? 0f : green;
  green=green > 1f ? 1f : green;
  blue=blue < 0f ? 0f : blue;
  blue=blue > 1f ? 1f : blue;
  alpha=alpha < 0f ? 0f : alpha;
  alpha=alpha > 1f ? 1f : alpha;
  return new Color(red,green,blue,alpha);
}

Fixed version (ground truth):
/** 
 * Linear interpolator between two colors
 * @param color1 first bound
 * @param color2 second bound
 * @param fraction [0...1]
 * @return interpolation: color2 + (color2 - color1) * fraction
 */
public static Color interpolateColor(final Color color1,final Color color2,final float fraction){
  assert(Float.compare(fraction,0f) >= 0 && Float.compare(fraction,1f) <= 0);
  final float INT_TO_FLOAT_CONST=1f / 255f;
  final float RED1=color1.getRed() * INT_TO_FLOAT_CONST;
  final float GREEN1=color1.getGreen() * INT_TO_FLOAT_CONST;
  final float BLUE1=color1.getBlue() * INT_TO_FLOAT_CONST;
  final float ALPHA1=color1.getAlpha() * INT_TO_FLOAT_CONST;
  final float RED2=color2.getRed() * INT_TO_FLOAT_CONST;
  final float GREEN2=color2.getGreen() * INT_TO_FLOAT_CONST;
  final float BLUE2=color2.getBlue() * INT_TO_FLOAT_CONST;
  final float ALPHA2=color2.getAlpha() * INT_TO_FLOAT_CONST;
  final float DELTA_RED=RED2 - RED1;
  final float DELTA_GREEN=GREEN2 - GREEN1;
  final float DELTA_BLUE=BLUE2 - BLUE1;
  final float DELTA_ALPHA=ALPHA2 - ALPHA1;
  float red=RED1 + (DELTA_RED * fraction);
  float green=GREEN1 + (DELTA_GREEN * fraction);
  float blue=BLUE1 + (DELTA_BLUE * fraction);
  float alpha=ALPHA1 + (DELTA_ALPHA * fraction);
  red=red < 0f ? 0f : red;
  red=red > 1f ? 1f : red;
  green=green < 0f ? 0f : green;
  green=green > 1f ? 1f : green;
  blue=blue < 0f ? 0f : blue;
  blue=blue > 1f ? 1f : blue;
  alpha=alpha < 0f ? 0f : alpha;
  alpha=alpha > 1f ? 1f : alpha;
  return new Color(red,green,blue,alpha);
}
Program: 81537
Project: 81537
Buggy source:
/** 
 * Returns the menu of the color map manipulations
 * @return color map sub-menu
 */
private JMenu createColorMapMenu(){
  JMenu lut=new JMenu("String_Node_Str");
  ButtonGroup group=new ButtonGroup();
  String[] names={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  JRadioButtonMenuItem[] item=new JRadioButtonMenuItem[names.length];
  for (int i=0; i < names.length; i++) {
    Icon icon=createImageIcon("String_Node_Str" + names[i].toLowerCase() + "String_Node_Str",names[i] + "String_Node_Str");
    item[i]=new JRadioButtonMenuItem(names[i],icon);
    group.add(item[i]);
    lut.add(item[i]);
    item[i].addActionListener(new ActionListener(){
      @Override public void actionPerformed(      ActionEvent actionEvent){
        toggleColorMapAction(actionEvent);
      }
    }
);
    if ((heatMapModel != null) && heatMapModel.getColorGradient().getGradientName().equals(names[i]))     item[i].setSelected(true);
  }
  return lut;
}

Fixed version (ground truth):
/** 
 * Returns the menu of the color map manipulations
 * @return color map sub-menu
 */
private JMenu createColorMapMenu(){
  JMenu lut=new JMenu("String_Node_Str");
  ButtonGroup group=new ButtonGroup();
  String[] names={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  JRadioButtonMenuItem[] item=new JRadioButtonMenuItem[names.length];
  for (int i=0; i < names.length; i++) {
    Icon icon=createImageIcon("String_Node_Str" + names[i].toLowerCase() + "String_Node_Str",names[i] + "String_Node_Str");
    item[i]=new JRadioButtonMenuItem(names[i],icon);
    group.add(item[i]);
    lut.add(item[i]);
    item[i].addActionListener(new ActionListener(){
      @Override public void actionPerformed(      ActionEvent actionEvent){
        toggleColorMapAction(actionEvent);
      }
    }
);
    if ((heatMapModel != null) && heatMapModel.getColorGradient().getGradientName().equals(names[i]))     item[i].setSelected(true);
  }
  return lut;
}
Program: 81539
Project: 81539
Buggy source:
/** 
 * Add thumbnails to the   {@link GradientSlider}
 * @param scaleValue position of the thumbnail
 */
public void addThumbnail(float scaleValue){
  float pos=(scaleValue - minScaleValue) / (maxScaleValue - minScaleValue);
  for (  float exi : slider.getThumbPositions()) {
    if (pos == exi) {
      System.err.println("String_Node_Str" + pos + "String_Node_Str");
    }
  }
  slider.addThumb(pos);
}

Fixed version (ground truth):
/** 
 * Add thumbnails to the   {@link GradientSlider}
 * @param scaleValue position of the thumbnail
 */
public void addThumbnail(float scaleValue){
  float pos=(scaleValue - minScaleValue) / (maxScaleValue - minScaleValue);
  if (pos < 0 || 1 < pos) {
    System.err.println("String_Node_Str" + pos + "String_Node_Str");
    return;
  }
  for (  float exi : slider.getThumbPositions()) {
    if (pos == exi) {
      System.err.println("String_Node_Str" + pos + "String_Node_Str");
    }
  }
  slider.addThumb(pos);
}
Program: 81540
Project: 81540
Buggy source:
/** 
 * Configure the gui components with the menu items.
 * @param hmm data model delivering the content
 */
public void configure(HeatMapModel hmm){
  heatMapModel=hmm;
  if (heatMapModel.getScreen() == null) {
    System.err.println("String_Node_Str");
    return;
  }
  List<Plate> subScreen=Arrays.asList(hmm.getScreen().get(0));
  List<String> annotations=heatMapModel.getAnnotations();
  if (heatMapModel.hasKnimeColorModel())   annotations.add(0,heatMapModel.getKnimeColorAttributeTitle());
  annotations.add(0,"String_Node_Str");
  overlaySelector.configure(annotations,heatMapModel,AttributeType.OVERLAY_ANNOTATION);
  List<String> readouts=heatMapModel.getReadouts();
  readoutSelector.configure(readouts,heatMapModel,AttributeType.READOUT);
  if ((parent == null) || (parent instanceof ScreenViewer)) {
    Collection<PlateAttribute> plateAttributes=heatMapModel.getPlateAttributes();
    DefaultComboBoxModel model=new DefaultComboBoxModel(PlateUtils.getPlateAttributeTitles(plateAttributes));
    filterSelector.setModel(model);
  }
}

Fixed version (ground truth):
/** 
 * Configure the gui components with the menu items.
 * @param hmm data model delivering the content
 */
public void configure(HeatMapModel hmm){
  heatMapModel=hmm;
  if (heatMapModel.getScreen() == null) {
    System.err.println("String_Node_Str");
    return;
  }
  List<Plate> subScreen=Arrays.asList(hmm.getScreen().get(0));
  List<String> annotations=new ArrayList<String>();
  annotations.addAll(heatMapModel.getAnnotations());
  if (heatMapModel.hasKnimeColorModel())   annotations.add(0,heatMapModel.getKnimeColorAttributeTitle());
  annotations.add(0,"String_Node_Str");
  overlaySelector.configure(annotations,heatMapModel,AttributeType.OVERLAY_ANNOTATION);
  List<String> readouts=heatMapModel.getReadouts();
  readoutSelector.configure(readouts,heatMapModel,AttributeType.READOUT);
  if ((parent == null) || (parent instanceof ScreenViewer)) {
    Collection<PlateAttribute> plateAttributes=heatMapModel.getPlateAttributes();
    DefaultComboBoxModel model=new DefaultComboBoxModel(PlateUtils.getPlateAttributeTitles(plateAttributes));
    filterSelector.setModel(model);
  }
}
Program: 81541
Project: 81541
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void mousePressed(MouseEvent mouseEvent){
  if (mouseEvent.getButton() == MouseEvent.BUTTON1) {
    drag=true;
    if (!mouseEvent.isMetaDown())     heatMapModel.clearWellSelection();
    pressedHeatMap=getHeatMap(mouseEvent);
  }
 else   if (mouseEvent.getButton() == MouseEvent.BUTTON3) {
    HeatScreen heatMap=getHeatMap(mouseEvent);
    PlateViewer viewer=new PlateViewer(this,heatMap.getPlate());
    if (plateViewers.containsKey(heatMap.getPlate().getUuid())) {
      viewer=plateViewers.get(heatMap.getPlate().getUuid());
      viewer.toFront();
      viewer.repaint();
    }
 else {
      viewer.setVisible(true);
      plateViewers.put(heatMap.getPlate().getUuid(),viewer);
      heatMapModel.addChangeListener(viewer);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public void mousePressed(MouseEvent mouseEvent){
  if (mouseEvent.getButton() == MouseEvent.BUTTON1) {
    drag=true;
    if (!mouseEvent.isMetaDown())     heatMapModel.clearWellSelection();
    pressedHeatMap=getHeatMap(mouseEvent);
  }
 else   if (mouseEvent.getButton() == MouseEvent.BUTTON3) {
    HeatScreen heatMap=getHeatMap(mouseEvent);
    PlateViewer viewer=new PlateViewer(this,heatMap.getPlate());
    if (plateViewers.containsKey(heatMap.getPlate().getUuid())) {
      viewer=plateViewers.get(heatMap.getPlate().getUuid());
      viewer.setVisible(true);
      viewer.toFront();
      viewer.repaint();
    }
 else {
      viewer.setVisible(true);
      plateViewers.put(heatMap.getPlate().getUuid(),viewer);
      heatMapModel.addChangeListener(viewer);
    }
  }
}
Program: 81542
Project: 81542
Buggy source:
/** 
 * Dumps the parts of the   {@link HeatMapModel} that concern view settingsto a binary file.
 * @throws IOException
 */
protected void serializeViewConfiguration() throws IOException {
  FileOutputStream sout=new FileOutputStream(viewConfigFile);
  ObjectOutputStream oout=new ObjectOutputStream(sout);
  oout.writeObject(heatMapModel.getColorGradient());
  oout.writeObject(heatMapModel.getSortAttributesSelectionTitles());
  oout.writeObject(heatMapModel.getWellSelection());
  oout.writeObject(heatMapModel.getNumberOfTrellisRows());
  oout.writeObject(heatMapModel.getNumberOfTrellisColumns());
  oout.writeObject(heatMapModel.doHideMostFreqOverlay());
  oout.writeObject(heatMapModel.isGlobalScaling());
  oout.writeObject(heatMapModel.isFixedPlateProportion());
  oout.writeObject(heatMapModel.getReadoutRescaleStrategy());
  oout.flush();
  oout.close();
}

Fixed version (ground truth):
/** 
 * Dumps the parts of the   {@link HeatMapModel} that concern view settingsto a binary file.
 * @throws IOException
 */
protected void serializeViewConfiguration() throws IOException {
  if (viewConfigFile == null)   return;
  FileOutputStream sout=new FileOutputStream(viewConfigFile);
  ObjectOutputStream oout=new ObjectOutputStream(sout);
  oout.writeObject(heatMapModel.getColorGradient());
  oout.writeObject(heatMapModel.getSortAttributesSelectionTitles());
  oout.writeObject(heatMapModel.getWellSelection());
  oout.writeObject(heatMapModel.getNumberOfTrellisRows());
  oout.writeObject(heatMapModel.getNumberOfTrellisColumns());
  oout.writeObject(heatMapModel.doHideMostFreqOverlay());
  oout.writeObject(heatMapModel.isGlobalScaling());
  oout.writeObject(heatMapModel.isFixedPlateProportion());
  oout.writeObject(heatMapModel.getReadoutRescaleStrategy());
  oout.flush();
  oout.close();
}
Program: 81543
Project: 81543
Buggy source:
/** 
 * Action executed when selecting the sort plate function
 */
private void sortPlatesAction(){
  PlateAttributeDialog dialog=new PlateAttributeDialog(heatMapModel);
  dialog.setVisible(true);
  String[] selectedAttributes=dialog.getSelectedAttributeTitles();
  List<String> inverted=Arrays.asList(selectedAttributes);
  Collections.reverse(inverted);
  for (  String key : inverted) {
    PlateAttribute attribute=PlateUtils.getPlateAttributeByTitle(key);
    heatMapModel.sortPlates(attribute);
  }
  if (!dialog.isDescending()) {
    heatMapModel.revertScreen();
  }
  heatMapModel.fireModelChanged();
  heatMapModel.setSortAttributeSelectionByTiles(selectedAttributes);
}

Fixed version (ground truth):
/** 
 * Action executed when selecting the sort plate function
 */
private void sortPlatesAction(){
  PlateAttributeDialog dialog=new PlateAttributeDialog(heatMapModel);
  dialog.setVisible(true);
  String[] selectedAttributes=dialog.getSelectedAttributeTitles();
  for (int i=selectedAttributes.length - 1; i >= 0; i--) {
    PlateAttribute attribute=PlateUtils.getPlateAttributeByTitle(selectedAttributes[i]);
    heatMapModel.sortPlates(attribute);
  }
  if (!dialog.isDescending()) {
    heatMapModel.revertScreen();
  }
  heatMapModel.fireModelChanged();
  heatMapModel.setSortAttributeSelectionByTiles(selectedAttributes);
}
Program: 81544
Project: 81544
Buggy source:
public void setKnimeTableRowKey(RowKey knimeTableRowKey){
  this.knimeTableRowKey=knimeTableRowKey;
}

Fixed version (ground truth):
public void setKnimeTableRowKey(RowKey knimeTableRowKey){
  this.knimeTableRowKey=knimeTableRowKey.getString();
}
Program: 81545
Project: 81545
Buggy source:
public RowKey getKnimeTableRowKey(){
  return knimeTableRowKey;
}

Fixed version (ground truth):
public RowKey getKnimeTableRowKey(){
  return new RowKey(this.knimeTableRowKey);
}
Program: 81546
Project: 81546
Buggy source:
public List<String> getBasicReadoutNames(){
  Class<? extends de.mpicbg.tds.core.model.Well> clazz=this.getClass();
  if (clazz.equals(de.mpicbg.tds.core.model.Well.class))   return new ArrayList<String>();
  if (!readoutNames.containsKey(clazz)) {
    List<String> readouts=new ArrayList<String>();
    for (    Field f : clazz.getDeclaredFields()) {
      if (f.getDeclaredAnnotations().length == 0) {
        String readoutFieldName=f.getName();
        char[] chars=readoutFieldName.toCharArray();
        chars[0]=Character.toUpperCase(chars[0]);
        readouts.add(new String(chars));
      }
    }
    readoutNames.put(clazz,readouts);
  }
  return readoutNames.get(clazz);
}

Fixed version (ground truth):
public List<String> getBasicReadoutNames(){
  Class<? extends Well> clazz=this.getClass();
  if (clazz.equals(de.mpicbg.tds.core.model.Well.class))   return new ArrayList<String>();
  if (!readoutNames.containsKey(clazz)) {
    List<String> readouts=new ArrayList<String>();
    for (    Field f : clazz.getDeclaredFields()) {
      if (f.getDeclaredAnnotations().length == 0) {
        String readoutFieldName=f.getName();
        char[] chars=readoutFieldName.toCharArray();
        chars[0]=Character.toUpperCase(chars[0]);
        readouts.add(new String(chars));
      }
    }
    readoutNames.put(clazz,readouts);
  }
  return readoutNames.get(clazz);
}
Program: 81547
Project: 81547
Buggy source:
public HeatMapInputToolbar(HeatMapViewer parent){
  setPreferredSize(new Dimension(600,30));
  add(new JLabel("String_Node_Str"));
  readoutSelector=new WellAttributeComboBox();
  readoutSelector.setPreferredSize(new Dimension(250,-1));
  add(readoutSelector);
  addSeparator();
  add(new JLabel("String_Node_Str"));
  overlaySelector=new WellAttributeComboBox();
  overlaySelector.setPreferredSize(new Dimension(100,-1));
  add(overlaySelector);
  if ((parent == null) || (parent instanceof ScreenViewer)) {
    addSeparator();
    add(new JLabel("String_Node_Str"));
    filterSelector=new JComboBox();
    filterSelector.setPreferredSize(new Dimension(100,-1));
    add(filterSelector);
    JFormattedTextField filterString=new JFormattedTextField();
    filterString.setMinimumSize(new Dimension(100,20));
    filterString.setPreferredSize(new Dimension(100,20));
    filterString.setMaximumSize(new Dimension(300,20));
    filterString.addActionListener(new ActionListener(){
      @Override public void actionPerformed(      ActionEvent actionEvent){
        filterPlatesAction(actionEvent);
      }
    }
);
    add(filterString);
  }
}

Fixed version (ground truth):
public HeatMapInputToolbar(HeatMapViewer parent){
  this.parent=parent;
  setPreferredSize(new Dimension(600,30));
  add(new JLabel("String_Node_Str"));
  readoutSelector=new WellAttributeComboBox();
  readoutSelector.setPreferredSize(new Dimension(250,-1));
  add(readoutSelector);
  addSeparator();
  add(new JLabel("String_Node_Str"));
  overlaySelector=new WellAttributeComboBox();
  overlaySelector.setPreferredSize(new Dimension(100,-1));
  add(overlaySelector);
  if ((parent == null) || (parent instanceof ScreenViewer)) {
    addSeparator();
    add(new JLabel("String_Node_Str"));
    filterSelector=new JComboBox();
    filterSelector.setPreferredSize(new Dimension(100,-1));
    add(filterSelector);
    JFormattedTextField filterString=new JFormattedTextField();
    filterString.setMinimumSize(new Dimension(100,20));
    filterString.setPreferredSize(new Dimension(100,20));
    filterString.setMaximumSize(new Dimension(300,20));
    filterString.addActionListener(new ActionListener(){
      @Override public void actionPerformed(      ActionEvent actionEvent){
        filterPlatesAction(actionEvent);
      }
    }
);
    add(filterString);
  }
}
Program: 81548
Project: 81548
Buggy source:
protected void configure(HeatMapModel2 hmm){
  heatMapModel=hmm;
  if (heatMapModel.getScreen() == null) {
    System.err.println("String_Node_Str");
    return;
  }
  java.util.List<Plate> subScreen=Arrays.asList(hmm.getScreen().get(0));
  java.util.List<String> annotations=TdsUtils.flattenAnnotationTypes(subScreen);
  annotations.add(0,"String_Node_Str");
  overlaySelector.configure(annotations,heatMapModel,AttributeType.OVERLAY_ANNOTATION);
  Collection<PlateComparators.PlateAttribute> plateAttributes=heatMapModel.getPlateAttributes();
  DefaultComboBoxModel model=new DefaultComboBoxModel(PlateComparators.getPlateAttributeTitles(plateAttributes));
  filterSelector.setModel(model);
  java.util.List<String> readouts=TdsUtils.flattenReadoutNames(subScreen);
  readoutSelector.configure(readouts,heatMapModel,AttributeType.READOUT);
}

Fixed version (ground truth):
protected void configure(HeatMapModel2 hmm){
  heatMapModel=hmm;
  if (heatMapModel.getScreen() == null) {
    System.err.println("String_Node_Str");
    return;
  }
  List<Plate> subScreen=Arrays.asList(hmm.getScreen().get(0));
  List<String> annotations=TdsUtils.flattenAnnotationTypes(subScreen);
  annotations.add(0,"String_Node_Str");
  overlaySelector.configure(annotations,heatMapModel,AttributeType.OVERLAY_ANNOTATION);
  List<String> readouts=TdsUtils.flattenReadoutNames(subScreen);
  readoutSelector.configure(readouts,heatMapModel,AttributeType.READOUT);
  if ((parent == null) || (parent instanceof ScreenViewer)) {
    Collection<PlateComparators.PlateAttribute> plateAttributes=heatMapModel.getPlateAttributes();
    DefaultComboBoxModel model=new DefaultComboBoxModel(PlateComparators.getPlateAttributeTitles(plateAttributes));
    filterSelector.setModel(model);
  }
}
Program: 81549
Project: 81549
Buggy source:
public PlateViewer(Plate plate,HeatMapModel2 heatMapModel){
  this(heatMapModel);
  setTitle(plate.getBarcode());
  heatMapModel.setScreen(Arrays.asList(plate));
  heatMap=new HeatPlate(plate,heatMapModel);
  heatMapContainer.add(heatMap);
  Random posJitter=new Random();
  this.setBounds(200 + posJitter.nextInt(100),200 + posJitter.nextInt(100),630,500);
  setVisible(true);
}

Fixed version (ground truth):
public PlateViewer(Plate plate,HeatMapModel2 heatMapModel){
  this(heatMapModel);
  List<Plate> pseudoScreen=new ArrayList<Plate>();
  pseudoScreen.add(plate);
  this.heatMapModel.setScreen(pseudoScreen);
  setTitle(plate.getBarcode());
  toolbar.configure(heatMapModel);
  colorbar.configure(heatMapModel);
  heatMapModel.setScreen(Arrays.asList(plate));
  heatMap=new HeatPlate(plate,heatMapModel);
  heatMapContainer.add(heatMap);
  Random posJitter=new Random();
  this.setBounds(200 + posJitter.nextInt(100),200 + posJitter.nextInt(100),630,500);
  setVisible(true);
}
Program: 81550
Project: 81550
Buggy source:
public boolean isWellSelected(Well well){
  if (selection.isEmpty())   return false;
  for (  Well w : selection) {
    if (well.getPlateColumn().equals(w.getPlateColumn()) && well.getPlateRow().equals(w.getPlateRow()) && well.getPlate().getBarcode().equals(w.getPlate().getBarcode()))     return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean isWellSelected(Well well){
  if ((selection == null) || selection.isEmpty())   return false;
  for (  Well w : selection) {
    if (well.getPlateColumn().equals(w.getPlateColumn()) && well.getPlateRow().equals(w.getPlateRow()) && well.getPlate().getBarcode().equals(w.getPlate().getBarcode()))     return true;
  }
  return false;
}
Program: 81552
Project: 81552
Buggy source:
public static void main(String[] args){
  ColorGradientDialog dialog=new ColorGradientDialog("String_Node_Str");
  dialog.setVisible(true);
  System.exit(0);
}

Fixed version (ground truth):
public static void main(String[] args){
  ColorGradientDialog dialog=new ColorGradientDialog(new HeatMapModel2());
  dialog.setVisible(true);
  System.exit(0);
}
Program: 81554
Project: 81554
Buggy source:
@Override protected void paintComponent(Graphics graphics){
}

Fixed version (ground truth):
@Override protected synchronized void paintComponent(Graphics graphics){
}
Program: 81555
Project: 81555
Buggy source:
protected void configure(HeatMapModel2 model){
  heatMapModel=model;
}

Fixed version (ground truth):
protected void configure(HeatMapModel2 model){
  heatMapModel=model;
  heatMapModel.addChangeListener(this);
}
Program: 81556
Project: 81556
Buggy source:
private void sortPlatesAction(){
  PlateAttributeDialog dialog=new PlateAttributeDialog(heatMapModel);
  dialog.setVisible(true);
  String[] selectedAttributes=dialog.getSelectedAttributeTitles();
  List<String> inverted=Arrays.asList(selectedAttributes);
  Collections.reverse(inverted);
  for (  String key : inverted) {
    PlateComparators.PlateAttribute attribute=PlateComparators.getPlateAttributeByTitle(key);
    heatMapModel.sortPlates(attribute);
  }
  if (!dialog.descending.isSelected()) {
    heatMapModel.revertScreen();
  }
  heatMapModel.fireModelChanged();
  heatMapModel.setSortAttributeSelectionByTiles(selectedAttributes);
}

Fixed version (ground truth):
private void sortPlatesAction(){
  PlateAttributeDialog dialog=new PlateAttributeDialog(heatMapModel);
  dialog.setVisible(true);
  String[] selectedAttributes=dialog.getSelectedAttributeTitles();
  List<String> inverted=Arrays.asList(selectedAttributes);
  Collections.reverse(inverted);
  for (  String key : inverted) {
    PlateComparators.PlateAttribute attribute=PlateComparators.getPlateAttributeByTitle(key);
    heatMapModel.sortPlates(attribute);
  }
  if (!dialog.isDescending()) {
    heatMapModel.revertScreen();
  }
  heatMapModel.fireModelChanged();
  heatMapModel.setSortAttributeSelectionByTiles(selectedAttributes);
}
Program: 81557
Project: 81557
Buggy source:
private void outlierHandlingAction(ActionEvent event){
  JRadioButtonMenuItem menuItem=(JRadioButtonMenuItem)event.getSource();
  if (menuItem.isSelected()) {
    if (menuItem.getText().equals("String_Node_Str")) {
      heatMapModel.setReadoutRescaleStrategy(new GlobalMinMaxStrategy());
    }
 else     if (menuItem.getText().equals("String_Node_Str")) {
      heatMapModel.setReadoutRescaleStrategy(new QuantileSmoothedStrategy());
    }
 else {
      System.err.println("String_Node_Str" + menuItem.getName() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void outlierHandlingAction(ActionEvent event){
  JRadioButtonMenuItem menuItem=(JRadioButtonMenuItem)event.getSource();
  if (menuItem.isSelected()) {
    if (menuItem.getText().equals("String_Node_Str")) {
      heatMapModel.setReadoutRescaleStrategy(new GlobalMinMaxStrategy());
    }
 else     if (menuItem.getText().equals("String_Node_Str")) {
      heatMapModel.setReadoutRescaleStrategy(new QuantileSmoothedStrategy());
    }
 else {
      System.err.println("String_Node_Str" + menuItem.getName() + "String_Node_Str");
    }
    heatMapModel.fireModelChanged();
  }
}
Program: 81558
Project: 81558
Buggy source:
public static void main(String[] args){
  JFrame frame=new JFrame();
  frame.setSize(new Dimension(200,500));
  frame.add(new HeatTrellis());
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);
}

Fixed version (ground truth):
public static void main(String[] args){
  JFrame frame=new JFrame();
  frame.setSize(new Dimension(200,500));
  frame.add(new HeatTrellis(new HeatMapModel2()));
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);
}
Program: 81559
Project: 81559
Buggy source:
public void configure(HeatMapModel2 model,List<Plate> plates){
  this.heatMapModel=model;
  heatMapModel.addChangeListener(this);
  this.setPlates(plates);
}

Fixed version (ground truth):
public void configure(HeatMapModel2 model){
  this.heatMapModel=model;
  heatMapModel.addChangeListener(this);
}
Program: 81561
Project: 81561
Buggy source:
public HeatTrellis(HeatMapModel2 model,List<Plate> plates){
  initialize();
  configure(model,plates);
  ToolTipManager.sharedInstance().setDismissDelay(7500);
  ToolTipManager.sharedInstance().setInitialDelay(500);
  addComponentListener(new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent componentEvent){
      if (getWidth() > 0) {
        repopulatePlateGrid();
      }
    }
  }
);
  heatMapsContainer.setDoubleBuffered(true);
  setMinimumSize(new Dimension(PREFERRED_WITH,PREFERRED_HEIGHT));
  setPreferredSize(new Dimension(PREFERRED_WITH,PREFERRED_HEIGHT));
  new PanelImageExporter(this,true);
}

Fixed version (ground truth):
public HeatTrellis(HeatMapModel2 model){
  this();
  configure(model);
}
Program: 81562
Project: 81562
Buggy source:
public ScreenViewer(List<Plate> plates){
  heatMapModel=new HeatMapModel2();
  initialize();
  configure(plates);
  setBounds(150,150,810,600);
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  setVisible(true);
}

Fixed version (ground truth):
public ScreenViewer(List<Plate> plates){
  heatMapModel=new HeatMapModel2();
  heatMapModel.setScreen(plates);
  initialize();
  configure();
  setBounds(150,150,810,600);
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  setVisible(true);
}
Program: 81563
Project: 81563
Buggy source:
private void configure(List<Plate> plates){
  heatTrellis.configure(heatMapModel,plates);
  toolbar.configure(heatMapModel);
  colorbar.configure(heatMapModel);
}

Fixed version (ground truth):
private void configure(){
  heatTrellis.configure(heatMapModel);
  toolbar.configure(heatMapModel);
  colorbar.configure(heatMapModel);
}
Program: 81564
Project: 81564
Buggy source:
private void initialize(){
  toolbar=new HeatMapInputToolbar();
  colorbar=new HeatMapColorToolBar();
  heatTrellis=new HeatTrellis(heatMapModel);
  add(toolbar,BorderLayout.NORTH);
  add(heatTrellis,BorderLayout.CENTER);
  add(colorbar,BorderLayout.SOUTH);
  menus=new HeatMapMenu(this);
  setTitle("String_Node_Str");
  setJMenuBar(menus);
}

Fixed version (ground truth):
private void initialize(){
  toolbar=new HeatMapInputToolbar();
  colorbar=new HeatMapColorToolBar();
  heatTrellis=new HeatTrellis();
  add(toolbar,BorderLayout.NORTH);
  add(heatTrellis,BorderLayout.CENTER);
  add(colorbar,BorderLayout.SOUTH);
  HeatMapMenu menus=new HeatMapMenu(this);
  setTitle("String_Node_Str");
  setJMenuBar(menus);
}
Program: 81565
Project: 81565
Buggy source:
public boolean isWellSelected(Well well){
  for (  Well w : selection) {
    if (well.getPlateColumn().equals(w.getPlateColumn()) && well.getPlateRow().equals(w.getPlateRow()) && well.getPlate().getBarcode().equals(w.getPlate().getBarcode()))     return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean isWellSelected(Well well){
  if (selection.isEmpty())   return false;
  for (  Well w : selection) {
    if (well.getPlateColumn().equals(w.getPlateColumn()) && well.getPlateRow().equals(w.getPlateRow()) && well.getPlate().getBarcode().equals(w.getPlate().getBarcode()))     return true;
  }
  return false;
}
Program: 81566
Project: 81566
Buggy source:
private void outlierHandlingAction(ActionEvent event){
  JRadioButtonMenuItem menuItem=(JRadioButtonMenuItem)event.getSource();
  if (!menuItem.isSelected()) {
    if (menuItem.getName().equals(OUTLIER_HANDLING_ORIGINAL)) {
      heatMapModel.setReadoutRescaleStrategy(new GlobalMinMaxStrategy());
    }
 else     if (menuItem.getName().equals(OUTLIER_HANDLING_SMOOTHED)) {
      heatMapModel.setReadoutRescaleStrategy(new QuantileSmoothedStrategy());
    }
 else {
      System.err.println("String_Node_Str" + menuItem.getName() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void outlierHandlingAction(ActionEvent event){
  JRadioButtonMenuItem menuItem=(JRadioButtonMenuItem)event.getSource();
  if (menuItem.isSelected()) {
    if (menuItem.getText().equals(OUTLIER_HANDLING_ORIGINAL)) {
      heatMapModel.setReadoutRescaleStrategy(new GlobalMinMaxStrategy());
    }
 else     if (menuItem.getText().equals(OUTLIER_HANDLING_SMOOTHED)) {
      heatMapModel.setReadoutRescaleStrategy(new QuantileSmoothedStrategy());
    }
 else {
      System.err.println("String_Node_Str" + menuItem.getName() + "String_Node_Str");
    }
  }
}
Program: 81568
Project: 81568
Buggy source:
@Override public NodeDialogPane createNodeDialogPane(){
  return new AbstractScreenTrafoDialog(){
    @Override protected void createControls(){
      addDialogComponent(new DialogComponentStringSelection(createMethodSelection(),"String_Node_Str",createMethodUsageOptions()));
      addDialogComponent(new DialogComponentNumberEdit(createFactor(),"String_Node_Str"));
      addDialogComponent(new DialogComponentColumnNameSelection(createGrouping(),"String_Node_Str",0,new Class[]{StringValue.class,IntValue.class,DateAndTimeValue.class}));
      addDialogComponent(new DialogComponentColumnFilter(createPropReadoutSelection(),0,true,new TdsNumericFilter()));
      addDialogComponent(new DialogComponentBoolean(createRule(),"String_Node_Str"));
    }
  }
;
}

Fixed version (ground truth):
@Override public NodeDialogPane createNodeDialogPane(){
  return new AbstractScreenTrafoDialog(){
    @Override protected void createControls(){
      addDialogComponent(new DialogComponentStringSelection(createMethodSelection(),"String_Node_Str",createMethodUsageOptions()));
      addDialogComponent(new DialogComponentNumberEdit(createFactor(),"String_Node_Str"));
      addDialogComponent(new DialogComponentColumnNameSelection(createGrouping(),"String_Node_Str",0,new Class[]{StringValue.class,IntValue.class}));
      addDialogComponent(new DialogComponentColumnFilter(createPropReadoutSelection(),0,true,new TdsNumericFilter()));
      addDialogComponent(new DialogComponentBoolean(createRule(),"String_Node_Str"));
    }
  }
;
}
Program: 81569
Project: 81569
Buggy source:
@Override protected void createControls(){
  addDialogComponent(new DialogComponentStringSelection(createMethodSelection(),"String_Node_Str",createMethodUsageOptions()));
  addDialogComponent(new DialogComponentNumberEdit(createFactor(),"String_Node_Str"));
  addDialogComponent(new DialogComponentColumnNameSelection(createGrouping(),"String_Node_Str",0,new Class[]{StringValue.class,IntValue.class,DateAndTimeValue.class}));
  addDialogComponent(new DialogComponentColumnFilter(createPropReadoutSelection(),0,true,new TdsNumericFilter()));
  addDialogComponent(new DialogComponentBoolean(createRule(),"String_Node_Str"));
}

Fixed version (ground truth):
@Override protected void createControls(){
  addDialogComponent(new DialogComponentStringSelection(createMethodSelection(),"String_Node_Str",createMethodUsageOptions()));
  addDialogComponent(new DialogComponentNumberEdit(createFactor(),"String_Node_Str"));
  addDialogComponent(new DialogComponentColumnNameSelection(createGrouping(),"String_Node_Str",0,new Class[]{StringValue.class,IntValue.class}));
  addDialogComponent(new DialogComponentColumnFilter(createPropReadoutSelection(),0,true,new TdsNumericFilter()));
  addDialogComponent(new DialogComponentBoolean(createRule(),"String_Node_Str"));
}
Program: 81570
Project: 81570
Buggy source:
@Override protected NodeDialogPane createNodeDialogPane(){
  return new AbstractConfigDialog(){
    @Override protected void createControls(){
      addDialogComponent(new DialogComponentNumberEdit(createLowerBoundSetting(),"String_Node_Str"));
      addDialogComponent(new DialogComponentNumberEdit(createUpperBoundSetting(),"String_Node_Str"));
      addDialogComponent(new DialogComponentButtonGroup(createFilterRuleMatchSetting(),false,"String_Node_Str",RangeFilterV2Model.FILTER_RULE_MATCHALL));
      addDialogComponent(new DialogComponentButtonGroup(createFilterRuleIncludeSetting(),false,"String_Node_Str",RangeFilterV2Model.FILTER_RULE_INCLUDE));
      addDialogComponent(new DialogComponentColumnFilter(createParameterFilterSetting(),0,true,new NumericFilter()));
    }
  }
;
}

Fixed version (ground truth):
@Override protected NodeDialogPane createNodeDialogPane(){
  return new RangeFilterV2NodeDialog();
}
Program: 81571
Project: 81571
Buggy source:
@Override public RangeFilterV2Model createNodeModel(){
  return new RangeFilterV2Model();
}

Fixed version (ground truth):
@Override public RangeFilterV2NodeModel createNodeModel(){
  return new RangeFilterV2NodeModel(1);
}
Program: 81572
Project: 81572
Buggy source:
@Override public NodeView<RangeFilterV2Model> createNodeView(int i,RangeFilterV2Model rangeFilterModel){
  return null;
}

Fixed version (ground truth):
@Override public NodeView<RangeFilterV2NodeModel> createNodeView(int i,RangeFilterV2NodeModel rangeFilterModel){
  return null;
}
Program: 81575
Project: 81575
Buggy source:
public BScore(RealMatrix matrix){
  input=matrix;
  original=matrix.copy();
  rowResiduals=new double[matrix.getRowDimension()];
  colResiduals=new double[matrix.getColumnDimension()];
  doMedianPolish(3);
  resiudalMAD=calcResidualMAD();
}

Fixed version (ground truth):
public BScore(RealMatrix matrix){
  residualMatrix=matrix;
  original=matrix.copy();
  rowEffect=new double[matrix.getRowDimension()];
  colEffect=new double[matrix.getColumnDimension()];
  medianPolish(3);
  resiudalMAD=calcResidualMAD();
}
Program: 81576
Project: 81576
Buggy source:
private double calcResidualMAD(){
  DescriptiveStatistics stats=new DescriptiveStatistics();
  for (  double colResidual : colResiduals) {
    if (colResidual == Double.NaN)     continue;
    stats.addValue(colResidual);
  }
  for (  double rowResidual : rowResiduals) {
    if (rowResidual == Double.NaN)     continue;
    stats.addValue(rowResidual);
  }
  stats.setVarianceImpl(new MadStatistic(stats.getPercentile(50)));
  return stats.getStandardDeviation();
}

Fixed version (ground truth):
/** 
 * @return median absolute deviation of the residuals
 */
private double calcResidualMAD(){
  ExtDescriptiveStats stats=new ExtDescriptiveStats();
  for (int row=0; row < residualMatrix.getRowDimension(); row++) {
    double[] rowResiduals=residualMatrix.getRow(row);
    for (int i=0; i < rowResiduals.length; i++) {
      if (((Double)rowResiduals[i]).isNaN())       continue;
      stats.addValue(rowResiduals[i]);
    }
  }
  return stats.getMad();
}
Program: 81577
Project: 81577
Buggy source:
public double get(int plateRow,int plateColumn){
  double predicted=inputMean + rowResiduals[plateRow] + colResiduals[plateColumn];
  return (original.getEntry(plateRow,plateColumn) - predicted) / resiudalMAD;
}

Fixed version (ground truth):
/** 
 * @param plateRow
 * @param plateColumn
 * @return bscore value of a certain position
 */
public double get(int plateRow,int plateColumn){
  return residualMatrix.getEntry(plateRow,plateColumn) / resiudalMAD;
}
Program: 81578
Project: 81578
Buggy source:
public static void main(String[] args){
  Array2DRowRealMatrix inMatrix=new Array2DRowRealMatrix(new double[][]{{13,17,26,18,29},{42,48,57,41,59},{34,31,36,22,41}});
  BScore bScore=new BScore(inMatrix);
  System.err.println("String_Node_Str" + bScore.get(1,2));
  System.err.println("String_Node_Str" + bScore.getScoreMatrix().toString());
}

Fixed version (ground truth):
public static void main(String[] args){
  Array2DRowRealMatrix inMatrix=new Array2DRowRealMatrix(new double[][]{{99,108,105,98,100,101},{71,79,83,70,84,80},{100,104,92,102,99,98},{81,75,80,82,77,78}});
  BScore bScore=new BScore(inMatrix);
  System.err.println("String_Node_Str" + bScore.get(1,2));
  System.err.println("String_Node_Str" + bScore.residualMatrix.toString());
}
Program: 81579
Project: 81579
Buggy source:
private Double[] biased(){
  double[][] H=histogram2();
  int r=H.length;
  int c=H[1].length;
  double[] Hx=new double[r];
  double[] Hy=new double[c];
  int count=0;
  for (int i=0; i < r; i++) {
    for (int j=0; j < c; j++) {
      Hx[i]+=H[i][j];
      Hy[i]+=H[j][i];
      count+=H[i][j];
    }
  }
  Double mutualinfo=0.0;
  Double sigma=0.0;
  Double logf;
  for (int i=0; i < r; i++) {
    for (int j=0; j < c; j++) {
      logf=log(H[i][j],Hx[i],Hy[j]);
      mutualinfo+=H[i][j] * logf;
      sigma+=H[i][j] * Math.pow(logf,2);
    }
  }
  mutualinfo/=count;
  sigma=Math.sqrt((sigma / count - Math.pow(mutualinfo,2)) / (count - 1));
  mutualinfo+=Math.log(count);
  Double bias=(double)(r - 1) * (c - 1) / (2 * count);
  Double[] out=new Double[]{mutualinfo,sigma,bias};
  out=basetransform(out,logbase);
  return out;
}

Fixed version (ground truth):
private Double[] biased(){
  double[][] H=histogram2();
  int r=H.length;
  int c=H[1].length;
  double[] Hx=new double[r];
  double[] Hy=new double[c];
  int count=0;
  for (int i=0; i < r; i++) {
    for (int j=0; j < c; j++) {
      Hx[i]+=H[i][j];
      Hy[i]+=H[j][i];
      count+=H[i][j];
    }
  }
  Double mutualinfo=0.0;
  Double sigma=0.0;
  Double logf;
  for (int i=0; i < r; i++) {
    for (int j=0; j < c; j++) {
      logf=log(H[i][j],Hx[i],Hy[j]);
      mutualinfo+=H[i][j] * logf;
      sigma+=H[i][j] * Math.pow(logf,2);
    }
  }
  mutualinfo/=count;
  sigma=Math.sqrt((sigma / count - Math.pow(mutualinfo,2)) / (count - 1));
  mutualinfo+=Math.log(count);
  Double bias=(double)(r - 1) * (c - 1) / (2 * count);
  return new Double[]{mutualinfo,sigma,bias};
}
Program: 81580
Project: 81580
Buggy source:
public Double[] calculate() throws Exception {
  if (x.length < 10 || y.length < 10)   throw new RuntimeException("String_Node_Str");
  Double[] res;
  if (method.contentEquals("String_Node_Str")) {
    res=unbiased();
  }
 else   if (method.contentEquals("String_Node_Str")) {
    res=biased();
  }
 else   if (method.contentEquals("String_Node_Str")) {
    res=mms_estimate();
  }
 else {
    throw new RuntimeException("String_Node_Str" + method + "String_Node_Str");
  }
  return res;
}

Fixed version (ground truth):
public Double[] calculate() throws Exception {
  if (x.length < 10 || y.length < 10)   throw new RuntimeException("String_Node_Str");
  Double[] res;
  if (method.contentEquals("String_Node_Str")) {
    res=unbiased();
  }
 else   if (method.contentEquals("String_Node_Str")) {
    res=biased();
  }
 else   if (method.contentEquals("String_Node_Str")) {
    res=mms_estimate();
  }
 else {
    throw new RuntimeException("String_Node_Str" + method + "String_Node_Str");
  }
  res=basetransform(res,logbase);
  return res;
}
Program: 81586
Project: 81586
Buggy source:
protected RealMatrix bootstrapMatrix(RealMatrix mat){
  double[][] bootstrap;
  if (mat.getRowDimension() < mat.getColumnDimension()) {
    if (mat.getRowDimension() < 3) {
      bootstrap=null;
    }
 else {
      int Nboot;
      if (mat.getRowDimension() < 100) {
        Nboot=100;
      }
 else {
        Nboot=mat.getColumnDimension();
      }
      bootstrap=new double[Nboot][mat.getColumnDimension()];
      int R;
      RandomData rand=new RandomDataImpl();
      for (int c=0; c < mat.getColumnDimension(); ++c) {
        for (int r=0; r < bootstrap.length; ++r) {
          R=rand.nextInt(0,mat.getRowDimension() - 1);
          bootstrap[r][c]=mat.getEntry(R,c);
        }
      }
    }
  }
 else {
    bootstrap=mat.getData();
  }
  return new Array2DRowRealMatrix(bootstrap);
}

Fixed version (ground truth):
protected RealMatrix bootstrapMatrix(RealMatrix mat){
  double[][] bootstrap;
  if ((mat.getRowDimension() < mat.getColumnDimension()) && (mat.getRowDimension() >= 3)) {
    int Nboot;
    if (mat.getRowDimension() < 100) {
      Nboot=100;
    }
 else {
      Nboot=mat.getColumnDimension();
    }
    bootstrap=new double[Nboot][mat.getColumnDimension()];
    int R;
    RandomData rand=new RandomDataImpl();
    for (int c=0; c < mat.getColumnDimension(); ++c) {
      for (int r=0; r < bootstrap.length; ++r) {
        R=rand.nextInt(0,mat.getRowDimension() - 1);
        bootstrap[r][c]=mat.getEntry(R,c);
      }
    }
    return new Array2DRowRealMatrix(bootstrap);
  }
 else {
    return mat;
  }
}
Program: 81589
Project: 81589
Buggy source:
public ArrayType(TypeSymbol subtype,String dimensions) throws SalsaNotFoundException, VariableDeclarationException {
  if (dimensions.length() > 2)   this.subtype=new ArrayType(subtype,dimensions.substring(2,dimensions.length()));
 else   this.subtype=subtype;
  this.superType=SymbolTable.getTypeSymbol("String_Node_Str");
  this.module=subtype.getModule();
  this.name=subtype.getName() + "String_Node_Str";
  FieldSymbol fs=new FieldSymbol(this,"String_Node_Str",SymbolTable.getTypeSymbol("String_Node_Str"));
  fields.add(fs);
}

Fixed version (ground truth):
public ArrayType(TypeSymbol subtype,String dimensions) throws SalsaNotFoundException, VariableDeclarationException {
  if (dimensions.length() > 2) {
    this.subtype=new ArrayType(subtype,dimensions.substring(2,dimensions.length()));
  }
 else {
    this.subtype=subtype;
  }
  this.superType=SymbolTable.getTypeSymbol("String_Node_Str");
  this.module=this.subtype.getModule();
  this.name=this.subtype.getName() + "String_Node_Str";
  FieldSymbol fs=new FieldSymbol(this,"String_Node_Str",SymbolTable.getTypeSymbol("String_Node_Str"));
  fields.add(fs);
}