nus-yam/ex-repair huggingface dataset:
Program: 50496
Project: 50496
Buggy source:
/** 
 * Configure.
 * @param args command line arguments
 * @return this object for chaining
 * @throws java.io.IOException error parsing
 * @throws com.martiansoftware.jsap.JSAPException error parsing
 */
@Override public AbstractCommandLineMode configure(final String[] args) throws IOException, JSAPException {
  final JSAPResult jsapResult=parseJsapArguments(args);
  inputFile=jsapResult.getString("String_Node_Str");
  basename=AlignmentReader.getBasename(inputFile);
  outputFile=jsapResult.getString("String_Node_Str");
  return this;
}

Fixed version (ground truth):
/** 
 * Configure.
 * @param args command line arguments
 * @return this object for chaining
 * @throws IOException error parsing
 * @throws JSAPException error parsing
 */
@Override public AbstractCommandLineMode configure(final String[] args) throws IOException, JSAPException {
  final JSAPResult jsapResult=parseJsapArguments(args);
  final String inputFile=jsapResult.getString("String_Node_Str");
  basename=AlignmentReader.getBasename(inputFile);
  outputFile=jsapResult.getString("String_Node_Str");
  return this;
}
Program: 50499
Project: 50499
Buggy source:
public boolean isEntryComplete(){
  return entryComplete;
}

Fixed version (ground truth):
/** 
 * Is the entry is complete?
 * @return true if the entry is complete
 */
public boolean isEntryComplete(){
  return entryComplete;
}
Program: 50500
Project: 50500
Buggy source:
public final int[] getQueryLength(){
}

Fixed version (ground truth):
/** 
 * Returns query lengths. An array of size the number of query sequences, where each element indicates the length of the query sequence.
 */
public final int[] getQueryLength(){
}
Program: 50501
Project: 50501
Buggy source:
/** 
 * Initialize the reader to read a segment of the input. Sequences represented by a collection which starts between the input position start and end will be returned upon subsequent calls to hasNext(), next().
 * @param start  Start offset in the input file.
 * @param end    End offset in the input file.
 * @param stream Stream over the input file
 * @throws IOException If an error occurs reading the input.
 */
public AlignmentReader(final long start,final long end,final FastBufferedInputStream stream) throws IOException {
  alignmentEntryReader=new FastBufferedMessageChunksReader(start,end,stream);
}

Fixed version (ground truth):
/** 
 * Initialize the reader to read a segment of the input. Sequences represented by a collection which starts between the input position start and end will be returned upon subsequent calls to   {@link #hasNext()},   {@link #next()}.
 * @param start Start offset in the input file.
 * @param end  End offset in the input file.
 * @param stream Stream over the input file
 * @throws IOException If an error occurs reading the input.
 */
public AlignmentReader(final long start,final long end,final FastBufferedInputStream stream) throws IOException {
  super();
  alignmentEntryReader=new FastBufferedMessageChunksReader(start,end,stream);
}
Program: 50502
Project: 50502
Buggy source:
public Alignments.AlignmentEntry next(){
  return nextAlignmentEntry();
}

Fixed version (ground truth):
/** 
 * Returns the next alignment entry from the input stream.
 * @return the alignment read entry from the input stream.
 */
public Alignments.AlignmentEntry next(){
  if (!alignmentEntryReader.hasNext(collection,numberOfEntries())) {
    throw new NoSuchElementException();
  }
  return collection.getAlignmentEntries(alignmentEntryReader.incrementEntryIndex());
}
Program: 50503
Project: 50503
Buggy source:
public boolean hasNext(){
  return hasNextAligmentEntry();
}

Fixed version (ground truth):
/** 
 * Returns true if the input has more entries.
 * @return true if the input has more entries, false otherwise.
 */
public boolean hasNext(){
  final boolean hasNext=alignmentEntryReader.hasNext(collection,numberOfEntries());
  if (!hasNext) {
    collection=null;
  }
  final GZIPInputStream uncompressStream=alignmentEntryReader.getUncompressStream();
  try {
    if (uncompressStream != null) {
      collection=Alignments.AlignmentCollection.parseFrom(uncompressStream);
      if (collection.getAlignmentEntriesCount() == 0) {
        return false;
      }
    }
  }
 catch (  IOException e) {
    throw new GobyRuntimeException(e);
  }
  return hasNext;
}
Program: 50504
Project: 50504
Buggy source:
/** 
 * Return the basenames corresponding to the input filenames. Less basename than filenames may be returned (if several filenames reduce to the same baseline after removing the extension).
 */
public static String[] getBasenames(final String... inputFiles){
  final ObjectSet<String> result=new ObjectArraySet<String>();
  for (  final String filename : inputFiles) {
    result.add(getBasename(filename));
  }
  return result.toArray(new String[result.size()]);
}

Fixed version (ground truth):
/** 
 * Return the basenames corresponding to the input filenames. Less basename than filenames may be returned (if several filenames reduce to the same baseline after removing the extension).
 * @param filenames The names of the files to get the basnames for
 * @return An array of basenames
 */
public static String[] getBasenames(final String... filenames){
  final ObjectSet<String> result=new ObjectArraySet<String>();
  if (filenames != null) {
    for (    final String filename : filenames) {
      result.add(getBasename(filename));
    }
  }
  return result.toArray(new String[result.size()]);
}
Program: 50505
Project: 50505
Buggy source:
/** 
 * Return the basename corresponding to the input filename.
 */
public static String getBasename(final String inputFile){
  for (  final String ext : new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) {
    if (inputFile.endsWith(ext)) {
      return inputFile.replace(ext,"String_Node_Str");
    }
  }
  return inputFile;
}

Fixed version (ground truth):
/** 
 * Return the basename corresponding to the input alignment filename.  Note that if the filename does have the extension known to be a compact alignemt the returned value is the original filename
 * @param filename The name of the file to get the basname for
 * @return basename for the alignment file
 */
public static String getBasename(final String filename){
  for (  final String ext : FileExtensionHelper.COMPACT_ALIGNMENT_FILE_EXTS) {
    if (StringUtils.endsWith(filename,ext)) {
      return StringUtils.removeEnd(filename,ext);
    }
  }
  return filename;
}
Program: 50506
Project: 50506
Buggy source:
/** 
 * Returns true if the query matched at least k number of locations in the reference, at the specified match length or less. TODO : discuss removal of 2nd argument from this method as result does not depend on its value TODO : see comments at isQueryAmbiguous above
 * @param queryIndex The index of the query sequence.
 * @param k          The parameter k.
 * @param matchLength    The match length.
 * @return True or false.
 */
public final boolean isQueryAmbiguous(final int queryIndex,final int k,final int matchLength){
  if (matchLength < getLengthOfMatch(queryIndex)) {
    return true;
  }
 else {
    return isQueryAmbiguous(queryIndex,k);
  }
}

Fixed version (ground truth):
/** 
 * Returns true if the query matched at least k number of locations in the reference, at the specified match length or less. TODO : discuss removal of 2nd argument from this method as result does not depend on its value TODO : see comments at isQueryAmbiguous above
 * @param queryIndex The index of the query sequence.
 * @param k The parameter k.
 * @param matchLength The match length.
 * @return True or false.
 */
public final boolean isQueryAmbiguous(final int queryIndex,final int k,final int matchLength){
  if (matchLength < getLengthOfMatch(queryIndex)) {
    return true;
  }
 else {
    return isQueryAmbiguous(queryIndex,k);
  }
}
Program: 50508
Project: 50508
Buggy source:
public void delHop(final int i){
  isDirty=true;
  if (!hops.isEmpty() && (i > -1)) {
    hops.remove(i);
    calcHopsTotals();
  }
}

Fixed version (ground truth):
public void delHop(final int i){
  isDirty=true;
  if (!hops.isEmpty() && (i > -1) && (i < hops.size())) {
    hops.remove(i);
    calcHopsTotals();
  }
}
Program: 50509
Project: 50509
Buggy source:
public void delMalt(final int i){
  isDirty=true;
  if (!fermentables.isEmpty() && (i > -1)) {
    fermentables.remove(i);
    calcMaltTotals();
  }
}

Fixed version (ground truth):
public void delMalt(final int i){
  isDirty=true;
  if (!fermentables.isEmpty() && (i > -1) && (i < fermentables.size())) {
    fermentables.remove(i);
    calcMaltTotals();
  }
}
Program: 50510
Project: 50510
Buggy source:
public void delNote(final int i){
  isDirty=true;
  if (!notes.isEmpty() && (i > -1)) {
    notes.remove(i);
  }
}

Fixed version (ground truth):
public void delNote(final int i){
  isDirty=true;
  if (!notes.isEmpty() && (i > -1) && (i < notes.size())) {
    notes.remove(i);
  }
}
Program: 50511
Project: 50511
Buggy source:
public void delSalt(final int i){
  this.brewingSalts.remove(i);
}

Fixed version (ground truth):
public void delSalt(final int i){
  if (!brewingSalts.isEmpty() && (i > -1) && (i < brewingSalts.size()))   this.brewingSalts.remove(i);
}
Program: 50512
Project: 50512
Buggy source:
public void delMisc(final int i){
  isDirty=true;
  if (!misc.isEmpty() && (i > -1)) {
    misc.remove(i);
    calcMiscCost();
  }
}

Fixed version (ground truth):
public void delMisc(final int i){
  isDirty=true;
  if (!misc.isEmpty() && (i > -1) && (i < misc.size())) {
    misc.remove(i);
    calcMiscCost();
  }
}
Program: 50513
Project: 50513
Buggy source:
public FermentStep delFermentStep(final int i){
  isDirty=true;
  FermentStep temp=null;
  if (!fermentationSteps.isEmpty() && (i > -1)) {
    temp=fermentationSteps.remove(i);
    Collections.sort(fermentationSteps);
    calcFermentTotals();
  }
  return temp;
}

Fixed version (ground truth):
public FermentStep delFermentStep(final int i){
  isDirty=true;
  FermentStep temp=null;
  if (!fermentationSteps.isEmpty() && (i > -1) && (i < fermentationSteps.size())) {
    temp=fermentationSteps.remove(i);
    Collections.sort(fermentationSteps);
    calcFermentTotals();
  }
  return temp;
}
Program: 50514
Project: 50514
Buggy source:
public FindDialog(JFrame frame){
  super(frame);
  String recipeDir=opt.getProperty("String_Node_Str");
  if (recipeDir.equalsIgnoreCase("String_Node_Str")) {
    try {
      recipeDir=SBStringUtils.getAppPath("String_Node_Str");
    }
 catch (    UnsupportedEncodingException e) {
      JOptionPane.showMessageDialog(frame,"String_Node_Str");
    }
  }
  currentDir=new File(recipeDir);
  initGUI();
  dirLocationText.setText(currentDir.getAbsolutePath());
  loadRecipes(currentDir);
}

Fixed version (ground truth):
public FindDialog(JFrame frame){
  super(frame);
  String recipeDir="String_Node_Str";
  if (opt.getProperty("String_Node_Str") != null)   recipeDir=opt.getProperty("String_Node_Str");
  if (recipeDir.equalsIgnoreCase("String_Node_Str")) {
    try {
      recipeDir=SBStringUtils.getAppPath("String_Node_Str");
    }
 catch (    UnsupportedEncodingException e) {
      JOptionPane.showMessageDialog(frame,"String_Node_Str");
    }
  }
  currentDir=new File(recipeDir);
  initGUI();
  dirLocationText.setText(currentDir.getAbsolutePath());
  loadRecipes(currentDir);
}
Program: 50517
Project: 50517
Buggy source:
public void attachRecipeData(){
  cmbStyleModel.addOrInsert(myRecipe.getStyleObj());
  cmbYeastModel.addOrInsert(myRecipe.getYeastObj());
  cmbSizeUnitsModel.addOrInsert(myRecipe.getVolUnits());
  maltTableModel.setData(myRecipe);
  hopsTableModel.setData(myRecipe);
  miscPanel.setData(myRecipe);
  notesPanel.setData(myRecipe);
  stylePanel.setData(myRecipe);
  dilutionPanel.setData(myRecipe);
  mashPanel.setData(myRecipe);
  waterPanel.setData(myRecipe);
  costPanel.setData(myRecipe);
  settingsPanel.setData(myRecipe);
  fermentPanel.setData(myRecipe);
  carbPanel.setData(myRecipe);
  waterTreatmentPanel.setData(myRecipe);
  maltTable.updateUI();
  hopsTable.updateUI();
  alcMethodComboModel.setSelectedItem(myRecipe.getAlcMethod());
  ibuMethodComboModel.setSelectedItem(myRecipe.getIBUMethod());
  colourMethodCombo.setSelectedItem(myRecipe.getColourMethod());
  evapMethodCombo.setSelectedItem(myRecipe.getEvapMethod());
  Yeast y=(Yeast)cmbYeastModel.getSelectedItem();
  String st=SBStringUtils.multiLineToolTip(40,y.getDescription());
  cmbYeast.setToolTipText(st);
  Style s=(Style)cmbStyleModel.getSelectedItem();
  st=SBStringUtils.multiLineToolTip(40,s.getDescription());
  cmbStyle.setToolTipText(st);
  myRecipe.setVersion(version);
}

Fixed version (ground truth):
public void attachRecipeData(){
  cmbStyleModel.addOrInsert(myRecipe.getStyleObj());
  cmbYeastModel.addOrInsert(myRecipe.getYeastObj());
  cmbSizeUnitsModel.addOrInsert(myRecipe.getVolUnits());
  maltTableModel.setData(myRecipe);
  hopsTableModel.setData(myRecipe);
  miscPanel.setData(myRecipe);
  notesPanel.setData(myRecipe);
  stylePanel.setData(myRecipe);
  dilutionPanel.setData(myRecipe);
  mashPanel.setData(myRecipe);
  waterPanel.setData(myRecipe);
  costPanel.setData(myRecipe);
  settingsPanel.setData(myRecipe);
  fermentPanel.setData(myRecipe);
  carbPanel.setData(myRecipe);
  maltTable.updateUI();
  hopsTable.updateUI();
  alcMethodComboModel.setSelectedItem(myRecipe.getAlcMethod());
  ibuMethodComboModel.setSelectedItem(myRecipe.getIBUMethod());
  colourMethodCombo.setSelectedItem(myRecipe.getColourMethod());
  evapMethodCombo.setSelectedItem(myRecipe.getEvapMethod());
  Yeast y=(Yeast)cmbYeastModel.getSelectedItem();
  String st=SBStringUtils.multiLineToolTip(40,y.getDescription());
  cmbYeast.setToolTipText(st);
  Style s=(Style)cmbStyleModel.getSelectedItem();
  st=SBStringUtils.multiLineToolTip(40,s.getDescription());
  cmbStyle.setToolTipText(st);
  myRecipe.setVersion(version);
}
Program: 50518
Project: 50518
Buggy source:
public void stateChanged(ChangeEvent e){
  if (dontUpdate) {
    return;
  }
  Object o=e.getSource();
  if (o == jTabbedPane1) {
    JTabbedPane pane=(JTabbedPane)o;
    Component tab=pane.getSelectedComponent();
    if (tab == pnlDetails) {
      displayRecipe();
    }
 else     if (tab == stylePanel) {
      stylePanel.setStyleData();
    }
 else     if (tab == miscPanel) {
    }
 else     if (tab == notesPanel) {
    }
 else     if (tab == dilutionPanel) {
      dilutionPanel.displayDilution();
    }
 else     if (tab == mashPanel) {
      mashPanel.displayMash();
    }
 else     if (tab == waterTreatmentPanel) {
      waterTreatmentPanel.displayWaterTreatment();
    }
 else     if (tab == fermentPanel) {
      fermentPanel.displayFerment();
    }
 else     if (tab == carbPanel) {
      carbPanel.displayCarb();
    }
 else     if (tab == waterPanel) {
      waterPanel.displayWater();
    }
 else     if (tab == costPanel) {
      costPanel.displayCost();
    }
 else     if (tab == settingsPanel) {
    }
  }
 else   if (o == spnAtten) {
    myRecipe.setAttenuation(Double.parseDouble(spnAtten.getValue().toString()));
    displayRecipe();
  }
 else   if (o == spnOG) {
    myRecipe.setEstOg(Double.parseDouble(spnOG.getValue().toString()));
    displayRecipe();
  }
 else   if (o == spnFG) {
    myRecipe.setEstFg(Double.parseDouble(spnFG.getValue().toString()));
    displayRecipe();
  }
 else   if (o == spnEffic) {
    myRecipe.setEfficiency(Double.parseDouble(spnEffic.getValue().toString()));
    displayRecipe();
  }
}

Fixed version (ground truth):
public void stateChanged(ChangeEvent e){
  if (dontUpdate) {
    return;
  }
  Object o=e.getSource();
  if (o == jTabbedPane1) {
    JTabbedPane pane=(JTabbedPane)o;
    Component tab=pane.getSelectedComponent();
    if (tab == pnlDetails) {
      displayRecipe();
    }
 else     if (tab == stylePanel) {
      stylePanel.setStyleData();
    }
 else     if (tab == miscPanel) {
    }
 else     if (tab == notesPanel) {
    }
 else     if (tab == dilutionPanel) {
      dilutionPanel.displayDilution();
    }
 else     if (tab == mashPanel) {
      mashPanel.displayMash();
    }
 else     if (tab == fermentPanel) {
      fermentPanel.displayFerment();
    }
 else     if (tab == carbPanel) {
      carbPanel.displayCarb();
    }
 else     if (tab == waterPanel) {
      waterPanel.displayWater();
    }
 else     if (tab == costPanel) {
      costPanel.displayCost();
    }
 else     if (tab == settingsPanel) {
    }
  }
 else   if (o == spnAtten) {
    myRecipe.setAttenuation(Double.parseDouble(spnAtten.getValue().toString()));
    displayRecipe();
  }
 else   if (o == spnOG) {
    myRecipe.setEstOg(Double.parseDouble(spnOG.getValue().toString()));
    displayRecipe();
  }
 else   if (o == spnFG) {
    myRecipe.setEstFg(Double.parseDouble(spnFG.getValue().toString()));
    displayRecipe();
  }
 else   if (o == spnEffic) {
    myRecipe.setEfficiency(Double.parseDouble(spnEffic.getValue().toString()));
    displayRecipe();
  }
}
Program: 50520
Project: 50520
Buggy source:
public void setCost(String c){
  if (c.substring(0,1).equals("String_Node_Str")) {
    c=c.substring(1,c.length());
  }
  try {
    costPerU=Double.parseDouble(c);
  }
 catch (  NumberFormatException m) {
    Debug.print("String_Node_Str" + c);
  }
}

Fixed version (ground truth):
public void setCost(String c){
  if (c.substring(0,1).equals("String_Node_Str")) {
    c=c.substring(1,c.length());
  }
  try {
    NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
    Number number=format.parse(c.trim());
    costPerU=number.doubleValue();
  }
 catch (  NumberFormatException m) {
    Debug.print("String_Node_Str" + c);
  }
catch (  ParseException e) {
    Debug.print("String_Node_Str" + c);
  }
}
Program: 50521
Project: 50521
Buggy source:
/** 
 * Handles a string of the form "d u", where d is a double amount, and u is a string of units.  For importing the quantity attribute from QBrew xml.
 * @param a
 */
public void setAmountAndUnits(String a){
  int i=a.indexOf("String_Node_Str");
  String d=a.substring(0,i);
  String u=a.substring(i);
  Double dAmount=0.0;
  try {
    dAmount=Double.parseDouble(d.trim());
  }
 catch (  NumberFormatException m) {
    Debug.print("String_Node_Str" + d + "String_Node_Str");
    return;
  }
  amount.setAmount(dAmount);
  amount.setUnits(u.trim());
}

Fixed version (ground truth):
/** 
 * Handles a string of the form "d u", where d is a double amount, and u is a string of units.  For importing the quantity attribute from QBrew xml.
 * @param a
 */
public void setAmountAndUnits(String a){
  int i=a.indexOf("String_Node_Str");
  String d=a.substring(0,i);
  String u=a.substring(i);
  Double dAmount=0.0;
  try {
    NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
    Number number=format.parse(d.trim());
    dAmount=number.doubleValue();
  }
 catch (  NumberFormatException m) {
    Debug.print("String_Node_Str" + d + "String_Node_Str");
    return;
  }
catch (  ParseException e) {
    Debug.print("String_Node_Str" + d + "String_Node_Str");
    return;
  }
  amount.setAmount(dAmount);
  amount.setUnits(u.trim());
}
Program: 50522
Project: 50522
Buggy source:
public int getIProperty(String key){
  if (props.getProperty(key) != null) {
    try {
      return Integer.parseInt(props.getProperty(key));
    }
 catch (    NumberFormatException m) {
      Debug.print(key + "String_Node_Str" + props.getProperty(key));
    }
  }
 else {
    Debug.print("String_Node_Str" + key);
  }
  return 0;
}

Fixed version (ground truth):
public int getIProperty(String key){
  if (props.getProperty(key) != null) {
    try {
      NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
      Number number=format.parse(props.getProperty(key));
      return number.intValue();
    }
 catch (    NumberFormatException m) {
      Debug.print(key + "String_Node_Str" + props.getProperty(key));
    }
catch (    ParseException e) {
      Debug.print(key + "String_Node_Str" + props.getProperty(key));
    }
  }
 else {
    Debug.print("String_Node_Str" + key);
  }
  return 0;
}
Program: 50523
Project: 50523
Buggy source:
public double getDProperty(String key){
  try {
    return Double.parseDouble(props.getProperty(key));
  }
 catch (  NumberFormatException m) {
    Debug.print("String_Node_Str" + key + "String_Node_Str"+ "String_Node_Str"+ props.getProperty(key));
  }
  return 0.0;
}

Fixed version (ground truth):
public double getDProperty(String key){
  try {
    NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
    Number number=format.parse(props.getProperty(key));
    return number.doubleValue();
  }
 catch (  NumberFormatException m) {
    Debug.print("String_Node_Str" + key + "String_Node_Str"+ "String_Node_Str"+ props.getProperty(key));
  }
catch (  ParseException e) {
    Debug.print("String_Node_Str" + key + "String_Node_Str"+ "String_Node_Str"+ props.getProperty(key));
  }
  return 0.0;
}
Program: 50524
Project: 50524
Buggy source:
public float getFProperty(String key){
  try {
    return Float.parseFloat(props.getProperty(key));
  }
 catch (  NumberFormatException m) {
    Debug.print("String_Node_Str" + key + "String_Node_Str"+ "String_Node_Str"+ props.getProperty(key));
  }
  return (float)0.0;
}

Fixed version (ground truth):
public float getFProperty(String key){
  try {
    NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
    Number number=format.parse(props.getProperty(key));
    return number.floatValue();
  }
 catch (  NumberFormatException m) {
    Debug.print("String_Node_Str" + key + "String_Node_Str"+ "String_Node_Str"+ props.getProperty(key));
  }
catch (  ParseException e) {
    Debug.print("String_Node_Str" + key + "String_Node_Str"+ "String_Node_Str"+ props.getProperty(key));
  }
  return (float)0.0;
}
Program: 50526
Project: 50526
Buggy source:
public void actionPerformed(ActionEvent e){
  Object o=e.getSource();
  if (o == yeastTxt) {
    try {
      myRecipe.getYeastObj().setCost(SBStringUtils.myNF.parse(yeastTxt.getText()).doubleValue());
    }
 catch (    ParseException e1) {
      e1.printStackTrace();
    }
    displayCost();
  }
  if (o == otherTxt) {
    try {
      myRecipe.setOtherCost(SBStringUtils.myNF.parse(otherTxt.getText()).doubleValue());
    }
 catch (    ParseException e1) {
      e1.printStackTrace();
    }
    displayCost();
  }
  if (o == bottleSizeTxt) {
    try {
      myRecipe.setBottleSize(Double.parseDouble(bottleSizeTxt.getText()));
    }
 catch (    NumberFormatException m) {
      Debug.print("String_Node_Str");
      bottleSizeTxt.setText(Double.toString(myRecipe.getBottleSize()));
    }
    displayCost();
  }
  if (o == bottleSizeUCmb) {
    myRecipe.setBottleU(bottleSizeUCmbModel.getSelectedItem().toString());
    displayCost();
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  Object o=e.getSource();
  if (o == yeastTxt) {
    try {
      myRecipe.getYeastObj().setCost(SBStringUtils.myNF.parse(yeastTxt.getText()).doubleValue());
    }
 catch (    ParseException e1) {
      e1.printStackTrace();
    }
    displayCost();
  }
  if (o == otherTxt) {
    try {
      myRecipe.setOtherCost(SBStringUtils.myNF.parse(otherTxt.getText()).doubleValue());
    }
 catch (    ParseException e1) {
      e1.printStackTrace();
    }
    displayCost();
  }
  if (o == bottleSizeTxt) {
    try {
      NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
      Number number=format.parse(bottleSizeTxt.getText().trim());
      myRecipe.setBottleSize(number.doubleValue());
    }
 catch (    NumberFormatException m) {
      Debug.print("String_Node_Str");
      bottleSizeTxt.setText(Double.toString(myRecipe.getBottleSize()));
    }
catch (    ParseException m) {
      Debug.print("String_Node_Str");
      bottleSizeTxt.setText(Double.toString(myRecipe.getBottleSize()));
    }
    displayCost();
  }
  if (o == bottleSizeUCmb) {
    myRecipe.setBottleU(bottleSizeUCmbModel.getSelectedItem().toString());
    displayCost();
  }
}
Program: 50527
Project: 50527
Buggy source:
public void stateChanged(ChangeEvent e){
  if (dontUpdate == true) {
    return;
  }
  Object o=e.getSource();
  if (myRecipe != null) {
    if (o == postBoilText) {
      try {
        myRecipe.setPostBoil(new Quantity(myRecipe.getVolUnits(),Double.parseDouble(postBoilText.getValue().toString())));
      }
 catch (      NumberFormatException m) {
        Debug.print("String_Node_Str");
        postBoilText.setValue(myRecipe.getPostBoilVol().toString());
      }
      displayDilution();
    }
  }
}

Fixed version (ground truth):
public void stateChanged(ChangeEvent e){
  if (dontUpdate == true) {
    return;
  }
  Object o=e.getSource();
  if (myRecipe != null) {
    if (o == postBoilText) {
      try {
        NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
        Number number=format.parse(postBoilText.toString().trim());
        myRecipe.setPostBoil(new Quantity(myRecipe.getVolUnits(),number.doubleValue()));
      }
 catch (      NumberFormatException m) {
        Debug.print("String_Node_Str");
        postBoilText.setValue(myRecipe.getPostBoilVol().toString());
      }
catch (      ParseException m) {
        Debug.print("String_Node_Str");
        postBoilText.setValue(myRecipe.getPostBoilVol().toString());
      }
      displayDilution();
    }
  }
}
Program: 50528
Project: 50528
Buggy source:
public void setValueAt(Object value,int row,int col){
  try {
switch (col) {
case 0:
      data.setFermentStepType(row,value.toString());
case 1:
    try {
      data.setFermentStepTime(row,Integer.parseInt(value.toString()));
    }
 catch (    NumberFormatException m) {
      m.printStackTrace();
    }
  break;
case 2:
try {
  data.setFermentStepTemp(row,Double.parseDouble(value.toString()));
}
 catch (NumberFormatException m) {
  m.printStackTrace();
}
break;
case 3:
data.setFermentStepTempU(row,value.toString());
break;
}
}
 catch (Exception e) {
}
;
data.calcFermentTotals();
fireTableCellUpdated(row,col);
fireTableDataChanged();
}

Fixed version (ground truth):
public void setValueAt(Object value,int row,int col){
  try {
switch (col) {
case 0:
      data.setFermentStepType(row,value.toString());
case 1:
    try {
      NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
      Number number=format.parse(value.toString().trim());
      data.setFermentStepTime(row,number.intValue());
    }
 catch (    NumberFormatException m) {
      m.printStackTrace();
    }
  break;
case 2:
try {
  NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
  Number number=format.parse(value.toString().trim());
  data.setFermentStepTemp(row,number.doubleValue());
}
 catch (NumberFormatException m) {
  m.printStackTrace();
}
break;
case 3:
data.setFermentStepTempU(row,value.toString());
break;
}
}
 catch (Exception e) {
}
;
data.calcFermentTotals();
fireTableCellUpdated(row,col);
fireTableDataChanged();
}
Program: 50529
Project: 50529
Buggy source:
public void setValueAt(Object value,int row,int col){
  try {
switch (col) {
case 0:
      data.setHopName(row,value.toString());
    if (value instanceof Hop) {
      Hop h=(Hop)value;
      data.setHopAlpha(row,h.getAlpha());
    }
  break;
case 1:
data.setHopType(row,value.toString());
break;
case 2:
try {
data.setHopAlpha(row,Double.parseDouble(value.toString()));
}
 catch (NumberFormatException m) {
Debug.print("String_Node_Str" + value.toString() + "String_Node_Str");
}
break;
case 3:
try {
data.setHopAmount(row,Double.parseDouble(value.toString()));
}
 catch (NumberFormatException m) {
Debug.print("String_Node_Str" + value.toString() + "String_Node_Str");
}
break;
case 4:
break;
case 5:
data.setHopAdd(row,value.toString());
break;
case 6:
try {
data.setHopMinutes(row,(int)Double.parseDouble(value.toString()));
}
 catch (NumberFormatException m) {
Debug.print("String_Node_Str" + value.toString() + "String_Node_Str");
}
break;
case 7:
break;
case 8:
data.setHopCost(row,value.toString());
break;
}
}
 catch (Exception e) {
}
;
app.myRecipe.calcHopsTotals();
fireTableCellUpdated(row,col);
fireTableDataChanged();
app.displayRecipe();
}

Fixed version (ground truth):
public void setValueAt(Object value,int row,int col){
  try {
switch (col) {
case 0:
      data.setHopName(row,value.toString());
    if (value instanceof Hop) {
      Hop h=(Hop)value;
      data.setHopAlpha(row,h.getAlpha());
    }
  break;
case 1:
data.setHopType(row,value.toString());
break;
case 2:
try {
NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
Number number=format.parse(value.toString().trim());
data.setHopAlpha(row,number.doubleValue());
}
 catch (NumberFormatException m) {
Debug.print("String_Node_Str" + value.toString() + "String_Node_Str");
}
break;
case 3:
try {
NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
Number number=format.parse(value.toString().trim());
data.setHopAmount(row,number.doubleValue());
}
 catch (NumberFormatException m) {
Debug.print("String_Node_Str" + value.toString() + "String_Node_Str");
}
break;
case 4:
break;
case 5:
data.setHopAdd(row,value.toString());
break;
case 6:
try {
NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
Number number=format.parse(value.toString().trim());
data.setHopMinutes(row,number.intValue());
}
 catch (NumberFormatException m) {
Debug.print("String_Node_Str" + value.toString() + "String_Node_Str");
}
break;
case 7:
break;
case 8:
data.setHopCost(row,value.toString());
break;
}
}
 catch (Exception e) {
}
;
app.myRecipe.calcHopsTotals();
fireTableCellUpdated(row,col);
fireTableDataChanged();
app.displayRecipe();
}
Program: 50530
Project: 50530
Buggy source:
public void setValueAt(Object value,int row,int col){
  Debug.print("String_Node_Str" + row + "String_Node_Str"+ col);
  try {
switch (col) {
case 0:
      data.setMaltSteep(row,new Boolean(value.toString()).booleanValue());
    break;
case 1:
  data.setMaltMashed(row,new Boolean(value.toString()).booleanValue());
break;
case 2:
data.setMaltName(row,value.toString());
if (value instanceof Fermentable) {
Fermentable m=(Fermentable)value;
data.setMaltPppg(row,m.getPppg());
data.setMaltLov(row,m.getLov());
data.setMaltSteep(row,m.getSteep());
data.setMaltMashed(row,m.getMashed());
}
break;
case 3:
try {
data.setMaltAmount(row,Double.parseDouble(value.toString()));
}
 catch (NumberFormatException m) {
Debug.print("String_Node_Str" + value.toString() + "String_Node_Str");
}
break;
case 4:
break;
case 5:
try {
data.setMaltPppg(row,Double.parseDouble(value.toString()));
}
 catch (NumberFormatException m) {
Debug.print("String_Node_Str" + value.toString() + "String_Node_Str");
}
break;
case 6:
try {
data.setMaltLov(row,Double.parseDouble(value.toString()));
}
 catch (NumberFormatException m) {
Debug.print("String_Node_Str" + value.toString() + "String_Node_Str");
}
break;
case 7:
data.setMaltCost(row,value.toString());
break;
case 8:
break;
}
}
 catch (Exception e) {
}
;
app.myRecipe.calcMaltTotals();
fireTableCellUpdated(row,col);
fireTableDataChanged();
app.displayRecipe();
}

Fixed version (ground truth):
public void setValueAt(Object value,int row,int col){
  Debug.print("String_Node_Str" + row + "String_Node_Str"+ col);
  try {
switch (col) {
case 0:
      data.setMaltSteep(row,new Boolean(value.toString()).booleanValue());
    break;
case 1:
  data.setMaltMashed(row,new Boolean(value.toString()).booleanValue());
break;
case 2:
data.setMaltName(row,value.toString());
if (value instanceof Fermentable) {
Fermentable m=(Fermentable)value;
data.setMaltPppg(row,m.getPppg());
data.setMaltLov(row,m.getLov());
data.setMaltSteep(row,m.getSteep());
data.setMaltMashed(row,m.getMashed());
}
break;
case 3:
try {
NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
Number number=format.parse(value.toString().trim());
data.setMaltAmount(row,number.doubleValue());
}
 catch (NumberFormatException m) {
Debug.print("String_Node_Str" + value.toString() + "String_Node_Str");
}
break;
case 4:
break;
case 5:
try {
NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
Number number=format.parse(value.toString().trim());
data.setMaltPppg(row,number.doubleValue());
}
 catch (NumberFormatException m) {
Debug.print("String_Node_Str" + value.toString() + "String_Node_Str");
}
break;
case 6:
try {
NumberFormat format=NumberFormat.getInstance(Locale.getDefault());
Number number=format.parse(value.toString().trim());
data.setMaltLov(row,number.doubleValue());
}
 catch (NumberFormatException m) {
Debug.print("String_Node_Str" + value.toString() + "String_Node_Str");
}
break;
case 7:
data.setMaltCost(row,value.toString());
break;
case 8:
break;
}
}
 catch (Exception e) {
}
;
app.myRecipe.calcMaltTotals();
fireTableCellUpdated(row,col);
fireTableDataChanged();
app.displayRecipe();
}
Program: 50535
Project: 50535
Buggy source:
public MashPanel(Recipe r){
  super();
  initGUI();
  myRecipe=r;
  if (myRecipe != null) {
    mashModel.setData(myRecipe.getMash());
  }
  displayMash();
  tblMash.updateUI();
  String[] names=md.getNames();
  for (int i=0; i < names.length; i++) {
    JMenuItem m=new JMenuItem(names[i]);
    m.addActionListener(this);
    mashMenu.add(m);
  }
}

Fixed version (ground truth):
public MashPanel(Recipe r){
  super();
  myRecipe=r;
  mashModel=new MashTableModel();
  if (myRecipe != null) {
    mashModel.setData(myRecipe.getMash());
  }
  initGUI();
  displayMash();
  tblMash.updateUI();
  String[] names=md.getNames();
  for (int i=0; i < names.length; i++) {
    JMenuItem m=new JMenuItem(names[i]);
    m.addActionListener(this);
    mashMenu.add(m);
  }
}
Program: 50536
Project: 50536
Buggy source:
public void addOrInsert(Object o){
  int i=0;
  boolean found=false;
  boolean empty=false;
  while (i < list.size() && !found && !empty) {
    if (o.getClass().getName().toString().equals("String_Node_Str")) {
      Yeast y=(Yeast)list.get(i);
      Yeast y2=(Yeast)o;
      found=y.getName().equalsIgnoreCase(y2.getName());
      empty=y.getName().equals("String_Node_Str");
    }
 else     if (o.getClass().getName().toString().equals("String_Node_Str")) {
      Fermentable f=(Fermentable)list.get(i);
      Fermentable f2=(Fermentable)o;
      found=f.getName().equalsIgnoreCase(f2.getName());
      empty=f.getName().equals("String_Node_Str");
    }
 else     if (o.getClass().getName().toString().equals("String_Node_Str")) {
      Hop h=(Hop)list.get(i);
      Hop h2=(Hop)o;
      found=h.getName().equalsIgnoreCase(h2.getName());
      empty=h.getName().equals("String_Node_Str");
    }
 else     if (o.getClass().getName().toString().equals("String_Node_Str")) {
      Style s=(Style)list.get(i);
      Style s2=(Style)o;
      found=s.getName().equalsIgnoreCase(s2.getName());
      empty=s.getName().equals("String_Node_Str");
      Debug.print("String_Node_Str" + s.name + "String_Node_Str"+ s2.name);
    }
 else     if (o.getClass().getName().toString().equals("String_Node_Str")) {
      String q=(String)list.get(i);
      String q2=(String)o;
      found=q.equalsIgnoreCase(q2);
      empty=q.equals("String_Node_Str");
    }
    i++;
  }
  if (!found) {
    list.add(o);
    selected=o;
  }
 else {
    selected=list.get(i - 1);
  }
}

Fixed version (ground truth):
public void addOrInsert(Object o){
  int i=0;
  boolean found=false;
  boolean empty=false;
  while (i < list.size() && !found && !empty) {
    if (o.getClass().getName().toString().equals("String_Node_Str")) {
      Yeast y=(Yeast)list.get(i);
      Yeast y2=(Yeast)o;
      found=y.getName().equalsIgnoreCase(y2.getName());
    }
 else     if (o.getClass().getName().toString().equals("String_Node_Str")) {
      Fermentable f=(Fermentable)list.get(i);
      Fermentable f2=(Fermentable)o;
      found=f.getName().equalsIgnoreCase(f2.getName());
    }
 else     if (o.getClass().getName().toString().equals("String_Node_Str")) {
      Hop h=(Hop)list.get(i);
      Hop h2=(Hop)o;
      found=h.getName().equalsIgnoreCase(h2.getName());
    }
 else     if (o.getClass().getName().toString().equals("String_Node_Str")) {
      Style s=(Style)list.get(i);
      Style s2=(Style)o;
      found=s.getName().equalsIgnoreCase(s2.getName());
    }
 else     if (o.getClass().getName().toString().equals("String_Node_Str")) {
      String q=(String)list.get(i);
      String q2=(String)o;
      found=q.equalsIgnoreCase(q2);
      empty=q.equals("String_Node_Str");
    }
    i++;
  }
  if (!found) {
    list.add(o);
    selected=o;
  }
 else {
    selected=list.get(i - 1);
  }
}
Program: 50537
Project: 50537
Buggy source:
double CalcRager(double amount,double size,double sg,double time,double AA){
  double ibu, utilization, ga;
  double x=(time - 31.32) / 18.27;
  double tanhx=(Math.exp(x) - Math.exp(-x)) / (Math.exp(x) + Math.exp(-x));
  utilization=18.11 + (13.86 * tanhx / 18.27);
  ga=sg < 1.050 ? 0.0 : 0.2;
  ibu=amount * (utilization / 100) * (AA / 100.0)* 7490;
  ibu/=size * (1 + ga);
  return ibu;
}

Fixed version (ground truth):
double CalcRager(double amount,double size,double sg,double time,double AA){
  double ibu, utilization, ga;
  double x=(time - 31.32) / 18.27;
  double tanhx=(Math.exp(x) - Math.exp(-x)) / (Math.exp(x) + Math.exp(-x));
  utilization=18.11 + (13.86 * tanhx / 18.27);
  ga=sg < 1.050 ? 0.0 : ((sg - 1.050) / 0.2);
  ibu=amount * (utilization / 100) * (AA / 100.0)* 7490;
  ibu/=size * (1 + ga);
  return ibu;
}
Program: 50538
Project: 50538
Buggy source:
public void setDiluted(Boolean b){
  diluted=b;
}

Fixed version (ground truth):
public void setDiluted(boolean b){
  diluted=b;
}
Program: 50539
Project: 50539
Buggy source:
public String toXML(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str" + getName() + "String_Node_Str");
  sb.append("String_Node_Str" + getAmountAs(getUnits()) + "String_Node_Str");
  sb.append("String_Node_Str" + getUnitsAbrv() + "String_Node_Str");
  sb.append("String_Node_Str" + pppg + "String_Node_Str");
  sb.append("String_Node_Str" + lov + "String_Node_Str");
  sb.append("String_Node_Str" + mashed + "String_Node_Str");
  sb.append("String_Node_Str" + steeped + "String_Node_Str");
  sb.append("String_Node_Str" + getCostPerU() + "String_Node_Str");
  sb.append("String_Node_Str" + getDescription() + "String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public String toXML(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str" + getName() + "String_Node_Str");
  sb.append("String_Node_Str" + getAmountAs(getUnits()) + "String_Node_Str");
  sb.append("String_Node_Str" + getUnitsAbrv() + "String_Node_Str");
  sb.append("String_Node_Str" + pppg + "String_Node_Str");
  sb.append("String_Node_Str" + lov + "String_Node_Str");
  sb.append("String_Node_Str" + mashed + "String_Node_Str");
  sb.append("String_Node_Str" + steeped + "String_Node_Str");
  sb.append("String_Node_Str" + getCostPerU() + "String_Node_Str");
  sb.append("String_Node_Str" + SBStringUtils.subEntities(getDescription()) + "String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 50540
Project: 50540
Buggy source:
public String toXML(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str" + getName() + "String_Node_Str");
  sb.append("String_Node_Str" + getAmountAs(getUnits()) + "String_Node_Str");
  sb.append("String_Node_Str" + getMinutes() + "String_Node_Str");
  sb.append("String_Node_Str" + getUnitsAbrv() + "String_Node_Str");
  sb.append("String_Node_Str" + getType() + "String_Node_Str");
  sb.append("String_Node_Str" + alpha + "String_Node_Str");
  sb.append("String_Node_Str" + getCostPerU() + "String_Node_Str");
  sb.append("String_Node_Str" + add + "String_Node_Str");
  sb.append("String_Node_Str" + getDescription() + "String_Node_Str");
  sb.append("String_Node_Str" + getDate() + "String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public String toXML(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str" + getName() + "String_Node_Str");
  sb.append("String_Node_Str" + getAmountAs(getUnits()) + "String_Node_Str");
  sb.append("String_Node_Str" + getMinutes() + "String_Node_Str");
  sb.append("String_Node_Str" + getUnitsAbrv() + "String_Node_Str");
  sb.append("String_Node_Str" + getType() + "String_Node_Str");
  sb.append("String_Node_Str" + alpha + "String_Node_Str");
  sb.append("String_Node_Str" + getCostPerU() + "String_Node_Str");
  sb.append("String_Node_Str" + add + "String_Node_Str");
  sb.append("String_Node_Str" + SBStringUtils.subEntities(getDescription()) + "String_Node_Str");
  sb.append("String_Node_Str" + getDate() + "String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 50541
Project: 50541
Buggy source:
public String toXML(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str" + getName() + "String_Node_Str");
  sb.append("String_Node_Str" + getAmountAs(getUnits()) + "String_Node_Str");
  sb.append("String_Node_Str" + getUnits() + "String_Node_Str");
  sb.append("String_Node_Str" + stage + "String_Node_Str");
  sb.append("String_Node_Str" + time + "String_Node_Str");
  sb.append("String_Node_Str" + comments + "String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public String toXML(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str" + getName() + "String_Node_Str");
  sb.append("String_Node_Str" + getAmountAs(getUnits()) + "String_Node_Str");
  sb.append("String_Node_Str" + getUnits() + "String_Node_Str");
  sb.append("String_Node_Str" + stage + "String_Node_Str");
  sb.append("String_Node_Str" + time + "String_Node_Str");
  sb.append("String_Node_Str" + SBStringUtils.subEntities(comments) + "String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 50542
Project: 50542
Buggy source:
private String checkFileType(File f){
  if (f.getPath().endsWith("String_Node_Str"))   return "String_Node_Str";
  if (f.getPath().endsWith("String_Node_Str") || (f.getPath().endsWith("String_Node_Str"))) {
    try {
      FileReader in=new FileReader(f);
      BufferedReader inb=new BufferedReader(in);
      String c;
      int i=0;
      while ((c=inb.readLine()) != null && i < 10) {
        if (c.indexOf("String_Node_Str") > -1)         return "String_Node_Str";
        if (c.indexOf("String_Node_Str") > -1)         return "String_Node_Str";
        if (c.indexOf("String_Node_Str") > -1)         return "String_Node_Str";
        i++;
      }
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private String checkFileType(File f){
  if (f.getPath().endsWith("String_Node_Str"))   return "String_Node_Str";
  if (f.getPath().endsWith("String_Node_Str") || (f.getPath().endsWith("String_Node_Str"))) {
    try {
      FileReader in=new FileReader(f);
      BufferedReader inb=new BufferedReader(in);
      String c;
      int i=0;
      while ((c=inb.readLine()) != null && i < 10) {
        if (c.indexOf("String_Node_Str") > -1)         return "String_Node_Str";
        if (c.indexOf("String_Node_Str") > -1)         return "String_Node_Str";
        if (c.indexOf("String_Node_Str") > -1)         return "String_Node_Str";
        i++;
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return "String_Node_Str";
}
Program: 50543
Project: 50543
Buggy source:
public String getColourMethod(){
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getColourMethod(){
  return colourMethod;
}
Program: 50546
Project: 50546
Buggy source:
public FindDialog(JFrame frame){
  super(frame);
  recipes=new ArrayList();
  files=new ArrayList();
  inst=(StrangeSwing)frame;
  currentDir=new java.io.File("String_Node_Str");
  initGUI();
  dirLocationText.setText(currentDir.getAbsolutePath());
}

Fixed version (ground truth):
public FindDialog(JFrame frame){
  super(frame);
  recipes=new ArrayList();
  files=new ArrayList();
  inst=(StrangeSwing)frame;
  String slash=System.getProperty("String_Node_Str");
  currentDir=new java.io.File("String_Node_Str");
  try {
    currentDir=new File(currentDir.getCanonicalPath() + slash + "String_Node_Str");
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  initGUI();
  dirLocationText.setText(currentDir.getAbsolutePath());
  loadRecipes(currentDir);
}
Program: 50547
Project: 50547
Buggy source:
public Object getValueAt(int row,int col){
  try {
switch (col) {
case 0:
      return data.getMaltName(row);
case 1:
    return new Double(SBStringUtils.df1.format(data.getMaltAmountAs(row,data.getMaltUnits(row))));
case 2:
  return data.getMaltUnits(row);
case 3:
return new Double(SBStringUtils.df3.format(data.getMaltPppg(row)));
case 4:
return new Double(SBStringUtils.df0.format(data.getMaltLov(row)));
case 5:
return new Double(data.getMaltCostPerU(row));
case 6:
return SBStringUtils.df1.format(new Double(data.getMaltPercent(row)));
}
}
 catch (Exception e) {
}
;
return "String_Node_Str";
}

Fixed version (ground truth):
public Object getValueAt(int row,int col){
  try {
switch (col) {
case 0:
      return data.getMaltName(row);
case 1:
    return SBStringUtils.df1.format(data.getMaltAmountAs(row,data.getMaltUnits(row)));
case 2:
  return data.getMaltUnits(row);
case 3:
return SBStringUtils.df3.format(data.getMaltPppg(row));
case 4:
return SBStringUtils.df0.format(data.getMaltLov(row));
case 5:
return new Double(data.getMaltCostPerU(row));
case 6:
return SBStringUtils.df1.format(new Double(data.getMaltPercent(row)));
}
}
 catch (Exception e) {
}
;
return "String_Node_Str";
}
Program: 50548
Project: 50548
Buggy source:
public Object getValueAt(int row,int col){
  try {
switch (col) {
case 0:
      return data.getStepType(row);
case 1:
    return data.getStepMethod(row);
case 2:
  return new Double(data.getStepStartTemp(row));
case 3:
return new Double(data.getStepEndTemp(row));
case 4:
return new Integer(data.getStepRampMin(row));
case 5:
return new Integer(data.getStepMin(row));
}
}
 catch (Exception e) {
Debug.print(e.toString());
}
;
return "String_Node_Str";
}

Fixed version (ground truth):
public Object getValueAt(int row,int col){
  try {
switch (col) {
case 0:
      return data.getStepType(row);
case 1:
    return data.getStepMethod(row);
case 2:
  return SBStringUtils.df1.format(data.getStepStartTemp(row));
case 3:
return SBStringUtils.df1.format(data.getStepEndTemp(row));
case 4:
return new Integer(data.getStepRampMin(row));
case 5:
return new Integer(data.getStepMin(row));
}
}
 catch (Exception e) {
Debug.print(e.toString());
}
;
return "String_Node_Str";
}
Program: 50549
Project: 50549
Buggy source:
public String getVolAbrv(String unit){
  return getAbrvFromUnit(getTypeFromUnit(unit),unit);
}

Fixed version (ground truth):
public static String getVolAbrv(String unit){
  Quantity q=new Quantity();
  q.setUnits(unit);
  return q.abrv;
}
Program: 50550
Project: 50550
Buggy source:
private String getAbrvFromUnit(String t,String s){
  int i=0;
  Converter[] u;
  if (t == "String_Node_Str")   u=volUnits;
 else   u=weightUnits;
  while (i < u.length && u[i].unit != s) {
    i++;
  }
  if (i >= u.length)   return null;
 else   return u[i].abrv;
}

Fixed version (ground truth):
private String getAbrvFromUnit(String t,String s){
  int i=0;
  Converter[] u;
  if (t == "String_Node_Str")   u=volUnits;
 else   u=weightUnits;
  while (i < u.length && !u[i].unit.equalsIgnoreCase(s)) {
    i++;
  }
  if (i >= u.length)   return null;
 else   return u[i].abrv;
}