nus-yam/ex-repair huggingface dataset:
Program: 171860
Project: 171860
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  this.mGauge=this.findViewById(R.id.gauge);
  this.mGauge.setAngleStart(-225);
  this.mGauge.setAngleSweep(270);
  this.mGauge.setRecognizePathTouch(true);
  this.mGauge.setPathTouchThreshold(100);
  ScCopier base=this.mGauge.getBase();
  base.setWidths(100);
  base.setColors(Color.YELLOW,Color.MAGENTA,Color.YELLOW);
  base.setColorsMode(ScFeature.ColorsMode.GRADIENT);
  base.getPainter().setStrokeCap(Paint.Cap.ROUND);
  ScCopier progress=this.mGauge.getProgress();
  progress.setWidths(100);
  progress.setColors(Color.RED);
  progress.getPainter().setStrokeCap(Paint.Cap.ROUND);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  int size=30;
  this.mGauge=this.findViewById(R.id.gauge);
  this.mGauge.setAngleStart(-225);
  this.mGauge.setAngleSweep(270);
  this.mGauge.setRecognizePathTouch(true);
  this.mGauge.setPathTouchThreshold(size);
  ScCopier base=this.mGauge.getBase();
  base.setWidths(size);
  base.setColors(Color.WHITE);
  base.getPainter().setStrokeCap(Paint.Cap.ROUND);
  ScCopier progress=this.mGauge.getProgress();
  progress.setWidths(size);
  progress.setColors(Color.RED);
  progress.getPainter().setStrokeCap(Paint.Cap.ROUND);
  ScPointer pointer=this.mGauge.getHighPointer();
  pointer.setVisible(true);
  pointer.setWidths(size * 2);
  pointer.setHeights(size * 2,size * 4);
  pointer.setColors(Color.RED);
}
Program: 171862
Project: 171862
Buggy source:
/** 
 * Get the nearest pointer considering the passed distance from the path start.
 * @param percentage    from the path start
 * @return              the nearest pointer
 */
private ScPointer findNearestPointer(float percentage){
  List<ScFeature> pointers=this.findFeatures(ScPointer.class,null);
  ScPointer nearestPointer=null;
  float nearestValue=Float.MAX_VALUE;
  for (  ScFeature pointer : pointers) {
    ScPointer current=(ScPointer)pointer;
    if (!current.getVisible())     continue;
    float normalDistance=Math.abs(percentage - current.getValue());
    float inverseDistance=Math.abs(100 - percentage + current.getValue());
    if (normalDistance < nearestValue) {
      nearestValue=normalDistance;
      nearestPointer=current;
    }
    if (this.mPathMeasure.isClosed())     if (inverseDistance < nearestValue) {
      nearestValue=inverseDistance;
      nearestPointer=current;
    }
  }
  return nearestPointer;
}

Fixed version (ground truth):
/** 
 * Get the nearest pointer considering the passed distance from the path start.
 * @param percentage    from the path start
 * @return              the nearest pointer
 */
private ScPointer findNearestPointer(float percentage){
  List<ScFeature> pointers=this.findFeatures(ScPointer.class,null);
  ScPointer nearestPointer=null;
  float nearestValue=Float.MAX_VALUE;
  for (  ScFeature pointer : pointers) {
    ScPointer current=(ScPointer)pointer;
    if (!current.getVisible())     continue;
    float normalDistance=Math.abs(percentage - current.getDistance());
    float inverseDistance=Math.abs(100 - percentage + current.getDistance());
    if (normalDistance < nearestValue) {
      nearestValue=normalDistance;
      nearestPointer=current;
    }
    if (this.mPathMeasure.isClosed())     if (inverseDistance < nearestValue) {
      nearestValue=inverseDistance;
      nearestPointer=current;
    }
  }
  return nearestPointer;
}
Program: 171863
Project: 171863
Buggy source:
/** 
 * Set the value (high or low) considering the near pointer.
 * @param value   the new value
 * @param pointer the pointer near
 */
private void setValueByPointer(float value,ScPointer pointer){
  if (pointer != null && pointer.getTag() != null && pointer.getTag().equalsIgnoreCase(ScGauge.LOW_POINTER_IDENTIFIER)) {
    this.invalidate();
    this.mLowValue=value;
    this.setGenericValue(value,true);
    return;
  }
  if (pointer == null || (pointer.getTag() != null && pointer.getTag().equalsIgnoreCase(ScGauge.HIGH_POINTER_IDENTIFIER))) {
    this.invalidate();
    this.mHighValue=value;
    this.setGenericValue(value,false);
    return;
  }
  if (this.mSnapToNotches && this.mNotches != null)   value=this.mNotches.snapToRepetitions(value);
  pointer.setValue(value);
  this.invalidate();
}

Fixed version (ground truth):
/** 
 * Set the value (high or low) considering the near pointer.
 * @param value   the new value
 * @param pointer the pointer near
 */
private void setValueByPointer(float value,ScPointer pointer){
  if (pointer != null && pointer.getTag() != null && pointer.getTag().equalsIgnoreCase(ScGauge.LOW_POINTER_IDENTIFIER)) {
    this.invalidate();
    this.mLowValue=value;
    this.setGenericValue(value,true);
    return;
  }
  if (pointer == null || (pointer.getTag() != null && pointer.getTag().equalsIgnoreCase(ScGauge.HIGH_POINTER_IDENTIFIER))) {
    this.invalidate();
    this.mHighValue=value;
    this.setGenericValue(value,false);
    return;
  }
  if (this.mSnapToNotches && this.mNotches != null)   value=this.mNotches.snapToRepetitions(value);
  pointer.setDistance(value);
  this.invalidate();
}
Program: 171864
Project: 171864
Buggy source:
/** 
 * Setting the features and call the ScDrawer base draw method.
 * @param canvas the view canvas
 */
@Override protected void onDraw(Canvas canvas){
  if (this.mSelectedPointer != null) {
    this.mSelectedPointer.setPressed(this.isPressed());
  }
  List<ScFeature> progresses=this.findFeatures(null,ScGauge.PROGRESS_IDENTIFIER);
  for (  ScFeature progress : progresses) {
    progress.setEndTo(this.mHighValueAnimated);
    progress.setStartAt(this.mLowValueAnimated);
  }
  List<ScFeature> pointers=this.findFeatures(ScPointer.class,null);
  for (  ScFeature pointer : pointers) {
    ScPointer casted=(ScPointer)pointer;
switch (pointer.getTag()) {
case ScGauge.HIGH_POINTER_IDENTIFIER:
      casted.setValue(this.mHighValueAnimated);
    break;
case ScGauge.LOW_POINTER_IDENTIFIER:
  casted.setValue(this.mLowValueAnimated);
break;
}
}
super.onDraw(canvas);
}

Fixed version (ground truth):
/** 
 * Setting the features and call the ScDrawer base draw method.
 * @param canvas the view canvas
 */
@Override protected void onDraw(Canvas canvas){
  if (this.mSelectedPointer != null) {
    this.mSelectedPointer.setPressed(this.isPressed());
  }
  List<ScFeature> progresses=this.findFeatures(null,ScGauge.PROGRESS_IDENTIFIER);
  for (  ScFeature progress : progresses) {
    progress.setEndTo(this.mHighValueAnimated);
    progress.setStartAt(this.mLowValueAnimated);
  }
  List<ScFeature> pointers=this.findFeatures(ScPointer.class,null);
  for (  ScFeature pointer : pointers) {
    ScPointer casted=(ScPointer)pointer;
switch (pointer.getTag()) {
case ScGauge.HIGH_POINTER_IDENTIFIER:
      casted.setDistance(this.mHighValueAnimated);
    break;
case ScGauge.LOW_POINTER_IDENTIFIER:
  casted.setDistance(this.mLowValueAnimated);
break;
}
}
super.onDraw(canvas);
}
Program: 171865
Project: 171865
Buggy source:
/** 
 * Find the pointer positioned over this distance
 * @param distance  from the path start
 * @return          the over pointer
 */
private ScPointer findOverPointer(float distance){
  List<ScFeature> pointers=this.findFeatures(ScPointer.class,null);
  for (  ScFeature pointer : pointers) {
    ScPointer current=(ScPointer)pointer;
    if (!current.getVisible())     continue;
    float percentage=current.getValue();
    float currentDistance=ScGauge.percentageToValue(percentage,0,this.mPathMeasure.getLength());
    float dimension=current.getMaxDimension();
    if (currentDistance >= distance - dimension && currentDistance <= distance + dimension)     return current;
    if (this.mPathMeasure.isClosed()) {
      float negative=distance - this.mPathMeasure.getLength();
      if (currentDistance >= negative - dimension && currentDistance <= negative + dimension)       return current;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Find the pointer positioned over this distance
 * @param distance  from the path start
 * @return          the over pointer
 */
private ScPointer findOverPointer(float distance){
  List<ScFeature> pointers=this.findFeatures(ScPointer.class,null);
  for (  ScFeature pointer : pointers) {
    ScPointer current=(ScPointer)pointer;
    if (!current.getVisible())     continue;
    float percentage=current.getDistance();
    float currentDistance=ScGauge.percentageToValue(percentage,0,this.mPathMeasure.getLength());
    float dimension=current.getMaxDimension();
    if (currentDistance >= distance - dimension && currentDistance <= distance + dimension)     return current;
    if (this.mPathMeasure.isClosed()) {
      float negative=distance - this.mPathMeasure.getLength();
      if (currentDistance >= negative - dimension && currentDistance <= negative + dimension)       return current;
    }
  }
  return null;
}
Program: 171866
Project: 171866
Buggy source:
/** 
 * Get the pointer mac dimension. Note than this could be depend on the current position on the path.
 * @return   the max dimension
 */
@SuppressWarnings("String_Node_Str") public float getMaxDimension(){
  float width=this.getWidth(this.mValue);
  float height=this.getHeight(this.mValue);
  float max=width > height ? width : height;
  return max + this.mHaloWidth;
}

Fixed version (ground truth):
/** 
 * Get the pointer max dimension. Note than this could be depend on the current position on the path.
 * @return   the max dimension
 */
@SuppressWarnings("String_Node_Str") public float getMaxDimension(){
  float width=this.getWidth(this.mDistance);
  float height=this.getHeight(this.mDistance);
  float max=width > height ? width : height;
  return max + this.mHaloWidth;
}
Program: 171867
Project: 171867
Buggy source:
/** 
 * Constructor
 */
@SuppressWarnings("String_Node_Str") public ScPointer(){
  super();
  this.setRepetitions(1);
  this.setLastRepetitionOnPathEnd(false);
  this.mHaloWidth=ScPointer.DEFAULT_HALO_WIDTH;
  this.mHaloAlpha=ScPointer.DEFAULT_HALO_ALPHA;
  this.mHaloPaint=new Paint();
  this.mHaloPaint.setStyle(Paint.Style.STROKE);
  this.mRepetitionInfo=new PointerInfo();
}

Fixed version (ground truth):
/** 
 * Constructor
 */
@SuppressWarnings("String_Node_Str") public ScPointer(){
  super();
  super.setRepetitions(1);
  super.setLastRepetitionOnPathEnd(false);
  super.setType(NotchTypes.OVAL_FILLED);
  this.mHaloWidth=ScPointer.DEFAULT_HALO_WIDTH;
  this.mHaloAlpha=ScPointer.DEFAULT_HALO_ALPHA;
  this.mHaloPaint=new Paint();
  this.mHaloPaint.setStyle(Paint.Style.STROKE);
  this.mRepetitionInfo=new PointerInfo();
}
Program: 171868
Project: 171868
Buggy source:
public void reset(ScPointer feature,int contour,int repetition){
  super.reset(feature,contour,repetition);
  this.source=feature;
  this.pressed=feature.getPressed();
  this.distance=feature.getValue();
  this.height=feature.getHeight(this.distance);
  this.width=feature.getWidth(this.distance);
  this.tangent=feature.getPointAndAngle(this.distance,this.mGenericPoint);
  this.color=feature.getGradientColor(this.distance);
}

Fixed version (ground truth):
public void reset(ScPointer feature,int contour,int repetition){
  super.reset(feature,contour,repetition);
  float percentage=feature.getDistance();
  float distance=feature.getDistance(percentage);
  this.source=feature;
  this.pressed=feature.getPressed();
  this.distance=distance;
  this.height=feature.getHeight(distance);
  this.width=feature.getWidth(distance);
  this.tangent=feature.getPointAndAngle(distance,this.mGenericPoint);
  this.color=feature.getGradientColor(distance);
  this.point[0]=this.mGenericPoint[0];
  this.point[1]=this.mGenericPoint[1];
}
Program: 171869
Project: 171869
Buggy source:
/** 
 * Draw method
 * @param canvas where to draw
 * @hide
 */
@Override protected void onDraw(Canvas canvas,RepetitionInfo info){
  PointerInfo pointerInfo=(PointerInfo)info;
  this.mHaloPaint.setAlpha(pointerInfo.pressed ? 255 : this.mHaloAlpha);
  this.mHaloPaint.setStrokeWidth(this.mHaloWidth);
  Paint paint=this.getPainter();
  paint.setAlpha(pointerInfo.pressed ? this.mHaloAlpha : 255);
  super.onDraw(canvas,info);
}

Fixed version (ground truth):
/** 
 * Draw method
 * @param canvas where to draw
 * @hide
 */
@Override protected void onDraw(Canvas canvas,RepetitionInfo info){
  PointerInfo pointerInfo=(PointerInfo)info;
  this.mHaloPaint.setStrokeWidth(this.mHaloWidth);
  this.mHaloPaint.setColor(pointerInfo.color);
  this.mHaloPaint.setAlpha(pointerInfo.pressed ? 255 : this.mHaloAlpha);
  Paint paint=this.getPainter();
  paint.setAlpha(pointerInfo.pressed ? this.mHaloAlpha : 255);
  super.onDraw(canvas,info);
}
Program: 171870
Project: 171870
Buggy source:
/** 
 * Implement a copy of this object
 * @param destination the destination object
 */
@SuppressWarnings("String_Node_Str") public void copy(ScPointer destination){
  super.copy(destination);
  destination.setValue(this.mValue);
  destination.setPressed(this.mPressed);
  destination.setHaloAlpha(this.mHaloAlpha);
  destination.setHaloWidth(this.mHaloWidth);
}

Fixed version (ground truth):
/** 
 * Implement a copy of this object
 * @param destination the destination object
 */
@SuppressWarnings("String_Node_Str") public void copy(ScPointer destination){
  super.copy(destination);
  destination.setDistance(this.mDistance);
  destination.setPressed(this.mPressed);
  destination.setHaloAlpha(this.mHaloAlpha);
  destination.setHaloWidth(this.mHaloWidth);
}
Program: 171871
Project: 171871
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  this.mGauge=this.findViewById(R.id.gauge);
  this.mGauge.setFillingArea(ScDrawer.FillingArea.VERTICAL);
  ScNotches notches=this.mGauge.getNotches();
  notches.setHeights(10);
  notches.setWidths(10);
  notches.setLastRepetitionOnPathEnd(false);
  this.mGauge.post(new Runnable(){
    @Override public void run(){
      int ticks=10;
      float space=mGauge.getPathMeasure().getLength() / ticks;
      mGauge.getNotches().setSpaceBetweenRepetitions(space - 0.01f);
    }
  }
);
  this.mGauge.getProgress().setColors(Color.RED);
  this.mGauge.getProgress().setWidths(20);
  this.mGauge.setDuration(500);
  this.mGauge.setHighValue(90);
  this.mGauge.setPathTouchThreshold(50);
  this.mGauge.setRecognizePathTouch(true);
  this.mGauge.setOnEventListener(new ScGauge.OnEventListener(){
    @Override public void onValueChange(    float lowValue,    float highValue,    boolean isRunning){
      int a=0;
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  this.mGauge=this.findViewById(R.id.gauge);
  this.mGauge.setFillingArea(ScDrawer.FillingArea.VERTICAL);
  this.mGauge.setHighValue(90);
  this.mGauge.setPathTouchThreshold(50);
  this.mGauge.setRecognizePathTouch(true);
  ScNotches notches=this.mGauge.getNotches();
  notches.setHeights(10);
  notches.setWidths(10);
  notches.setLastRepetitionOnPathEnd(false);
  this.mGauge.post(new Runnable(){
    @Override public void run(){
      int ticks=10;
      float space=mGauge.getPathMeasure().getLength() / ticks;
      mGauge.getNotches().setSpaceBetweenRepetitions(space - 0.01f);
    }
  }
);
}
Program: 171872
Project: 171872
Buggy source:
/** 
 * On measure
 * @param widthMeasureSpec  the reference width
 * @param heightMeasureSpec the reference height
 */
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int widthGlobalPadding=this.getPaddingLeft() + this.getPaddingRight();
  int heightGlobalPadding=this.getPaddingTop() + this.getPaddingBottom();
  int width=View.getDefaultSize(this.getSuggestedMinimumWidth(),widthMeasureSpec);
  int height=View.getDefaultSize(this.getSuggestedMinimumHeight(),heightMeasureSpec);
  this.mPath=this.createPath(width - widthGlobalPadding,height - heightGlobalPadding);
  this.mPathMeasure.setPath(this.mPath,false);
  this.mFeaturesMustBeRefresh=true;
  if (this.getLayoutParams().width == ViewGroup.LayoutParams.WRAP_CONTENT)   width=(int)this.mPathMeasure.getBounds().width() + widthGlobalPadding;
  if (this.getLayoutParams().height == ViewGroup.LayoutParams.WRAP_CONTENT)   height=(int)this.mPathMeasure.getBounds().height() + heightGlobalPadding;
  this.mDrawArea=this.getDrawableArea(width - widthGlobalPadding,height - heightGlobalPadding);
  this.mVirtualArea=this.getVirtualArea(width - widthGlobalPadding,height - heightGlobalPadding);
  this.mAreaScale=this.getScale(this.mVirtualArea,this.mDrawArea);
  width=ScDrawer.valueRangeLimit(width,0,this.mMaximumWidth);
  height=ScDrawer.valueRangeLimit(height,0,this.mMaximumHeight);
  this.setMeasuredDimension(width,height);
}

Fixed version (ground truth):
/** 
 * On measure
 * @param widthMeasureSpec  the reference width
 * @param heightMeasureSpec the reference height
 */
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int widthGlobalPadding=this.getPaddingLeft() + this.getPaddingRight();
  int heightGlobalPadding=this.getPaddingTop() + this.getPaddingBottom();
  int width=View.getDefaultSize(this.getSuggestedMinimumWidth(),widthMeasureSpec);
  int height=View.getDefaultSize(this.getSuggestedMinimumHeight(),heightMeasureSpec);
  this.mPath=this.createPath(width - widthGlobalPadding,height - heightGlobalPadding);
  this.mPathMeasure.setPath(this.mPath,false);
  this.mFeaturesMustBeRefresh=true;
  if (this.getLayoutParams().width == ViewGroup.LayoutParams.WRAP_CONTENT) {
    RectF rect=this.mPathMeasure.getBounds();
    width=(int)(rect != null ? rect.width() : 0) + widthGlobalPadding;
  }
  if (this.getLayoutParams().height == ViewGroup.LayoutParams.WRAP_CONTENT) {
    RectF rect=this.mPathMeasure.getBounds();
    height=(int)(rect != null ? rect.height() : 0) + heightGlobalPadding;
  }
  this.mDrawArea=this.getDrawableArea(width - widthGlobalPadding,height - heightGlobalPadding);
  this.mVirtualArea=this.getVirtualArea(width - widthGlobalPadding,height - heightGlobalPadding);
  this.mAreaScale=this.getScale(this.mVirtualArea,this.mDrawArea);
  width=ScDrawer.valueRangeLimit(width,0,this.mMaximumWidth);
  height=ScDrawer.valueRangeLimit(height,0,this.mMaximumHeight);
  this.setMeasuredDimension(width,height);
}
Program: 171873
Project: 171873
Buggy source:
private NodeManager(String pubKey) throws PublicKeyAccount.InvalidPublicKey {
  final RuntimeTypeAdapterFactory<Transaction> typeFactory=RuntimeTypeAdapterFactory.of(Transaction.class,"String_Node_Str").registerSubtype(PaymentTransaction.class,"String_Node_Str").registerSubtype(IssueTransaction.class,"String_Node_Str").registerSubtype(TransferTransaction.class,"String_Node_Str").registerSubtype(ReissueTransaction.class,"String_Node_Str").registerSubtype(ExchangeTransaction.class,"String_Node_Str").registerDefaultSubtype(Transaction.class,"String_Node_Str");
  gson=new GsonBuilder().registerTypeAdapterFactory(typeFactory).create();
  Retrofit retrofit=new Retrofit.Builder().baseUrl(EnvironmentManager.get().current().getNodeUrl()).addConverterFactory(GsonConverterFactory.create(gson)).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).build();
  service=retrofit.create(NodeApi.class);
  this.publicKeyAccount=new PublicKeyAccount(pubKey);
}

Fixed version (ground truth):
private NodeManager(String pubKey) throws PublicKeyAccount.InvalidPublicKey {
  final RuntimeTypeAdapterFactory<Transaction> typeFactory=RuntimeTypeAdapterFactory.of(Transaction.class,"String_Node_Str").registerSubtype(PaymentTransaction.class,"String_Node_Str").registerSubtype(IssueTransaction.class,"String_Node_Str").registerSubtype(TransferTransaction.class,"String_Node_Str").registerSubtype(ReissueTransaction.class,"String_Node_Str").registerSubtype(ExchangeTransaction.class,"String_Node_Str").registerSubtype(MassTransferTransaction.class,"String_Node_Str").registerDefaultSubtype(Transaction.class,"String_Node_Str");
  gson=new GsonBuilder().registerTypeAdapterFactory(typeFactory).create();
  Retrofit retrofit=new Retrofit.Builder().baseUrl(EnvironmentManager.get().current().getNodeUrl()).addConverterFactory(GsonConverterFactory.create(gson)).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).build();
  service=retrofit.create(NodeApi.class);
  this.publicKeyAccount=new PublicKeyAccount(pubKey);
}
Program: 171874
Project: 171874
Buggy source:
public boolean isForAsset(String assetId){
  return false;
}

Fixed version (ground truth):
@Override public boolean isForAsset(String assetId){
  return StringUtils.equals(assetId,getMyOrder().assetPair.amountAsset) || StringUtils.equals(assetId,getMyOrder().assetPair.priceAsset);
}
Program: 171876
Project: 171876
Buggy source:
@Test public void doubleRequest() throws Exception {
  Observable.zip(service.assetsBalance("String_Node_Str"),service.transactionList("String_Node_Str",50).map(r -> r.get(0)),(abs,txs) -> abs.address + "String_Node_Str" + txs.size()).blockingSubscribe(res -> {
    System.out.println(res);
  }
);
}

Fixed version (ground truth):
@Test public void doubleRequest() throws Exception {
  Observable.zip(service.assetsBalance("String_Node_Str"),service.transactionList("String_Node_Str",50).map(r -> r.get(0)),(abs,txs) -> abs.address + "String_Node_Str" + txs).blockingSubscribe(res -> {
    System.out.println(res);
  }
);
}
Program: 171877
Project: 171877
Buggy source:
public void testTransactionByTinkoffSms() throws Exception {
  String template="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(template,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",null},matches);
  SmsTemplateBuilder.withDb(db).title("String_Node_Str").accountId(7).categoryId(8).template(template).create();
  Transaction transaction=smsProcessor.createTransactionBySms("String_Node_Str",sms,status,true);
  assertEquals(7,transaction.fromAccountId);
  assertEquals(8,transaction.categoryId);
  assertEquals(-25077,transaction.fromAmount);
  assertEquals(sms,transaction.note);
  assertEquals(status,transaction.status);
}

Fixed version (ground truth):
public void testTransactionByTinkoffSms() throws Exception {
  String template="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(template,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",null},matches);
  SmsTemplateBuilder.withDb(db).title("String_Node_Str").accountId(7).categoryId(8).template(template).create();
  Transaction transaction=smsProcessor.createTransactionBySms("String_Node_Str",sms,status,true);
  assertEquals(7,transaction.fromAccountId);
  assertEquals(8,transaction.categoryId);
  assertEquals(-123456720L,transaction.fromAmount);
  assertEquals(sms,transaction.note);
  assertEquals(status,transaction.status);
}
Program: 171878
Project: 171878
Buggy source:
public Cursor getAllSmsTemplates(){
  return db().query(SMS_TEMPLATES_TABLE,SmsTemplateColumns.NORMAL_PROJECTION,SmsTemplateColumns.template + "String_Node_Str",null,null,null,SmsTemplateColumns.title.name());
}

Fixed version (ground truth):
public Cursor getAllSmsTemplates(){
  return db().query(SMS_TEMPLATES_TABLE,NORMAL_PROJECTION,SmsTemplateColumns.template + "String_Node_Str",null,null,null,title.name());
}
Program: 171879
Project: 171879
Buggy source:
public List<SmsTemplate> getSmsTemplatesByNumber(String smsNumber){
  Cursor c=db().query(SMS_TEMPLATES_TABLE,SmsTemplateColumns.NORMAL_PROJECTION,SmsTemplateColumns.title + "String_Node_Str",new String[]{smsNumber},null,null,SmsTemplateColumns.title.name());
  try {
    List<SmsTemplate> list=new ArrayList<SmsTemplate>(c.getCount());
    while (c.moveToNext()) {
      SmsTemplate a=SmsTemplate.fromCursor(c);
      list.add(a);
    }
    return list;
  }
  finally {
    c.close();
  }
}

Fixed version (ground truth):
public List<SmsTemplate> getSmsTemplatesByNumber(String smsNumber){
  try (Cursor c=db().query(SMS_TEMPLATES_TABLE,NORMAL_PROJECTION,title + "String_Node_Str",new String[]{smsNumber},null,null,title.name())){
    List<SmsTemplate> res=new ArrayList<>(c.getCount());
    while (c.moveToNext()) {
      SmsTemplate a=SmsTemplate.fromCursor(c);
      res.add(a);
    }
    return res;
  }
 }
Program: 171880
Project: 171880
Buggy source:
public Cursor getSmsTemplatesWithFullInfo(){
  String nativeQuery=String.format("String_Node_Str",DatabaseUtils.generateSelectClause(SmsTemplateColumns.NORMAL_PROJECTION,"String_Node_Str"),CategoryViewColumns.title,SmsTemplateListColumns.cat_name,CategoryViewColumns.level,SmsTemplateListColumns.cat_level,SMS_TEMPLATES_TABLE,V_CATEGORY,SmsTemplateColumns.category_id,CategoryViewColumns._id);
  return db().rawQuery(nativeQuery,new String[]{});
}

Fixed version (ground truth):
public Cursor getSmsTemplatesWithFullInfo(){
  String nativeQuery=String.format("String_Node_Str",DatabaseUtils.generateSelectClause(NORMAL_PROJECTION,"String_Node_Str"),CategoryViewColumns.title,SmsTemplateListColumns.cat_name,CategoryViewColumns.level,SmsTemplateListColumns.cat_level,SMS_TEMPLATES_TABLE,V_CATEGORY,category_id,CategoryViewColumns._id,SmsTemplateColumns.title,SmsTemplateColumns.template,SmsTemplateColumns._id);
  return db().rawQuery(nativeQuery,new String[]{});
}
Program: 171881
Project: 171881
Buggy source:
public List<SmsTemplate> getSmsTemplatesForCategory(long categoryId){
  Cursor c=db().query(SMS_TEMPLATES_TABLE,SmsTemplateColumns.NORMAL_PROJECTION,SmsTemplateColumns.category_id + "String_Node_Str",new String[]{String.valueOf(categoryId)},null,null,SmsTemplateColumns.title.name());
  try {
    List<SmsTemplate> list=new ArrayList<SmsTemplate>(c.getCount());
    while (c.moveToNext()) {
      SmsTemplate a=SmsTemplate.fromCursor(c);
      list.add(a);
    }
    return list;
  }
  finally {
    c.close();
  }
}

Fixed version (ground truth):
public List<SmsTemplate> getSmsTemplatesForCategory(long categoryId){
  try (Cursor c=db().query(SMS_TEMPLATES_TABLE,NORMAL_PROJECTION,category_id + "String_Node_Str",new String[]{String.valueOf(categoryId)},null,null,title.name())){
    List<SmsTemplate> res=new ArrayList<>(c.getCount());
    while (c.moveToNext()) {
      SmsTemplate a=SmsTemplate.fromCursor(c);
      res.add(a);
    }
    return res;
  }
 }
Program: 171882
Project: 171882
Buggy source:
public Set<String> findAllSmsTemplateNumbers(){
  Cursor c=db().rawQuery("String_Node_Str" + SmsTemplateColumns.title + "String_Node_Str"+ SMS_TEMPLATES_TABLE+ "String_Node_Str"+ SmsTemplateColumns.template+ "String_Node_Str",null);
  try {
    Set<String> res=new HashSet<String>(c.getCount());
    while (c.moveToNext()) {
      res.add(c.getString(0));
    }
    return res;
  }
  finally {
    c.close();
  }
}

Fixed version (ground truth):
public Set<String> findAllSmsTemplateNumbers(){
  try (Cursor c=db().rawQuery("String_Node_Str" + title + "String_Node_Str"+ SMS_TEMPLATES_TABLE+ "String_Node_Str"+ SmsTemplateColumns.template+ "String_Node_Str",null)){
    Set<String> res=new HashSet<>(c.getCount());
    while (c.moveToNext()) {
      res.add(c.getString(0));
    }
    return res;
  }
 }
Program: 171883
Project: 171883
Buggy source:
private static long rawFetchLong(DatabaseAdapter db,String query,String[] selectionArgs,long defaultValue){
  Cursor c=db.db().rawQuery(query,selectionArgs);
  try {
    if (c.moveToFirst()) {
      return c.getLong(0);
    }
  }
  finally {
    c.close();
  }
  return defaultValue;
}

Fixed version (ground truth):
private static long rawFetchLong(DatabaseAdapter db,String query,String[] selectionArgs,long defaultValue){
  try (Cursor c=db.db().rawQuery(query,selectionArgs)){
    if (c.moveToFirst()) {
      return c.getLong(0);
    }
  }
   return defaultValue;
}
Program: 171884
Project: 171884
Buggy source:
/** 
 * Parses sms and adds new transaction if it matches any sms template
 * @return new transaction or null if not matched/parsed
 */
public Transaction createTransactionBySms(String addr,String fullSmsBody,TransactionStatus status,boolean updateNote){
  List<SmsTemplate> addrTemplates=db.getSmsTemplatesByNumber(addr);
  for (  final SmsTemplate t : addrTemplates) {
    String[] match=findTemplateMatches(t.template,fullSmsBody);
    if (match != null) {
      Log.d(TAG,format("String_Node_Str",t,Arrays.toString(match)));
      String account=match[ACCOUNT.ordinal()];
      String parsedPrice=match[PRICE.ordinal()];
      try {
        BigDecimal price=toBigDecimal(parsedPrice);
        return createNewTransaction(price,account,t,updateNote ? fullSmsBody : "String_Node_Str",status);
      }
 catch (      Exception e) {
        Log.e(TAG,format("String_Node_Str",parsedPrice),e);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Parses sms and adds new transaction if it matches any sms template
 * @return new transaction or null if not matched/parsed
 */
public Transaction createTransactionBySms(String addr,String fullSmsBody,TransactionStatus status,boolean updateNote){
  List<SmsTemplate> addrTemplates=db.getSmsTemplatesByNumber2(addr);
  for (  final SmsTemplate t : addrTemplates) {
    String[] match=findTemplateMatches(t.template,fullSmsBody);
    if (match != null) {
      Log.d(TAG,format("String_Node_Str",t,Arrays.toString(match)));
      String account=match[ACCOUNT.ordinal()];
      String parsedPrice=match[PRICE.ordinal()];
      try {
        BigDecimal price=toBigDecimal(parsedPrice);
        return createNewTransaction(price,account,t,updateNote ? fullSmsBody : "String_Node_Str",status);
      }
 catch (      Exception e) {
        Log.e(TAG,format("String_Node_Str",parsedPrice),e);
      }
    }
  }
  return null;
}
Program: 171885
Project: 171885
Buggy source:
public void testTemplateWithMultipleAnyMatchWithoutAccount() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,null,"String_Node_Str","String_Node_Str","String_Node_Str"},matches);
}

Fixed version (ground truth):
public void testTemplateWithMultipleAnyMatchWithoutAccount() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,null,"String_Node_Str","String_Node_Str","String_Node_Str",null},matches);
}
Program: 171886
Project: 171886
Buggy source:
public void testMultipleAnyMatchWithoutAccountAndDate() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,null,"String_Node_Str",null,"String_Node_Str"},matches);
}

Fixed version (ground truth):
public void testMultipleAnyMatchWithoutAccountAndDate() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,null,"String_Node_Str",null,"String_Node_Str",null},matches);
}
Program: 171887
Project: 171887
Buggy source:
public void testTemplateWithWrongSpaces() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},matches);
}

Fixed version (ground truth):
public void testTemplateWithWrongSpaces() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",null},matches);
}
Program: 171888
Project: 171888
Buggy source:
public void testNotFoundAccount() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},matches);
  SmsTemplateBuilder.withDb(db).title("String_Node_Str").categoryId(18).template(smsTpl).create();
  Transaction transaction=smsProcessor.createTransactionBySms("String_Node_Str",sms,status,true);
  assertNull(transaction);
}

Fixed version (ground truth):
public void testNotFoundAccount() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",null},matches);
  SmsTemplateBuilder.withDb(db).title("String_Node_Str").categoryId(18).template(smsTpl).create();
  Transaction transaction=smsProcessor.createTransactionBySms("String_Node_Str",sms,status,true);
  assertNull(transaction);
}
Program: 171889
Project: 171889
Buggy source:
public void testTemplateWithAnyMatch() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},matches);
}

Fixed version (ground truth):
public void testTemplateWithAnyMatch() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",null},matches);
}
Program: 171890
Project: 171890
Buggy source:
public void testTransactionBySberSmsWithAccountLookup() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},matches);
  SmsTemplateBuilder.withDb(db).title("String_Node_Str").accountId(17).categoryId(18).template(smsTpl).create();
  Account account=AccountBuilder.withDb(db).currency(CurrencyBuilder.createDefault(db)).title("String_Node_Str").number("String_Node_Str").create();
  Transaction transaction=smsProcessor.createTransactionBySms("String_Node_Str",sms,status,false);
  assertEquals(account.id,transaction.fromAccountId);
  assertEquals(18,transaction.categoryId);
  assertEquals(-55000,transaction.fromAmount);
  assertEquals("String_Node_Str",transaction.note);
}

Fixed version (ground truth):
public void testTransactionBySberSmsWithAccountLookup() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",null},matches);
  SmsTemplateBuilder.withDb(db).title("String_Node_Str").accountId(17).categoryId(18).template(smsTpl).create();
  Account account=AccountBuilder.withDb(db).currency(CurrencyBuilder.createDefault(db)).title("String_Node_Str").number("String_Node_Str").create();
  Transaction transaction=smsProcessor.createTransactionBySms("String_Node_Str",sms,status,false);
  assertEquals(account.id,transaction.fromAccountId);
  assertEquals(18,transaction.categoryId);
  assertEquals(-55000,transaction.fromAmount);
  assertEquals("String_Node_Str",transaction.note);
}
Program: 171891
Project: 171891
Buggy source:
public void testTemplateWithMultipleAnyMatch() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},matches);
}

Fixed version (ground truth):
public void testTemplateWithMultipleAnyMatch() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",null},matches);
}
Program: 171892
Project: 171892
Buggy source:
public void testWrongPrice() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,null,null,null,"String_Node_Str"},matches);
  SmsTemplateBuilder.withDb(db).title("String_Node_Str").accountId(17).categoryId(18).template(smsTpl).create();
  Transaction transaction=smsProcessor.createTransactionBySms("String_Node_Str",sms,status,true);
  assertNull(transaction);
}

Fixed version (ground truth):
public void testWrongPrice() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,null,null,null,"String_Node_Str",null},matches);
  SmsTemplateBuilder.withDb(db).title("String_Node_Str").accountId(17).categoryId(18).template(smsTpl).create();
  Transaction transaction=smsProcessor.createTransactionBySms("String_Node_Str",sms,status,true);
  assertNull(transaction);
}
Program: 171893
Project: 171893
Buggy source:
public void testTemplateWithSpecialChars() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,null,"String_Node_Str","String_Node_Str","String_Node_Str"},matches);
}

Fixed version (ground truth):
public void testTemplateWithSpecialChars() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,null,"String_Node_Str","String_Node_Str","String_Node_Str",null},matches);
}
Program: 171894
Project: 171894
Buggy source:
public void testTransactionByTinkoffSms() throws Exception {
  String template="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(template,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},matches);
  SmsTemplateBuilder.withDb(db).title("String_Node_Str").accountId(7).categoryId(8).template(template).create();
  Transaction transaction=smsProcessor.createTransactionBySms("String_Node_Str",sms,status,true);
  assertEquals(7,transaction.fromAccountId);
  assertEquals(8,transaction.categoryId);
  assertEquals(-25077,transaction.fromAmount);
  assertEquals(sms,transaction.note);
  assertEquals(status,transaction.status);
}

Fixed version (ground truth):
public void testTransactionByTinkoffSms() throws Exception {
  String template="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(template,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",null},matches);
  SmsTemplateBuilder.withDb(db).title("String_Node_Str").accountId(7).categoryId(8).template(template).create();
  Transaction transaction=smsProcessor.createTransactionBySms("String_Node_Str",sms,status,true);
  assertEquals(7,transaction.fromAccountId);
  assertEquals(8,transaction.categoryId);
  assertEquals(-25077,transaction.fromAmount);
  assertEquals(sms,transaction.note);
  assertEquals(status,transaction.status);
}
Program: 171895
Project: 171895
Buggy source:
public void testDebitTransactionBySberSms() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},matches);
  SmsTemplateBuilder.withDb(db).title("String_Node_Str").accountId(17).categoryId(18).template(smsTpl).income(true).create();
  Transaction transaction=smsProcessor.createTransactionBySms("String_Node_Str",sms,status,true);
  assertEquals(17,transaction.fromAccountId);
  assertEquals(18,transaction.categoryId);
  assertEquals(55000,transaction.fromAmount);
  assertEquals(sms,transaction.note);
}

Fixed version (ground truth):
public void testDebitTransactionBySberSms() throws Exception {
  String smsTpl="String_Node_Str";
  String sms="String_Node_Str";
  String[] matches=SmsTransactionProcessor.findTemplateMatches(smsTpl,sms);
  Assert.assertArrayEquals(new String[]{null,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",null},matches);
  SmsTemplateBuilder.withDb(db).title("String_Node_Str").accountId(17).categoryId(18).template(smsTpl).income(true).create();
  Transaction transaction=smsProcessor.createTransactionBySms("String_Node_Str",sms,status,true);
  assertEquals(17,transaction.fromAccountId);
  assertEquals(18,transaction.categoryId);
  assertEquals(55000,transaction.fromAmount);
  assertEquals(sms,transaction.note);
}
Program: 171896
Project: 171896
Buggy source:
@Override protected List<MenuItemInfo> createContextMenus(long id){
  List<MenuItemInfo> menus=super.createContextMenus(id);
  for (  MenuItemInfo m : menus) {
    if (m.menuId == MENU_VIEW) {
      m.enabled=false;
      break;
    }
  }
  return menus;
}

Fixed version (ground truth):
@Override protected List<MenuItemInfo> createContextMenus(long id){
  List<MenuItemInfo> menus=super.createContextMenus(id);
  for (  MenuItemInfo m : menus) {
    if (m.menuId == MENU_VIEW) {
      m.enabled=false;
      break;
    }
  }
  menus.add(new MenuItemInfo(MENU_DUPLICATE,R.string.duplicate));
  return menus;
}
Program: 171897
Project: 171897
Buggy source:
@Override public boolean isChargingLoopActive(){
  if (getChargingLoopCounter() < 10) {
    setChargingLoopCounter(getChargingLoopCounter() + 1);
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
@Override public boolean isChargingLoopActive(){
  if (getChargingLoopCounter() < 100) {
    setChargingLoopCounter(getChargingLoopCounter() + 1);
    return true;
  }
 else   return false;
}
Program: 171902
Project: 171902
Buggy source:
@Override public CertificateChainType getContractCertificateChain(){
  return SecurityUtils.getCertificateChain("String_Node_Str");
}

Fixed version (ground truth):
@Override public CertificateChainType getContractCertificateChain(CertificateChainType oldContractCertChain){
  EMAIDType providedEMAID=SecurityUtils.getEMAID(oldContractCertChain);
  ArrayList<EMAIDType> authorizedEMAIDs=new ArrayList<EMAIDType>();
  EMAIDType authorizedEMAID1=new EMAIDType();
  authorizedEMAID1.setId("String_Node_Str");
  authorizedEMAID1.setValue("String_Node_Str");
  EMAIDType authorizedEMAID2=new EMAIDType();
  authorizedEMAID2.setId("String_Node_Str");
  authorizedEMAID2.setValue("String_Node_Str");
  authorizedEMAIDs.add(authorizedEMAID1);
  authorizedEMAIDs.add(authorizedEMAID2);
  boolean emaidFound=false;
  for (  EMAIDType emaid : authorizedEMAIDs) {
    if (emaid.getValue().equals(providedEMAID.getValue()))     emaidFound=true;
  }
  if (emaidFound)   return SecurityUtils.getCertificateChain("String_Node_Str");
 else {
    getLogger().warn("String_Node_Str" + providedEMAID.getValue() + "String_Node_Str"+ "String_Node_Str");
    return null;
  }
}
Program: 171903
Project: 171903
Buggy source:
@Override public SAScheduleListType getSAScheduleList(int maxEntriesSAScheduleTuple,HashMap<String,byte[]> xmlSignatureRefElements){
  PMaxScheduleType pMaxSchedule=new PMaxScheduleType();
  pMaxSchedule.getPMaxScheduleEntry().add(createPMaxScheduleEntry("String_Node_Str",(short)11,0,86400L));
  SalesTariffType salesTariff=new SalesTariffType();
  salesTariff.setId("String_Node_Str");
  salesTariff.setSalesTariffID((short)1);
  salesTariff.getSalesTariffEntry().add(createSalesTariffEntry(0L,(short)1));
  salesTariff.getSalesTariffEntry().add(createSalesTariffEntry(1800L,(short)4));
  salesTariff.getSalesTariffEntry().add(createSalesTariffEntry(3600L,(short)2));
  salesTariff.getSalesTariffEntry().add(createSalesTariffEntry(5400L,(short)3));
  SAScheduleTupleType saScheduleTuple=new SAScheduleTupleType();
  saScheduleTuple.setSAScheduleTupleID((short)1);
  saScheduleTuple.setPMaxSchedule(pMaxSchedule);
  saScheduleTuple.setSalesTariff(salesTariff);
  SAScheduleListType saScheduleList=new SAScheduleListType();
  saScheduleList.getSAScheduleTuple().add(saScheduleTuple);
  if (saScheduleTuple.getSalesTariff() != null) {
    xmlSignatureRefElements.put(salesTariff.getId(),SecurityUtils.generateDigest(getCommSessionContext().getMessageHandler().getJaxbElement(salesTariff)));
  }
  return saScheduleList;
}

Fixed version (ground truth):
@Override public SAScheduleListType getSAScheduleList(int maxEntriesSAScheduleTuple,long departureTime,HashMap<String,byte[]> xmlSignatureRefElements){
  PMaxScheduleType pMaxSchedule=new PMaxScheduleType();
  if (departureTime != 0)   pMaxSchedule.getPMaxScheduleEntry().add(createPMaxScheduleEntry("String_Node_Str",(short)11,0,departureTime));
 else   pMaxSchedule.getPMaxScheduleEntry().add(createPMaxScheduleEntry("String_Node_Str",(short)11,0,86400L));
  SalesTariffType salesTariff=new SalesTariffType();
  salesTariff.setId("String_Node_Str");
  salesTariff.setSalesTariffID((short)1);
  salesTariff.getSalesTariffEntry().add(createSalesTariffEntry(0L,(short)1));
  SAScheduleTupleType saScheduleTuple=new SAScheduleTupleType();
  saScheduleTuple.setSAScheduleTupleID((short)1);
  saScheduleTuple.setPMaxSchedule(pMaxSchedule);
  saScheduleTuple.setSalesTariff(salesTariff);
  SAScheduleListType saScheduleList=new SAScheduleListType();
  saScheduleList.getSAScheduleTuple().add(saScheduleTuple);
  if (saScheduleTuple.getSalesTariff() != null) {
    xmlSignatureRefElements.put(salesTariff.getId(),SecurityUtils.generateDigest(getCommSessionContext().getMessageHandler().getJaxbElement(salesTariff)));
  }
  return saScheduleList;
}
Program: 171904
Project: 171904
Buggy source:
/** 
 * Provides a certificate chain coming from a secondary actor with the leaf certificate being  the contract certificate and possible intermediate certificates (sub CAs) included.
 * @return Certificate chain for contract certificate
 */
public CertificateChainType getContractCertificateChain();

Fixed version (ground truth):
/** 
 * Provides a certificate chain coming from a secondary actor with the leaf certificate being  the contract certificate and possible intermediate certificates (Sub-CAs) included.
 * @param oemProvisioningCert The OEM provisioning certificate
 * @return Certificate chain for contract certificate
 */
public CertificateChainType getContractCertificateChain(X509Certificate oemProvisioningCert);
Program: 171905
Project: 171905
Buggy source:
/** 
 * Provides a list of schedules coming from a secondary actor (SAScheduleList) with pMax values and optional tariff incentives which shall influence the charging behaviour of the EV.
 * @param maxEntriesSAScheduleTuple The maximum number of PMaxEntries and SalesTariff entries allowed by EVCC
 * @param xmlSignatureRefElements Signature reference parameter provided to put sales tariff IDs and sales tariffs in
 * @return An SASchedulesType element with a list of secondary actor schedules 
 */
public SAScheduleListType getSAScheduleList(int maxEntriesSAScheduleTuple,HashMap<String,byte[]> xmlSignatureRefElements);

Fixed version (ground truth):
/** 
 * Provides a list of schedules coming from a secondary actor (SAScheduleList) with pMax values and optional tariff incentives which shall influence the charging behaviour of the EV.
 * @param maxEntriesSAScheduleTuple The maximum number of PMaxEntries and SalesTariff entries allowed by EVCC
 * @param departureTime The departure time provided by the EV
 * @param xmlSignatureRefElements Signature reference parameter provided to put sales tariff IDs and sales tariffs in
 * @return An SASchedulesType element with a list of secondary actor schedules 
 */
public SAScheduleListType getSAScheduleList(int maxEntriesSAScheduleTuple,long departureTime,HashMap<String,byte[]> xmlSignatureRefElements);