nus-yam/ex-repair huggingface dataset:
Program: 56613
Project: 56613
Buggy source:
private void doSheetClean(Worksheet sheet){
  if (getBook().getSheetIndex(sheet) != -1)   deleteFocus();
  List list=loadWidgetLoaders();
  int size=list.size();
  for (int i=0; i < size; i++) {
    ((WidgetLoader)list.get(i)).onSheetClean(sheet);
  }
  removeAttribute(MERGE_MATRIX_KEY);
  clearHeaderSizeHelper(true,true);
  _custColId=new SequenceId(-1,2);
  _custRowId=new SequenceId(-1,2);
  _selectionRect.set(0,0,0,0);
  _focusRect.set(0,0,0,0);
  _colFreeze=-1;
  _colFreezeset=false;
  _rowFreeze=-1;
  _rowFreezeset=false;
}

Fixed version (ground truth):
private void doSheetClean(Worksheet sheet){
  if (getBook().getSheetIndex(sheet) != -1)   deleteFocus();
  List list=loadWidgetLoaders();
  int size=list.size();
  for (int i=0; i < size; i++) {
    ((WidgetLoader)list.get(i)).onSheetClean(sheet);
  }
  _selectionRect.set(0,0,0,0);
  _focusRect.set(0,0,0,0);
  _colFreeze=-1;
  _colFreezeset=false;
  _rowFreeze=-1;
  _rowFreezeset=false;
}
Program: 56614
Project: 56614
Buggy source:
/** 
 * Gets Cell text by given row and column
 */
static public String getCelltext(Spreadsheet ss,int row,int column){
  Worksheet sheet=ss.getSelectedSheet();
  final Cell cell=Utils.getCell(sheet,row,column);
  String text="String_Node_Str";
  if (cell != null) {
    boolean wrap=cell.getCellStyle().getWrapText();
    final FormatText ft=Utils.getFormatText(cell);
    if (ft != null) {
      if (ft.isRichTextString()) {
        final RichTextString rstr=ft.getRichTextString();
        text=rstr == null ? "String_Node_Str" : Utils.formatRichTextString(sheet,rstr,wrap);
      }
 else       if (ft.isCellFormatResult()) {
        text=Utils.escapeCellText(ft.getCellFormatResult().text,wrap,true);
      }
    }
    final Hyperlink hlink=Utils.getHyperlink(cell);
    if (hlink != null) {
      text=Utils.formatHyperlink(sheet,hlink,text,wrap);
    }
  }
  return text;
}

Fixed version (ground truth):
/** 
 * Gets Cell text by given row and column
 */
static public String getCelltext(Worksheet sheet,int row,int column){
  final Cell cell=Utils.getCell(sheet,row,column);
  String text="String_Node_Str";
  if (cell != null) {
    boolean wrap=cell.getCellStyle().getWrapText();
    final FormatText ft=Utils.getFormatText(cell);
    if (ft != null) {
      if (ft.isRichTextString()) {
        final RichTextString rstr=ft.getRichTextString();
        text=rstr == null ? "String_Node_Str" : Utils.formatRichTextString(sheet,rstr,wrap);
      }
 else       if (ft.isCellFormatResult()) {
        text=Utils.escapeCellText(ft.getCellFormatResult().text,wrap,true);
      }
    }
    final Hyperlink hlink=Utils.getHyperlink(cell);
    if (hlink != null) {
      text=Utils.formatHyperlink(sheet,hlink,text,wrap);
    }
  }
  return text;
}
Program: 56615
Project: 56615
Buggy source:
static public String getCellFormatText(Spreadsheet ss,int row,int column){
  Worksheet sheet=ss.getSelectedSheet();
  final Cell cell=Utils.getCell(sheet,row,column);
  String text="String_Node_Str";
  if (cell != null) {
    final FormatText ft=Utils.getFormatText(cell);
    if (ft != null) {
      if (ft.isRichTextString()) {
        final RichTextString rstr=ft.getRichTextString();
        text=rstr == null ? "String_Node_Str" : rstr.toString();
      }
 else       if (ft.isCellFormatResult()) {
        text=ft.getCellFormatResult().text;
      }
    }
  }
  return text;
}

Fixed version (ground truth):
static public String getCellFormatText(Worksheet sheet,int row,int column){
  final Cell cell=Utils.getCell(sheet,row,column);
  String text="String_Node_Str";
  if (cell != null) {
    final FormatText ft=Utils.getFormatText(cell);
    if (ft != null) {
      if (ft.isRichTextString()) {
        final RichTextString rstr=ft.getRichTextString();
        text=rstr == null ? "String_Node_Str" : rstr.toString();
      }
 else       if (ft.isCellFormatResult()) {
        text=ft.getCellFormatResult().text;
      }
    }
  }
  return text;
}
Program: 56616
Project: 56616
Buggy source:
static public String getEdittext(Spreadsheet ss,int row,int column){
  Worksheet sheet=ss.getSelectedSheet();
  final Cell cell=Utils.getCell(sheet,row,column);
  return cell != null ? Utils.getEditText(cell) : "String_Node_Str";
}

Fixed version (ground truth):
static public String getEdittext(Worksheet sheet,int row,int column){
  final Cell cell=Utils.getCell(sheet,row,column);
  return cell != null ? Utils.getEditText(cell) : "String_Node_Str";
}
Program: 56617
Project: 56617
Buggy source:
private void updateNamedRanges(XSSFWorkbook wb,PtgShifter shifter){
  XSSFEvaluationWorkbook fpb=XSSFEvaluationWorkbook.create(wb);
  for (int i=0; i < wb.getNumberOfNames(); i++) {
    XSSFName name=wb.getNameAt(i);
    String formula=name.getRefersToFormula();
    int sheetIndex=name.getSheetIndex();
    Ptg[] ptgs=FormulaParser.parse(formula,fpb,FormulaType.NAMEDRANGE,sheetIndex);
    if (shifter.adjustFormula(ptgs,sheetIndex)) {
      String shiftedFmla=FormulaRenderer.toFormulaString(fpb,ptgs);
      name.setRefersToFormula(shiftedFmla);
    }
  }
}

Fixed version (ground truth):
private void updateNamedRanges(XSSFWorkbook wb,PtgShifter shifter){
  XSSFEvaluationWorkbook fpb=XSSFEvaluationWorkbook.create(wb);
  for (int i=0; i < wb.getNumberOfNames(); i++) {
    XSSFName name=wb.getNameAt(i);
    String formula=name.getRefersToFormula();
    int sheetIndex=name.getSheetIndex();
    if (formula != null) {
      Ptg[] ptgs=FormulaParser.parse(formula,fpb,FormulaType.NAMEDRANGE,sheetIndex);
      if (shifter.adjustFormula(ptgs,sheetIndex)) {
        String shiftedFmla=FormulaRenderer.toFormulaString(fpb,ptgs);
        name.setRefersToFormula(shiftedFmla);
      }
    }
  }
}
Program: 56618
Project: 56618
Buggy source:
private int getMaxday(int month,int year){
  int maxday=MAXDAYS[month];
  if (month == 2 && isLeapYear(year)) {
    return maxday + 1;
  }
  return maxday;
}

Fixed version (ground truth):
private int getMaxday(int month,int year){
  int maxday=MAXDAYS[month];
  if (month == 1 && isLeapYear(year)) {
    return maxday + 1;
  }
  return maxday;
}
Program: 56619
Project: 56619
Buggy source:
private void processChart(Worksheet sheet,Map data){
  String widgetId=(String)data.get("String_Node_Str");
  int keyCode=(Integer)data.get("String_Node_Str");
  DrawingManager dm=((SheetCtrl)sheet).getDrawingManager();
  if (KeyEvent.DELETE == keyCode) {
    List<ZssChartX> charts=dm.getChartXs();
    for (    ZssChartX chartX : charts) {
      Chart chart=chartX.getChart();
      if (chart != null && chart.getChartId().equals(widgetId)) {
        Ranges.range(sheet).deleteChart(chart);
      }
    }
  }
}

Fixed version (ground truth):
private void processChart(Worksheet sheet,Map data){
  String widgetId=(String)data.get("String_Node_Str");
  int keyCode=(Integer)data.get("String_Node_Str");
  DrawingManager dm=((SheetCtrl)sheet).getDrawingManager();
  if (KeyEvent.DELETE == keyCode) {
    List<Chart> charts=dm.getCharts();
    for (    Chart chart : charts) {
      if (chart != null && chart.getChartId().equals(widgetId)) {
        Ranges.range(sheet).deleteChart(chart);
        break;
      }
    }
  }
}
Program: 56620
Project: 56620
Buggy source:
protected ClientAnchor getClientAnchor(int row,int col,int widgetWidth,int widgetHeight){
  HeaderPositionHelper rowSizeHelper=(HeaderPositionHelper)_spreadsheet.getAttribute("String_Node_Str");
  HeaderPositionHelper colSizeHelper=(HeaderPositionHelper)_spreadsheet.getAttribute("String_Node_Str");
  int lCol=col;
  int tRow=row;
  int rCol=lCol;
  int bRow=tRow;
  int offsetWidth=0;
  int offsetHeight=0;
  for (int r=tRow; r < _spreadsheet.getMaxrows(); r++) {
    int cellHeight=rowSizeHelper.getSize(r);
    widgetHeight-=cellHeight;
    if (widgetHeight <= 0) {
      bRow=r;
      if (widgetHeight < 0) {
        offsetHeight=cellHeight - Math.abs(widgetHeight);
      }
      break;
    }
  }
  for (int c=lCol; c < _spreadsheet.getMaxcolumns(); c++) {
    int cellWidth=colSizeHelper.getSize(c);
    widgetWidth-=cellWidth;
    if (widgetWidth <= 0) {
      rCol=c;
      if (widgetWidth < 0) {
        offsetWidth=cellWidth - Math.abs(widgetWidth);
      }
      break;
    }
  }
  ClientAnchor anchor=new XSSFClientAnchor(0,0,pxToEmu(offsetWidth),pxToEmu(offsetHeight),lCol,tRow,rCol,bRow);
  return anchor;
}

Fixed version (ground truth):
protected ClientAnchor getClientAnchor(int row,int col,int widgetWidth,int widgetHeight){
  HeaderPositionHelper rowSizeHelper=(HeaderPositionHelper)_spreadsheet.getAttribute("String_Node_Str");
  HeaderPositionHelper colSizeHelper=(HeaderPositionHelper)_spreadsheet.getAttribute("String_Node_Str");
  int lCol=col;
  int tRow=row;
  int rCol=lCol;
  int bRow=tRow;
  int offsetWidth=0;
  int offsetHeight=0;
  for (int r=tRow; r < _spreadsheet.getMaxrows(); r++) {
    int cellHeight=rowSizeHelper.getSize(r);
    widgetHeight-=cellHeight;
    if (widgetHeight <= 0) {
      bRow=r;
      if (widgetHeight < 0) {
        offsetHeight=cellHeight - Math.abs(widgetHeight);
      }
      break;
    }
  }
  for (int c=lCol; c < _spreadsheet.getMaxcolumns(); c++) {
    int cellWidth=colSizeHelper.getSize(c);
    widgetWidth-=cellWidth;
    if (widgetWidth <= 0) {
      rCol=c;
      if (widgetWidth < 0) {
        offsetWidth=cellWidth - Math.abs(widgetWidth);
      }
      break;
    }
  }
  if (_spreadsheet.getBook() instanceof HSSFWorkbook) {
    return new HSSFClientAnchor(0,0,offsetWidth,offsetHeight,(short)lCol,tRow,(short)rCol,bRow);
  }
 else {
    return new XSSFClientAnchor(0,0,pxToEmu(offsetWidth),pxToEmu(offsetHeight),lCol,tRow,rCol,bRow);
  }
}
Program: 56621
Project: 56621
Buggy source:
public void close(){
  unsubscribeBookListeners();
  removeBookFromDesktopIfNeeded();
  spreadsheet.setSrcName(null);
  spreadsheet.setBook(null);
}

Fixed version (ground truth):
public void close(){
  unsubscribeBookListeners();
  removeBookFromDesktopIfNeeded();
  spreadsheet.setSrcName(null);
  spreadsheet.setBook(null);
  spreadsheet.getActionHandler().disableActionOnBookClosed();
}
Program: 56622
Project: 56622
Buggy source:
private void processStopEditing0(String token,Worksheet sheet,int rowIdx,int colIdx,Object value){
  try {
    Utils.setEditText(sheet,rowIdx,colIdx,value == null ? "String_Node_Str" : value.toString());
    JSONObj result=new JSONObj();
    result.setData("String_Node_Str",rowIdx);
    result.setData("String_Node_Str",colIdx);
    result.setData("String_Node_Str","String_Node_Str");
    result.setData("String_Node_Str","String_Node_Str");
    updateRange(sheet,Utils.getSheetUuid(sheet),colIdx,rowIdx,colIdx,rowIdx);
    smartUpdate("String_Node_Str",new String[]{token,Utils.getSheetUuid(sheet),result.toString()});
  }
 catch (  RuntimeException x) {
    processCancelEditing0(token,sheet,rowIdx,colIdx);
    if (x instanceof FormulaParseException) {
      showFormulaError((FormulaParseException)x);
    }
 else {
      throw x;
    }
  }
}

Fixed version (ground truth):
private void processStopEditing0(String token,Worksheet sheet,int rowIdx,int colIdx,Object value){
  try {
    Utils.setEditText(sheet,rowIdx,colIdx,value == null ? "String_Node_Str" : value.toString());
    JSONObj result=new JSONObj();
    result.setData("String_Node_Str",rowIdx);
    result.setData("String_Node_Str",colIdx);
    result.setData("String_Node_Str","String_Node_Str");
    result.setData("String_Node_Str","String_Node_Str");
    if (getPreloadColumnSize() > 0 && getPreloadRowSize() > 0) {
      updateRange(sheet,Utils.getSheetUuid(sheet),colIdx,rowIdx,colIdx,rowIdx);
    }
    smartUpdate("String_Node_Str",new String[]{token,Utils.getSheetUuid(sheet),result.toString()});
  }
 catch (  RuntimeException x) {
    processCancelEditing0(token,sheet,rowIdx,colIdx);
    if (x instanceof FormulaParseException) {
      showFormulaError((FormulaParseException)x);
    }
 else {
      throw x;
    }
  }
}
Program: 56625
Project: 56625
Buggy source:
private static void clearCutRangeIfNeed(Spreadsheet ss){
  if (!isCut(ss))   return;
  Worksheet srcSheet=getSourceSheet(ss);
  Worksheet dstSheet=ss.getSelectedSheet();
  Rect srcRange=getSourceRange(ss);
  int srcLeft=srcRange.getLeft();
  int srcRight=srcRange.getRight();
  int srcTop=srcRange.getTop();
  int srcBottom=srcRange.getBottom();
  int dstLeft=ss.getSelection().getLeft();
  int dstTop=ss.getSelection().getTop();
  int dstRight=dstLeft + (srcRight - srcLeft);
  int maxCol=ss.getMaxcolumns();
  dstRight=dstRight < maxCol ? dstRight : maxCol;
  int dstBottom=dstTop + (srcBottom - srcTop);
  int maxRow=ss.getMaxrows();
  dstBottom=dstBottom < maxRow ? dstBottom : maxRow;
  boolean sameSheet=ss.indexOfSheet(srcSheet) == ss.indexOfSheet(dstSheet);
  final CellStyle defaultStyle=ss.getBook().createCellStyle();
  for (int row=srcTop; row <= srcBottom; row++) {
    for (int col=srcLeft; col <= srcRight; col++) {
      if (sameSheet && (row >= dstTop && row <= dstBottom && col >= dstLeft && col <= dstRight))       continue;
      Range rng=Ranges.range(srcSheet,row,col);
      rng.setEditText(null);
      rng.setStyle(defaultStyle);
    }
  }
  ss.setAttribute(KEY_SRC_SHEET,null);
  ss.setAttribute(KEY_SRC_RANGE,null);
}

Fixed version (ground truth):
private static void clearCutRangeIfNeed(Spreadsheet ss){
  if (!isCut(ss))   return;
  int maxCol=ss.getMaxcolumns();
  int maxRow=ss.getMaxrows();
  Worksheet srcSheet=getSourceSheet(ss);
  Worksheet dstSheet=ss.getSelectedSheet();
  Rect srcRange=getSourceRange(ss);
  int srcLeft=srcRange.getLeft();
  int srcRight=srcRange.getRight();
  srcRight=srcRight < maxCol ? srcRight : maxCol;
  int srcTop=srcRange.getTop();
  int srcBottom=srcRange.getBottom();
  srcBottom=srcBottom < maxRow ? srcBottom : maxRow;
  int dstLeft=ss.getSelection().getLeft();
  int dstTop=ss.getSelection().getTop();
  int dstRight=dstLeft + (srcRight - srcLeft);
  dstRight=dstRight < maxCol ? dstRight : maxCol;
  int dstBottom=dstTop + (srcBottom - srcTop);
  dstBottom=dstBottom < maxRow ? dstBottom : maxRow;
  boolean sameSheet=ss.indexOfSheet(srcSheet) == ss.indexOfSheet(dstSheet);
  final CellStyle defaultStyle=ss.getBook().createCellStyle();
  for (int row=srcTop; row <= srcBottom; row++) {
    for (int col=srcLeft; col <= srcRight; col++) {
      if (sameSheet && (row >= dstTop && row <= dstBottom && col >= dstLeft && col <= dstRight))       continue;
      Range rng=Ranges.range(srcSheet,row,col);
      rng.setEditText(null);
      rng.setStyle(defaultStyle);
    }
  }
  ss.setAttribute(KEY_SRC_SHEET,null);
  ss.setAttribute(KEY_SRC_RANGE,null);
}
Program: 56628
Project: 56628
Buggy source:
/** 
 * Receive notification of character data inside an element. Stores the characters as value, using   {@link #currentElement} as a key 
 * @param ch The characters.
 * @param start The start position in the character array.
 * @param length The number of characters to use from thecharacter array.
 * @exception org.xml.sax.SAXException Any SAX exception, possiblywrapping another exception.
 * @see org.xml.sax.ContentHandler#characters
 */
public void characters(char[] ch,int start,int length) throws SAXException {
  nameValue.put(currentElement,new String(ch,start,length));
}

Fixed version (ground truth):
/** 
 * Receive notification of character data inside an element. Stores the characters as value, using   {@link #currentElement} as a key 
 * @param ch The characters.
 * @param start The start position in the character array.
 * @param length The number of characters to use from thecharacter array.
 * @exception org.xml.sax.SAXException Any SAX exception, possiblywrapping another exception.
 * @see org.xml.sax.ContentHandler#characters
 */
public void characters(char[] ch,int start,int length) throws SAXException {
  if (currentElement != null) {
    String value=new String(ch,start,length);
    String old=nameValue.put(currentElement,value);
    if (old != null) {
      nameValue.put(currentElement,old + value);
    }
  }
}
Program: 56629
Project: 56629
Buggy source:
@Produces @Dependent public static Collection<MonetaryAmountFactory> amountFactories(InjectionPoint ip){
  AmountSpec specAnnot=ip.getAnnotated() != null ? ip.getAnnotated().getAnnotation(AmountSpec.class) : null;
  if (specAnnot != null) {
    return Collection.class.cast(Monetary.getAmountFactories(createAmountQuery(specAnnot)));
  }
  return Collection.class.cast(Monetary.getAmountFactories());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Produces @Dependent public static Collection<MonetaryAmountFactory> amountFactories(InjectionPoint ip){
  AmountSpec specAnnot=ip.getAnnotated() != null ? ip.getAnnotated().getAnnotation(AmountSpec.class) : null;
  if (specAnnot != null) {
    return Collection.class.cast(Monetary.getAmountFactories(createAmountQuery(specAnnot)));
  }
  return Collection.class.cast(Monetary.getAmountFactories());
}
Program: 56630
Project: 56630
Buggy source:
public static BigDecimal zero(){
  return instance.zero;
}

Fixed version (ground truth):
/** 
 * Accesses the number '1' initialized with the current   {@link MathContext}.
 * @return the number instance, never null.
 */
public static BigDecimal zero(){
  return instance.zero;
}
Program: 56631
Project: 56631
Buggy source:
private void init(MathContext mathContext){
  one=new BigDecimal(1,mathContext);
  zero=new BigDecimal(0,mathContext);
  this.mathContext=mathContext;
}

Fixed version (ground truth):
private void init(MathContext mathContext){
  this.mathContext=mathContext;
  one=new BigDecimal(1,mathContext);
  zero=new BigDecimal(0,mathContext);
  ten=new BigDecimal(10,mathContext);
}
Program: 56632
Project: 56632
Buggy source:
public static BigDecimal one(){
  return instance.one;
}

Fixed version (ground truth):
/** 
 * Accesses the number '1' initialized with the current   {@link MathContext}.
 * @return the number instance, never null.
 */
public static BigDecimal one(){
  return instance.one;
}
Program: 56633
Project: 56633
Buggy source:
public static BigDecimal bigDecimal(BigDecimal num){
  return new BigDecimal(num.toString(),mathContext());
}

Fixed version (ground truth):
/** 
 * Creates the given number initialized with the current   {@link MathContext}.
 * @param num the number instance.
 * @return the number instance, never null.
 */
public static BigDecimal bigDecimal(BigDecimal num){
  return new BigDecimal(num.toString(),mathContext());
}
Program: 56634
Project: 56634
Buggy source:
public static BigDecimal zero(){
  return INSTANCE.zero;
}

Fixed version (ground truth):
public static BigDecimal zero(){
  return instance.zero;
}
Program: 56635
Project: 56635
Buggy source:
public static MathContext mathContext(){
  return INSTANCE.mathContext;
}

Fixed version (ground truth):
public static MathContext mathContext(){
  return instance.mathContext;
}
Program: 56636
Project: 56636
Buggy source:
public static BigDecimal one(){
  return INSTANCE.one;
}

Fixed version (ground truth):
public static BigDecimal one(){
  return instance.one;
}
Program: 56637
Project: 56637
Buggy source:
/** 
 * This method allows o set the   {@link MathContext} used for doing calculations.Not te that this affects all calculations at all stages.
 * @param mathContext the new match context, not null.
 */
public static void setMathContext(MathContext mathContext){
  INSTANCE.init(Objects.requireNonNull(mathContext));
}

Fixed version (ground truth):
/** 
 * This method allows o set the   {@link MathContext} used for doing calculations.Not te that this affects all calculations at all stages.
 * @param mathContext the new match context, not null.
 */
public static void setMathContext(MathContext mathContext){
  instance.init(Objects.requireNonNull(mathContext));
}
Program: 56638
Project: 56638
Buggy source:
/** 
 * Access the input type descriptor.
 * @return the input type descriptor, never null.
 */
public I getInputType();

Fixed version (ground truth):
/** 
 * Access the input type descriptor.
 * @return the input type descriptor, never null.
 */
I getInputType();
Program: 56639
Project: 56639
Buggy source:
/** 
 * Access the result type.
 * @return the result type, never null.
 */
public Class<T> getResultType();

Fixed version (ground truth):
/** 
 * Access the result type.
 * @return the result type, never null.
 */
Class<T> getResultType();
Program: 56640
Project: 56640
Buggy source:
/** 
 * Calulates the result.
 * @param input the input value
 * @return the result
 * @throws javax.money.MonetaryException if input validation fails, or an other monetary errors occurring.
 */
public T calculate(ComplexValue<I> input);

Fixed version (ground truth):
/** 
 * Calulates the result.
 * @param input the input value
 * @return the result
 * @throws javax.money.MonetaryException if input validation fails, or an other monetary errors occurring.
 */
T calculate(ComplexValue<I> input);
Program: 56641
Project: 56641
Buggy source:
public <T>T get(String key,Class<T> type,T defaultValue){
  @SuppressWarnings("String_Node_Str") T t=(T)this.args.get(key);
  if (t == null) {
    return defaultValue;
  }
  return t;
}

Fixed version (ground truth):
public <P>P get(String key,Class<P> type,P defaultValue){
  @SuppressWarnings("String_Node_Str") P t=(P)this.args.get(key);
  if (t == null) {
    return defaultValue;
  }
  return t;
}
Program: 56642
Project: 56642
Buggy source:
public CompositeMonetaryOperator(String name,MonetaryOperator... operations){
  Objects.requireNonNull(name);
  for (  MonetaryOperator monetaryOperator : operations) {
    functions.add(monetaryOperator);
  }
}

Fixed version (ground truth):
public CompositeMonetaryOperator(String name,MonetaryOperator... operations){
  Objects.requireNonNull(name);
  Collections.addAll(functions,operations);
}
Program: 56643
Project: 56643
Buggy source:
/** 
 * Performs the calculation.
 * @param amountPV  the present value, not null.
 * @param balloonAmount the balloon amount, not null and currency compatible with {@code amountPV}.
 * @param rate    the target rate, not null.
 * @param periods the periods, >= 0.
 * @return the resulting amount, never null.
 */
public static MonetaryAmount calculate(MonetaryAmount amountPV,MonetaryAmount balloonAmount,Rate rate,int periods){
  if (periods < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final BigDecimal ONE=new BigDecimal(1,MathContext.DECIMAL64);
  BigDecimal factor2=rate.get().divide(ONE.subtract(ONE.add(rate.get()).pow(-periods,MathContext.DECIMAL64)),MathContext.DECIMAL64);
  MonetaryAmount factor1=amountPV.subtract(balloonAmount.getFactory().setNumber(balloonAmount.getNumber().numberValue(BigDecimal.class).divide(ONE.add(rate.get()).pow(periods,MathContext.DECIMAL64),MathContext.DECIMAL64)).create());
  return factor1.multiply(factor2);
}

Fixed version (ground truth):
/** 
 * Performs the calculation.
 * @param amountPV  the present value, not null.
 * @param balloonAmount the balloon amount, not null and currency compatible with {@code amountPV}.
 * @param rate    the target rate, not null.
 * @param periods the periods, >= 0.
 * @return the resulting amount, never null.
 */
public static MonetaryAmount calculate(MonetaryAmount amountPV,MonetaryAmount balloonAmount,Rate rate,int periods){
  if (periods < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  BigDecimal factor2=rate.get().divide(one().subtract(one().add(rate.get()).pow(-periods,MathContext.DECIMAL64)),MathContext.DECIMAL64);
  MonetaryAmount factor1=amountPV.subtract(balloonAmount.getFactory().setNumber(balloonAmount.getNumber().numberValue(BigDecimal.class).divide(one().add(rate.get()).pow(periods,MathContext.DECIMAL64),MathContext.DECIMAL64)).create());
  return factor1.multiply(factor2);
}
Program: 56644
Project: 56644
Buggy source:
/** 
 * Access the shared instance of   {@link BasisPoint} for use.
 * @return the shared instance, never {@code null}.
 */
private BasisPoint(final Number decimal){
  basisPointValue=calcBasisPoint(decimal);
}

Fixed version (ground truth):
private BasisPoint(final Number decimal){
  basisPointValue=calcBasisPoint(decimal);
}
Program: 56645
Project: 56645
Buggy source:
/** 
 * Calculate a BigDecimal value for a Permil e.g. "3" (3 permil) will generate .003
 * @return java.math.BigDecimal
 * @param number the basis points number, 10'000-ends.
 */
private static final BigDecimal calcBasisPoint(Number number){
  return MoneyUtils.getBigDecimal(number).divide(ONE_TENTHOUSAND,CalculationContext.mathContext());
}

Fixed version (ground truth):
/** 
 * Calculate a BigDecimal value for a Permil e.g. "3" (3 permil) will generate .003
 * @return java.math.BigDecimal
 * @param number the basis points number, 10'000-ends.
 */
private static BigDecimal calcBasisPoint(Number number){
  return MoneyUtils.getBigDecimal(number).divide(ONE_TENTHOUSAND,CalculationContext.mathContext());
}
Program: 56646
Project: 56646
Buggy source:
/** 
 * Performs the calculation.
 * @param amount  the base amount, not null.
 * @param rate    the target rate, not null.
 * @param periods the periods, >= 0.
 * @return the resulting amount, never null.
 */
public static MonetaryAmount calculate(MonetaryAmount amount,Rate rate,int periods,int timesCompounded){
  final BigDecimal ONE=CalculationContext.one();
  BigDecimal part2=rate.get().divide(BigDecimal.valueOf(timesCompounded));
  BigDecimal base=ONE.add(part2);
  BigDecimal multiplicator=base.pow(periods * timesCompounded);
  return amount.multiply(multiplicator).subtract(amount);
}

Fixed version (ground truth):
/** 
 * Performs the calculation.
 * @param amount  the base amount, not null.
 * @param rate    the target rate, not null.
 * @param periods the periods, >= 0.
 * @return the resulting amount, never null.
 */
public static MonetaryAmount calculate(MonetaryAmount amount,Rate rate,int periods,int timesCompounded){
  BigDecimal part2=rate.get().divide(BigDecimal.valueOf(timesCompounded),mathContext());
  BigDecimal base=one().add(part2);
  BigDecimal multiplicator=base.pow(periods * timesCompounded,mathContext());
  return amount.multiply(multiplicator).subtract(amount);
}
Program: 56647
Project: 56647
Buggy source:
/** 
 * This function returns the number of periods required to double an amount with continuous compounding, given a rate.
 */
public static BigDecimal calculate(Rate rate){
  if (rate.get().signum() == 0) {
    throw new MonetaryException("String_Node_Str");
  }
  return new BigDecimal(Math.log(2.0d),CalculationContext.mathContext()).divide(new BigDecimal(Math.log(1.0d + rate.get().doubleValue())),CalculationContext.mathContext());
}

Fixed version (ground truth):
/** 
 * This function returns the number of periods required to double an amount with continuous compounding, given a rate.
 */
public static BigDecimal calculate(Rate rate){
  if (rate.get().signum() == 0) {
    throw new MonetaryException("String_Node_Str");
  }
  return new BigDecimal(Math.log(2.0d),CalculationContext.mathContext()).divide(BigDecimal.valueOf(Math.log(1.0d + rate.get().doubleValue())),CalculationContext.mathContext());
}
Program: 56648
Project: 56648
Buggy source:
protected LocalDate[] getQueryDates(ConversionQuery query){
  if (Objects.nonNull(query.get(LocalDate.class)) || Objects.nonNull(query.get(LocalDateTime.class))) {
    LocalDate localDate=Optional.ofNullable(query.get(LocalDate.class)).orElseGet(() -> query.get(LocalDateTime.class).toLocalDate());
    return new LocalDate[]{localDate};
  }
 else   if (Objects.nonNull(query.get(LocalDate[].class))) {
    return query.get(LocalDate[].class);
  }
  return null;
}

Fixed version (ground truth):
@Override protected LocalDate[] getQueryDates(ConversionQuery query){
  if (Objects.nonNull(query.get(LocalDate.class)) || Objects.nonNull(query.get(LocalDateTime.class))) {
    LocalDate localDate=Optional.ofNullable(query.get(LocalDate.class)).orElseGet(() -> query.get(LocalDateTime.class).toLocalDate());
    return new LocalDate[]{localDate};
  }
 else   if (Objects.nonNull(query.get(LocalDate[].class))) {
    return query.get(LocalDate[].class);
  }
  return null;
}
Program: 56649
Project: 56649
Buggy source:
private ExchangeRate reverse(ExchangeRate rate){
  if (Objects.isNull(rate)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return new ExchangeRateBuilder(rate).setRate(rate).setBase(rate.getCurrency()).setTerm(rate.getBaseCurrency()).setFactor(divide(DefaultNumberValue.ONE,rate.getFactor(),MathContext.DECIMAL64)).build();
}

Fixed version (ground truth):
private ExchangeRate reverse(ExchangeRate rate){
  if (Objects.isNull(rate)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return new ExchangeRateBuilder(rate).setRate(rate).setBase(rate.getCurrency()).setTerm(rate.getBaseCurrency()).setContext(getExchangeContext(DIGIT_FRACTION_KEY)).setFactor(divide(DefaultNumberValue.ONE,rate.getFactor(),MathContext.DECIMAL64)).build();
}
Program: 56650
Project: 56650
Buggy source:
protected ConversionContext getExchangeContext(String key){
  int scale=getScale(key);
  if (scale < 0) {
    return ConversionContext.of(this.context.getProviderName(),RateType.HISTORIC);
  }
 else {
    return ConversionContext.of(this.context.getProviderName(),RateType.HISTORIC).toBuilder().set(KEY_SCALE,scale).build();
  }
}

Fixed version (ground truth):
@Override protected ConversionContext getExchangeContext(String key){
  int scale=getScale(key);
  if (scale < 0) {
    return ConversionContext.of(this.context.getProviderName(),RateType.HISTORIC);
  }
 else {
    return ConversionContext.of(this.context.getProviderName(),RateType.HISTORIC).toBuilder().set(KEY_SCALE,scale).build();
  }
}
Program: 56651
Project: 56651
Buggy source:
protected int getScale(String key){
  String string=MonetaryConfig.getConfig().getOrDefault(key,"String_Node_Str");
  if (string.isEmpty()) {
    return -1;
  }
 else {
    try {
      return Integer.valueOf(string);
    }
 catch (    NumberFormatException e) {
      return -1;
    }
  }
}

Fixed version (ground truth):
@Override protected int getScale(String key){
  String string=MonetaryConfig.getConfig().getOrDefault(key,"String_Node_Str");
  if (string.isEmpty()) {
    return -1;
  }
 else {
    try {
      return Integer.valueOf(string);
    }
 catch (    NumberFormatException e) {
      return -1;
    }
  }
}
Program: 56652
Project: 56652
Buggy source:
/** 
 * Performs the calculation.
 * @param amount  the base amount, not null.
 * @param rate    the target rate, not null.
 * @param periods the periods, >= 0.
 * @return the resulting amount, never null.
 */
public static MonetaryAmount calculate(MonetaryAmount amount,Rate rate,int periods){
  int power=rate.get().multiply(BigDecimal.valueOf(periods)).intValue();
  BigDecimal f=BigDecimal.valueOf(Math.E).pow(power);
  return amount.multiply(f);
}

Fixed version (ground truth):
/** 
 * Performs the calculation.
 * @param amount  the base amount, not null.
 * @param rate    the target rate, not null.
 * @param periods the periods, >= 0.
 * @return the resulting amount, never null.
 */
public static MonetaryAmount calculate(MonetaryAmount amount,Rate rate,int periods){
  int power=rate.get().multiply(BigDecimal.valueOf(periods)).intValue();
  BigDecimal f=BigDecimal.valueOf(Math.E).pow(power);
  return (amount.multiply(f));
}
Program: 56653
Project: 56653
Buggy source:
/** 
 * Calculates the discount factor.
 * @param rate    the target rate, not null.
 * @param periods the periods, >= 0.
 * @return the factor calculated.
 */
public static BigDecimal calculate(Rate rate,int periods){
  Objects.requireNonNull(rate);
  if (periods < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  BigDecimal div=BigDecimal.ONE.min(BigDecimal.ONE.add(rate.get()));
  BigDecimal factor=BigDecimal.ONE.subtract(BigDecimal.ONE.add(rate.get()).pow(periods)).divide(div);
  return BigDecimal.ONE.add(factor);
}

Fixed version (ground truth):
/** 
 * Calculates the discount factor.
 * @param rate    the target rate, not null.
 * @param periods the periods, >= 0.
 * @return the factor calculated.
 */
public static BigDecimal calculate(Rate rate,int periods){
  Objects.requireNonNull(rate);
  if (periods < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  BigDecimal div=BigDecimal.ONE.min(BigDecimal.ONE.add(rate.get()));
  BigDecimal factor=BigDecimal.ONE.subtract(BigDecimal.ONE.add(rate.get()).pow(periods)).divide(div,BigDecimal.ROUND_HALF_DOWN);
  return BigDecimal.ONE.add(factor);
}
Program: 56654
Project: 56654
Buggy source:
public FlavoredMonetaryAmount(MonetaryAmount baseAmount,String amountType){
  Objects.requireNonNull(baseAmount,"String_Node_Str");
  this.baseAmount=baseAmount;
  if (amountType != null) {
    this.amountType=amountType;
  }
}

Fixed version (ground truth):
private FlavoredMonetaryAmount(MonetaryAmount baseAmount,String amountType){
  Objects.requireNonNull(baseAmount,"String_Node_Str");
  this.baseAmount=baseAmount;
  if (amountType != null) {
    this.amountType=amountType;
  }
}
Program: 56655
Project: 56655
Buggy source:
@Override public MonetaryContext getMonetaryContext(){
  return null;
}

Fixed version (ground truth):
@Override public MonetaryContext getMonetaryContext(){
  return this.amount.getMonetaryContext();
}
Program: 56656
Project: 56656
Buggy source:
@Override public Number getNumber(Class type){
  return null;
}

Fixed version (ground truth):
@Override public <N extends Number>N getNumber(Class<N> type){
  return this.amount.getNumber(type);
}
Program: 56657
Project: 56657
Buggy source:
public boolean isGreaterThanOrEqualTo(MonetaryAmount amount){
  return this.amount.isGreaterThanOrEqualTo(amount);
}

Fixed version (ground truth):
public boolean isGreaterThanOrEqualTo(MonetaryAmount<?> amount){
  return this.amount.isGreaterThanOrEqualTo(amount);
}
Program: 56658
Project: 56658
Buggy source:
/** 
 * Access an   {@link ConstraintMoney} based on the given{@link MonetaryAmount}.
 * @param amount
 * @return
 */
private static ConstraintMoney of(Money amount,MonetaryPredicate<MonetaryAmount> predicate){
  return new ConstraintMoney(amount,predicate);
}

Fixed version (ground truth):
/** 
 * Access an   {@link ConstraintMoney} based on the given{@link MonetaryAmount}.
 * @param amount
 * @return
 */
private static ConstraintMoney of(MonetaryAmount<?> amount,MonetaryPredicate<MonetaryAmount> predicate){
  return new ConstraintMoney(amount,predicate);
}
Program: 56659
Project: 56659
Buggy source:
@Override public MonetaryAmount divide(double amount){
  return null;
}

Fixed version (ground truth):
@Override public ConstraintMoney divide(double divisor){
  return new ConstraintMoney(amount.divide(divisor),predicate);
}
Program: 56660
Project: 56660
Buggy source:
@Override public MonetaryAmount multiply(double multiplicand){
  return null;
}

Fixed version (ground truth):
@Override public ConstraintMoney multiply(double multiplicand){
  return new ConstraintMoney(amount.multiply(multiplicand),predicate);
}
Program: 56661
Project: 56661
Buggy source:
@Override public MonetaryAmount add(MonetaryAmount amount){
  return null;
}

Fixed version (ground truth):
public ConstraintMoney add(MonetaryAmount<?> augend){
  return of(this.amount.add(augend),predicate);
}
Program: 56662
Project: 56662
Buggy source:
@Override public boolean isLessThan(MonetaryAmount amt){
  return false;
}

Fixed version (ground truth):
public boolean isLessThan(MonetaryAmount<?> amount){
  return this.amount.isLessThan(amount);
}
Program: 56663
Project: 56663
Buggy source:
/** 
 * Creates a new wrapper instance.
 * @param amount the underlying amount, not null and not negative.
 * @throws IllegalArgumentException if the amount passed is negative.
 */
ConstraintMoney(Money amount,MonetaryPredicate<MonetaryAmount> predicate){
  if (amount == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (predicate == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!predicate.test(amount)) {
    throw new IllegalArgumentException("String_Node_Str" + predicate + "String_Node_Str"+ amount);
  }
  this.amount=amount;
  this.predicate=predicate;
}

Fixed version (ground truth):
/** 
 * Creates a new wrapper instance.
 * @param amount the underlying amount, not null and not negative.
 * @throws IllegalArgumentException if the amount passed is negative.
 */
ConstraintMoney(MonetaryAmount<?> amount,MonetaryPredicate<MonetaryAmount> predicate){
  if (amount == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (predicate == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!predicate.test(amount)) {
    throw new IllegalArgumentException("String_Node_Str" + predicate + "String_Node_Str"+ amount);
  }
  this.amount=amount;
  this.predicate=predicate;
}
Program: 56664
Project: 56664
Buggy source:
@Override public Number getNumberExact(Class type){
  return null;
}

Fixed version (ground truth):
@Override public <N extends Number>N getNumberExact(Class<N> type){
  return this.amount.getNumberExact(type);
}
Program: 56665
Project: 56665
Buggy source:
@Override public MonetaryAmount subtract(MonetaryAmount amount){
  return null;
}

Fixed version (ground truth):
@Override public ConstraintMoney subtract(MonetaryAmount<?> amount){
  return new ConstraintMoney(amount.subtract(amount),predicate);
}
Program: 56666
Project: 56666
Buggy source:
@Override public <R>R query(MonetaryQuery<R> query){
  return null;
}

Fixed version (ground truth):
@Override public <R>R query(MonetaryQuery<R> query){
  return query.queryFrom(this);
}
Program: 56667
Project: 56667
Buggy source:
public boolean isGreaterThan(MonetaryAmount amount){
  return this.amount.isGreaterThan(amount);
}

Fixed version (ground truth):
public boolean isGreaterThan(MonetaryAmount<?> amount){
  return this.amount.isGreaterThan(amount);
}
Program: 56668
Project: 56668
Buggy source:
@Override public MonetaryAmount divideToIntegralValue(double divisor){
  return null;
}

Fixed version (ground truth):
@Override public ConstraintMoney divideToIntegralValue(double divisor){
  return new ConstraintMoney(amount.divideToIntegralValue(divisor),predicate);
}
Program: 56669
Project: 56669
Buggy source:
@Override public MonetaryAmount with(CurrencyUnit unit,double amount){
  return null;
}

Fixed version (ground truth):
@Override public ConstraintMoney with(CurrencyUnit unit,double amount){
  return new ConstraintMoney(amount.with(unit,amount),predicate);
}
Program: 56670
Project: 56670
Buggy source:
@Override public boolean isLessThanOrEqualTo(MonetaryAmount amt){
  return false;
}

Fixed version (ground truth):
public boolean isLessThanOrEqualTo(MonetaryAmount<?> amount){
  return this.amount.isLessThanOrEqualTo(amount);
}
Program: 56671
Project: 56671
Buggy source:
@Override public MonetaryAmount[] divideAndRemainder(double amount){
  return null;
}

Fixed version (ground truth):
@Override public ConstraintMoney[] divideAndRemainder(double divisor){
  return new ConstraintMoney(amount.divideAndRemainder(divisor),predicate);
}
Program: 56672
Project: 56672
Buggy source:
@Override public MonetaryAmount stripTrailingZeros(){
  return null;
}

Fixed version (ground truth):
@Override public ConstraintMoney stripTrailingZeros(){
  return new ConstraintMoney(amount.stripTrailingZeros(),predicate);
}
Program: 56673
Project: 56673
Buggy source:
@Override public MonetaryAmount remainder(double amount){
  return null;
}

Fixed version (ground truth):
@Override public ConstraintMoney remainder(double divisor){
  return new ConstraintMoney(amount.remainder(divisor),predicate);
}
Program: 56674
Project: 56674
Buggy source:
public boolean isEqualTo(MonetaryAmount amount){
  return this.amount.isEqualTo(amount);
}

Fixed version (ground truth):
public boolean isEqualTo(MonetaryAmount<?> amount){
  return this.amount.isEqualTo(amount);
}
Program: 56675
Project: 56675
Buggy source:
@Override public FlavoredMonetaryAmount with(MonetaryOperator operator){
  return with(operator,UNKNOWN);
}

Fixed version (ground truth):
@Override public FlavoredMonetaryAmount with(CurrencyUnit unit,Number amount){
  return new FlavoredMonetaryAmount(this.baseAmount.with(unit,amount),null);
}
Program: 56676
Project: 56676
Buggy source:
/** 
 * Get the underlying   {@link String}.
 * @return the flavor of this amount, never {@code null}.
 */
public String getAmountFlavor(){
  return this.amountType;
}

Fixed version (ground truth):
/** 
 * Get the underlying   {@link String}.
 * @return the flavor of this amount, never {@code null}.
 */
public String getAmountFlavor(){
  if (this.amountType == null) {
    return UNKNOWN;
  }
  return this.amountType;
}
Program: 56677
Project: 56677
Buggy source:
/** 
 * Get the underlying base   {@link MonetaryAmount}, which is never an instance of   {@link FlavoredMonetaryAmount}.
 * @return the base amount, never {@code null}.
 */
public MonetaryAmount getBaseAmount(){
  return this.baseAmount;
}

Fixed version (ground truth):
/** 
 * Get the underlying base   {@link MonetaryAmount}, which is never an instance of   {@link FlavoredMonetaryAmount}.
 * @return the base amount, never {@code null}.
 */
public MonetaryAmount<?> getBaseAmount(){
  return this.baseAmount;
}
Program: 56678
Project: 56678
Buggy source:
public FlavoredMonetaryAmount(MonetaryAmount baseAmount,String amountType){
  if (baseAmount == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (amountType == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.baseAmount=baseAmount;
  this.amountType=amountType;
}

Fixed version (ground truth):
public FlavoredMonetaryAmount(MonetaryAmount<?> baseAmount,String amountType){
  Objects.requireNonNull(baseAmount,"String_Node_Str");
  this.baseAmount=baseAmount;
  if (amountType != null) {
    this.amountType=amountType;
  }
}
Program: 56679
Project: 56679
Buggy source:
/** 
 * Creates an unsigned   {@link MonetaryAmount} based on the given{@link MonetaryAmount}.
 * @param amount
 * @return an ansigned instance, that can never be negative.
 */
public static MonetaryAmount unsignedAmount(MonetaryAmount amount){
  return new ConstraintMoney(Money.from(amount),UNSIGED_PREDICATE);
}

Fixed version (ground truth):
/** 
 * Creates an unsigned   {@link MonetaryAmount} based on the given{@link MonetaryAmount}.
 * @param amount
 * @return an ansigned instance, that can never be negative.
 */
public static MonetaryAmount<?> unsignedAmount(MonetaryAmount<?> amount){
  return new ConstraintMoney(amount,UNSIGNED_PREDICATE);
}
Program: 56680
Project: 56680
Buggy source:
/** 
 * Creates an predicated   {@link MonetaryAmount} based on the given{@link MonetaryAmount}.
 * @param amount The amount to decorated.
 * @return a predicated instance, that ensures the given predicate is alwaysensured on all operations.
 */
public static MonetaryAmount constraintAmount(MonetaryAmount amount,MonetaryPredicate<MonetaryAmount> predicate){
  return new ConstraintMoney(Money.from(amount),predicate);
}

Fixed version (ground truth):
/** 
 * Creates an predicated   {@link MonetaryAmount} based on the given{@link MonetaryAmount}.
 * @param amount The amount to decorated.
 * @return a predicated instance, that ensures the given predicate is alwaysensured on all operations.
 */
public static MonetaryAmount<?> constraintAmount(MonetaryAmount<?> amount,MonetaryPredicate<MonetaryAmount<?>> predicate){
  return new ConstraintMoney(amount,predicate);
}
Program: 56681
Project: 56681
Buggy source:
/** 
 * Access an   {@link ConstraintMoney} based on the given{@link MonetaryAmount}.
 * @param amount
 * @return
 */
private static ConstraintMoney of(MonetaryAmount<?> amount,MonetaryPredicate<MonetaryAmount> predicate){
  return new ConstraintMoney(amount,predicate);
}

Fixed version (ground truth):
/** 
 * Access an   {@link ConstraintMoney} based on the given{@link MonetaryAmount}.
 * @param amount
 * @return
 */
private static ConstraintMoney of(MonetaryAmount<?> amount,MonetaryPredicate<MonetaryAmount<?>> predicate){
  return new ConstraintMoney(amount,predicate);
}
Program: 56682
Project: 56682
Buggy source:
/** 
 * Creates a new wrapper instance.
 * @param amount the underlying amount, not null and not negative.
 * @throws IllegalArgumentException if the amount passed is negative.
 */
ConstraintMoney(MonetaryAmount<?> amount,MonetaryPredicate<MonetaryAmount> predicate){
  if (amount == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (predicate == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!predicate.test(amount)) {
    throw new IllegalArgumentException("String_Node_Str" + predicate + "String_Node_Str"+ amount);
  }
  this.amount=amount;
  this.predicate=predicate;
}

Fixed version (ground truth):
/** 
 * Creates a new wrapper instance.
 * @param amount the underlying amount, not null and not negative.
 * @throws IllegalArgumentException if the amount passed is negative.
 */
ConstraintMoney(MonetaryAmount<?> amount,MonetaryPredicate<MonetaryAmount<?>> predicate){
  if (amount == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (predicate == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!predicate.test(amount)) {
    throw new IllegalArgumentException("String_Node_Str" + predicate + "String_Node_Str"+ amount);
  }
  this.amount=amount;
  this.predicate=predicate;
}
Program: 56683
Project: 56683
Buggy source:
@Override public ConstraintMoney subtract(MonetaryAmount<?> amount){
  return new ConstraintMoney(amount.subtract(amount),predicate);
}

Fixed version (ground truth):
@Override public ConstraintMoney subtract(MonetaryAmount<?> amount){
  return new ConstraintMoney(this.amount.subtract(amount),predicate);
}
Program: 56684
Project: 56684
Buggy source:
@Override public ConstraintMoney with(CurrencyUnit unit,double amount){
  return new ConstraintMoney(amount.with(unit,amount),predicate);
}

Fixed version (ground truth):
@Override public ConstraintMoney with(CurrencyUnit unit,double amount){
  return new ConstraintMoney(this.amount.with(unit,amount),predicate);
}
Program: 56685
Project: 56685
Buggy source:
@Override public ConstraintMoney[] divideAndRemainder(double divisor){
  return new ConstraintMoney(amount.divideAndRemainder(divisor),predicate);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public ConstraintMoney[] divideAndRemainder(double divisor){
  MonetaryAmount<?>[] result=this.amount.divideAndRemainder(divisor);
  return new ConstraintMoney[]{new ConstraintMoney(result[0],predicate),new ConstraintMoney(result[1],predicate)};
}
Program: 56686
Project: 56686
Buggy source:
/** 
 * Creates an unsigned   {@link MonetaryAmount} based on the given{@link MonetaryAmount}.
 * @param amount
 * @return an ansigned instance, that can never be negative.
 */
public static MonetaryAmount unsignedAmount(MonetaryAmount amount){
  return new ConstraintMoney(Money.from(amount),UNSIGED_PREDICATE);
}

Fixed version (ground truth):
/** 
 * Creates an unsigned   {@link MonetaryAmount} based on the given{@link MonetaryAmount}.
 * @param amount
 * @return an ansigned instance, that can never be negative.
 */
public static MonetaryAmount<?> unsignedAmount(MonetaryAmount<?> amount){
  return new ConstraintMoney(amount,UNSIGNED_PREDICATE);
}
Program: 56687
Project: 56687
Buggy source:
/** 
 * Creates an predicated   {@link MonetaryAmount} based on the given{@link MonetaryAmount}.
 * @param amount The amount to decorated.
 * @return a predicated instance, that ensures the given predicate is alwaysensured on all operations.
 */
public static MonetaryAmount constraintAmount(MonetaryAmount amount,MonetaryPredicate<MonetaryAmount> predicate){
  return new ConstraintMoney(Money.from(amount),predicate);
}

Fixed version (ground truth):
/** 
 * Creates an predicated   {@link MonetaryAmount} based on the given{@link MonetaryAmount}.
 * @param amount The amount to decorated.
 * @return a predicated instance, that ensures the given predicate is alwaysensured on all operations.
 */
public static MonetaryAmount<?> constraintAmount(MonetaryAmount<?> amount,MonetaryPredicate<MonetaryAmount<?>> predicate){
  return new ConstraintMoney(amount,predicate);
}
Program: 56688
Project: 56688
Buggy source:
/** 
 * Access an   {@link ConstraintMoney} based on the given{@link MonetaryAmount}.
 * @param amount
 * @return
 */
private static ConstraintMoney of(MonetaryAmount<?> amount,MonetaryPredicate<MonetaryAmount> predicate){
  return new ConstraintMoney(amount,predicate);
}

Fixed version (ground truth):
/** 
 * Access an   {@link ConstraintMoney} based on the given{@link MonetaryAmount}.
 * @param amount
 * @return
 */
private static ConstraintMoney of(MonetaryAmount<?> amount,MonetaryPredicate<MonetaryAmount<?>> predicate){
  return new ConstraintMoney(amount,predicate);
}