nus-yam/ex-repair huggingface dataset:
Program: 170628
Project: 170628
Buggy source:
@Override public void touch(float x,float y){
synchronized (lineData) {
    for (    LineDataSet line : getDataSet()) {
      if (line.isHighlightedVerticalEnable() && !line.getValues().isEmpty()) {
        int offset=line.getStartIndexOffset();
        int index=getEntryIndexByCoordinate(x,y) - offset;
        if (index > 0 && index < line.getValues().size()) {
          final PointValue pointValue=line.getEntryForIndex(index);
          float xPosition=pointValue.getX();
          float yPosition=pointValue.getY();
          if (xPosition > 0 && yPosition > 0) {
            highlight.setX(xPosition);
            highlight.setY(yPosition);
            highlight.setDataIndex(index);
            chart.highlightValue(highlight);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void touch(float x,float y){
synchronized (lineData) {
    for (    LineDataSet line : getDataSet()) {
      if (line.isHighlightedVerticalEnable() && !line.getValues().isEmpty()) {
        int offset=line.getStartIndexOffset();
        int index=getEntryIndexByCoordinate(x,y) - offset;
        if (index > 0 && index < line.getValues().size()) {
          final PointValue pointValue=line.getEntryForIndex(index);
          float xPosition=pointValue.getX();
          float yPosition=pointValue.getY();
          if (xPosition >= 0 && yPosition >= 0) {
            highlight.setX(xPosition);
            highlight.setY(yPosition);
            highlight.setDataIndex(index);
            chart.highlightValue(highlight);
          }
        }
      }
    }
  }
}
Program: 170629
Project: 170629
Buggy source:
@Override public final void renderer(Canvas canvas){
  int width=mContentRect.width();
  int height=mContentRect.height();
  if (mDrawBitmap == null || (mDrawBitmap.get().getWidth() != width) || (mDrawBitmap.get().getHeight() != height)) {
    if (width > 0 && height > 0) {
      mDrawBitmap=new WeakReference<>(Bitmap.createBitmap(width,height,mBitmapConfig));
      mBitmapCanvas=new Canvas(mDrawBitmap.get());
    }
 else     return;
  }
  mDrawBitmap.get().eraseColor(Color.TRANSPARENT);
  renderDataSet(mBitmapCanvas);
  canvas.drawBitmap(mDrawBitmap.get(),mContentRect.left,mContentRect.top,mRenderPaint);
}

Fixed version (ground truth):
@Override public final void renderer(Canvas canvas){
  int width=mContentRect.width() + mContentRect.left;
  int height=mContentRect.height();
  if (mDrawBitmap == null || (mDrawBitmap.get().getWidth() != width) || (mDrawBitmap.get().getHeight() != height)) {
    if (width > 0 && height > 0) {
      mDrawBitmap=new WeakReference<>(Bitmap.createBitmap(width,height,mBitmapConfig));
      mBitmapCanvas=new Canvas(mDrawBitmap.get());
    }
 else     return;
  }
  mDrawBitmap.get().eraseColor(Color.TRANSPARENT);
  renderDataSet(mBitmapCanvas);
  canvas.drawBitmap(mDrawBitmap.get(),0,0,mRenderPaint);
}
Program: 170630
Project: 170630
Buggy source:
@Override protected void setDataBindingVariables(ViewDataBinding binding){
  LayoutCombineChartBinding b=(LayoutCombineChartBinding)binding;
  CandlestickDataSet dataSet=new CandlestickDataSet(candlestickValues);
  dataSet.setHighlightedVerticalEnable(true);
  dataSet.setMaxVisibleEntry(20);
  b.combineChart.setHighlightColor(Color.BLACK);
  b.combineChart.setOnHighlightStatusChangeListener(highlightStatusChangeListener);
  b.combineChart.setDataSet(dataSet);
}

Fixed version (ground truth):
@Override protected void setDataBindingVariables(ViewDataBinding binding){
  LayoutCombineChartBinding b=(LayoutCombineChartBinding)binding;
  CandlestickDataSet dataSet=new CandlestickDataSet(candlestickValues);
  dataSet.setHighlightedVerticalEnable(true);
  dataSet.setMaxVisibleEntry(20);
  b.combineChart.getAxisLeft().setAxisPosition(LEFT_OUTSIDE);
  b.combineChart.getAxisRight().setAxisPosition(RIGHT_INSIDE);
  b.combineChart.setHighlightColor(Color.BLACK);
  b.combineChart.setOnHighlightStatusChangeListener(highlightStatusChangeListener);
  b.combineChart.setDataSet(dataSet);
}
Program: 170631
Project: 170631
Buggy source:
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  super.onSizeChanged(w,h,oldw,oldh);
  mContentRect.set(getPaddingLeft() + mAxisLeft.getMaxLabelWidth() + (mAxisLeft.isInside() ? 0 : mAxisLeft.getLabelSeparation()),getPaddingTop(),getWidth() - getPaddingRight(),getHeight() - getPaddingBottom() - mAxisBottom.getLabelHeight()- mAxisBottom.getLabelSeparation());
}

Fixed version (ground truth):
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  mContentRect.set(getPaddingLeft() + (mAxisLeft.isInside() ? 0 : mAxisLeft.getLabelWidth()) + (mAxisLeft.isInside() ? 0 : mAxisLeft.getLabelSeparation()),getPaddingTop(),getWidth() - getPaddingRight() - (mAxisRight.isInside() ? 0 : mAxisRight.getLabelWidth()),getHeight() - getPaddingBottom() - mAxisBottom.getLabelHeight()- mAxisBottom.getLabelSeparation());
}
Program: 170632
Project: 170632
Buggy source:
public void moveRight(@FloatRange(from=0f,to=1.0f) float percent){
  releaseEdgeEffects();
  computeScrollSurfaceSize(mSurfaceSizeBuffer);
  mScrollerStartViewport.set(mCurrentViewport);
  float moveDistance=getWidth() * percent;
  int startX=(int)(mSurfaceSizeBuffer.x * (mScrollerStartViewport.left - Viewport.AXIS_X_MIN) / (Viewport.AXIS_X_MAX - Viewport.AXIS_X_MIN));
  if (!mScroller.isFinished()) {
    mScroller.forceFinished(true);
  }
  mScroller.startScroll(startX,0,(int)moveDistance,0,300);
  ViewCompat.postInvalidateOnAnimation(this);
}

Fixed version (ground truth):
public void moveRight(@FloatRange(from=0f,to=1.0f) float percent){
  releaseEdgeEffects();
  computeScrollSurfaceSize(mSurfaceSizeBuffer);
  mScrollerStartViewport.set(mCurrentViewport);
  float moveDistance=mContentRect.width() * percent;
  int startX=(int)(mSurfaceSizeBuffer.x * (mScrollerStartViewport.left - Viewport.AXIS_X_MIN) / (Viewport.AXIS_X_MAX - Viewport.AXIS_X_MIN));
  if (!mScroller.isFinished()) {
    mScroller.forceFinished(true);
  }
  mScroller.startScroll(startX,0,(int)moveDistance,0,300);
  ViewCompat.postInvalidateOnAnimation(this);
}
Program: 170633
Project: 170633
Buggy source:
public void moveLeft(@FloatRange(from=0f,to=1.0f) float percent){
  releaseEdgeEffects();
  computeScrollSurfaceSize(mSurfaceSizeBuffer);
  mScrollerStartViewport.set(mCurrentViewport);
  float moveDistance=getWidth() * percent;
  int startX=(int)(mSurfaceSizeBuffer.x * (mScrollerStartViewport.left - Viewport.AXIS_X_MIN) / (Viewport.AXIS_X_MAX - Viewport.AXIS_X_MIN));
  if (!mScroller.isFinished()) {
    mScroller.forceFinished(true);
  }
  mScroller.startScroll(startX,0,(int)-moveDistance,0,300);
  ViewCompat.postInvalidateOnAnimation(this);
}

Fixed version (ground truth):
public void moveLeft(@FloatRange(from=0f,to=1.0f) float percent){
  releaseEdgeEffects();
  computeScrollSurfaceSize(mSurfaceSizeBuffer);
  mScrollerStartViewport.set(mCurrentViewport);
  float moveDistance=mContentRect.width() * percent;
  int startX=(int)(mSurfaceSizeBuffer.x * (mScrollerStartViewport.left - Viewport.AXIS_X_MIN) / (Viewport.AXIS_X_MAX - Viewport.AXIS_X_MIN));
  if (!mScroller.isFinished()) {
    mScroller.forceFinished(true);
  }
  mScroller.startScroll(startX,0,(int)-moveDistance,0,300);
  ViewCompat.postInvalidateOnAnimation(this);
}
Program: 170634
Project: 170634
Buggy source:
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  drawAxis(canvas);
  int clipRestoreCount=canvas.save();
  canvas.clipRect(mContentRect);
  render(canvas);
  drawEdgeEffectsUnclipped(canvas);
  canvas.restoreToCount(clipRestoreCount);
  drawLabels(canvas);
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  drawAxis(canvas);
  int clipRestoreCount=canvas.save();
  canvas.clipRect(mContentRect);
  render(canvas);
  canvas.restoreToCount(clipRestoreCount);
  drawEdgeEffectsUnclipped(canvas);
  drawLabels(canvas);
}
Program: 170635
Project: 170635
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int minChartSize=getResources().getDimensionPixelSize(R.dimen.jz_chart_min_size);
  setMeasuredDimension(Math.max(getSuggestedMinimumWidth(),resolveSize(minChartSize + getPaddingLeft() + (mAxisLeft.isInside() ? 0 : mAxisLeft.getMaxLabelWidth())+ (mAxisLeft.isInside() ? 0 : mAxisLeft.getLabelSeparation())+ getPaddingRight(),widthMeasureSpec)),Math.max(getSuggestedMinimumHeight(),resolveSize(minChartSize + getPaddingTop() + (mAxisBottom.isInside() ? 0 : mAxisBottom.getLabelHeight())+ (mAxisBottom.isInside() ? 0 : mAxisBottom.getLabelSeparation())+ getPaddingBottom(),heightMeasureSpec)));
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int minChartSize=getResources().getDimensionPixelSize(R.dimen.jz_chart_min_size);
  setMeasuredDimension(Math.max(getSuggestedMinimumWidth(),resolveSize(minChartSize + getPaddingLeft() + (mAxisLeft.isInside() ? 0 : mAxisLeft.getLabelWidth())+ (mAxisLeft.isInside() ? 0 : mAxisLeft.getLabelSeparation())+ getPaddingRight(),widthMeasureSpec)),Math.max(getSuggestedMinimumHeight(),resolveSize(minChartSize + getPaddingTop() + (mAxisBottom.isInside() ? 0 : mAxisBottom.getLabelHeight())+ (mAxisBottom.isInside() ? 0 : mAxisBottom.getLabelSeparation())+ getPaddingBottom(),heightMeasureSpec)));
}
Program: 170636
Project: 170636
Buggy source:
@Override public final void renderer(Canvas canvas){
  int width=mContentRect.width();
  int height=mContentRect.height();
  if (mDrawBitmap == null || (mDrawBitmap.get().getWidth() != width) || (mDrawBitmap.get().getHeight() != height)) {
    if (width > 0 && height > 0) {
      mDrawBitmap=new WeakReference<>(Bitmap.createBitmap(width,height,mBitmapConfig));
      mBitmapCanvas=new Canvas(mDrawBitmap.get());
    }
 else     return;
  }
  mDrawBitmap.get().eraseColor(Color.TRANSPARENT);
  renderDataSet(mBitmapCanvas);
  canvas.drawBitmap(mDrawBitmap.get(),0,0,mRenderPaint);
}

Fixed version (ground truth):
@Override public final void renderer(Canvas canvas){
  int width=mContentRect.width();
  int height=mContentRect.height();
  if (mDrawBitmap == null || (mDrawBitmap.get().getWidth() != width) || (mDrawBitmap.get().getHeight() != height)) {
    if (width > 0 && height > 0) {
      mDrawBitmap=new WeakReference<>(Bitmap.createBitmap(width,height,mBitmapConfig));
      mBitmapCanvas=new Canvas(mDrawBitmap.get());
    }
 else     return;
  }
  mDrawBitmap.get().eraseColor(Color.TRANSPARENT);
  renderDataSet(mBitmapCanvas);
  canvas.drawBitmap(mDrawBitmap.get(),mContentRect.left,mContentRect.top,mRenderPaint);
}
Program: 170637
Project: 170637
Buggy source:
@Override public void renderer(Canvas canvas){
  int i;
  if (mAxis instanceof AxisX) {
    computeAxisStopsX(mCurrentViewport.left,mCurrentViewport.right,(AxisX)mAxis,null);
  }
 else   if (mAxis instanceof AxisY) {
    computeAxisStopsY((AxisY)mAxis);
  }
  drawAxisLine(canvas);
  if (mAxis.isGridLineEnable()) {
    drawGridLines(canvas);
  }
}

Fixed version (ground truth):
@Override public void renderer(Canvas canvas){
  if (mAxis instanceof AxisX) {
    computeAxisStopsX(mCurrentViewport.left,mCurrentViewport.right,(AxisX)mAxis,null);
  }
 else   if (mAxis instanceof AxisY) {
    computeAxisStopsY((AxisY)mAxis);
  }
  drawAxisLine(canvas);
  if (mAxis.isGridLineEnable()) {
    drawGridLines(canvas);
  }
}
Program: 170638
Project: 170638
Buggy source:
public void initPaints(){
  mGridPaint=new Paint();
  mGridPaint.setStrokeWidth(mAxis.getGridThickness());
  mGridPaint.setColor(mAxis.getGridColor());
  mGridPaint.setStyle(Paint.Style.STROKE);
  mLabelTextPaint=new Paint();
  mLabelTextPaint.setAntiAlias(true);
  mLabelTextPaint.setTextSize(mAxis.getLabelTextSize());
  mLabelTextPaint.setColor(mAxis.getLabelTextColor());
  mAxis.setMaxLabelWidth((int)mLabelTextPaint.measureText("String_Node_Str"));
  mAxis.setLabelHeight((int)Math.abs(mLabelTextPaint.getFontMetrics().top));
  mAxisPaint=new Paint();
  mAxisPaint.setStrokeWidth(mAxis.getAxisThickness());
  mAxisPaint.setColor(mAxis.getAxisColor());
  mAxisPaint.setStyle(Paint.Style.STROKE);
}

Fixed version (ground truth):
public void initPaints(){
  mGridPaint=new Paint();
  mGridPaint.setStrokeWidth(mAxis.getGridThickness());
  mGridPaint.setColor(mAxis.getGridColor());
  mGridPaint.setStyle(Paint.Style.STROKE);
  mLabelTextPaint=new Paint();
  mLabelTextPaint.setAntiAlias(true);
  mLabelTextPaint.setTextSize(mAxis.getLabelTextSize());
  mLabelTextPaint.setColor(mAxis.getLabelTextColor());
  mAxis.setLabelWidth((int)mLabelTextPaint.measureText("String_Node_Str"));
  mAxis.setLabelHeight((int)Math.abs(mLabelTextPaint.getFontMetrics().top));
  mAxisPaint=new Paint();
  mAxisPaint.setStrokeWidth(mAxis.getAxisThickness());
  mAxisPaint.setColor(mAxis.getAxisColor());
  mAxisPaint.setStyle(Paint.Style.STROKE);
}
Program: 170640
Project: 170640
Buggy source:
@Override protected void setDataBindingVariables(ViewDataBinding binding){
  LayoutCombineChartBinding chartBinding=(LayoutCombineChartBinding)binding;
  chartBinding.combineChart.addDataSet(barDataSet);
  chartBinding.combineChart.addDataSet(line);
}

Fixed version (ground truth):
@Override protected void setDataBindingVariables(ViewDataBinding binding){
  LayoutCombineChartBinding chartBinding=(LayoutCombineChartBinding)binding;
  chartBinding.combineChart.enableHighlightDashPathEffect(new float[]{10,10},10);
  chartBinding.combineChart.addDataSet(barDataSet);
  chartBinding.combineChart.addDataSet(line);
}
Program: 170642
Project: 170642
Buggy source:
@Override @Nullable @Contract("String_Node_Str") public <T>T fromByteArray(@Nullable byte[] bytes,@NotNull Serializer<T> serializer) throws IOException, ClassNotFoundException {
  if (bytes == null || bytes.length == 0) {
    return null;
  }
  final SerializerInput serializerInput=new ByteBufferSerializerInput(bytes);
  try {
    return serializer.deserialize(mContext,serializerInput);
  }
 catch (  IOException|ClassNotFoundException|IllegalStateException e) {
    throw e;
  }
}

Fixed version (ground truth):
@Override @Nullable @Contract("String_Node_Str") public <T>T fromByteArray(@Nullable byte[] bytes,@NotNull Serializer<T> serializer) throws IOException, ClassNotFoundException {
  if (bytes == null || bytes.length == 0) {
    return null;
  }
  final SerializerInput serializerInput=new ByteBufferSerializerInput(bytes);
  try {
    return serializer.deserialize(mContext,serializerInput);
  }
 catch (  IOException|ClassNotFoundException|IllegalStateException e) {
    throw new SerializationException("String_Node_Str" + SerializationUtils.dumpSerializedData(bytes,serializerInput.getPosition(),mContext.isDebug()),e);
  }
}
Program: 170643
Project: 170643
Buggy source:
@NotNull private String decodeUtf8String(int length) throws IOException {
  try {
    final ByteBuffer buffer=mByteBuffer;
    final StringBuilder builder=new StringBuilder(length);
    for (int i=0; i < length; ++i) {
      final int b1=buffer.get();
      if ((b1 & 0x80) >= 0) {
        builder.append((char)b1);
      }
 else       if ((b1 & 0xE0) == 0xC0) {
        final int b2=buffer.get();
        builder.append((char)(((b1 << 6) ^ b2) ^ 0x0f80));
      }
 else       if ((b1 & 0xF0) == 0xE0) {
        final int b2=buffer.get();
        final int b3=buffer.get();
        builder.append((char)(((b1 << 12) ^ (b2 << 6) ^ b3) ^ 0x1f80));
      }
 else       if ((b1 & 0xF8) == 0xF0) {
        final int b2=buffer.get();
        final int b3=buffer.get();
        final int b4=buffer.get();
        final int code=((b1 & 0x07) << 18) | ((b2 & 0x3f) << 12) | ((b3 & 0x3f) << 6)| (b4 & 0x3f);
        builder.append(Surrogate.highSurrogate(code));
        builder.append(Surrogate.lowSurrogate(code));
        ++i;
      }
 else {
        throw new SerializationException("String_Node_Str");
      }
    }
    return builder.toString();
  }
 catch (  BufferUnderflowException ignore) {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@NotNull private String decodeUtf8String(int length) throws IOException {
  try {
    final ByteBuffer buffer=mByteBuffer;
    final StringBuilder builder=new StringBuilder(length);
    for (int i=0; i < length; ++i) {
      final int b1=buffer.get();
      if ((b1 & 0x80) == 0) {
        builder.append((char)b1);
      }
 else       if ((b1 & 0xE0) == 0xC0) {
        final int b2=buffer.get();
        builder.append((char)(((b1 << 6) ^ b2) ^ 0x0f80));
      }
 else       if ((b1 & 0xF0) == 0xE0) {
        final int b2=buffer.get();
        final int b3=buffer.get();
        builder.append((char)(((b1 << 12) ^ (b2 << 6) ^ b3) ^ 0x1f80));
      }
 else       if ((b1 & 0xF8) == 0xF0) {
        final int b2=buffer.get();
        final int b3=buffer.get();
        final int b4=buffer.get();
        final int code=((b1 & 0x07) << 18) | ((b2 & 0x3f) << 12) | ((b3 & 0x3f) << 6)| (b4 & 0x3f);
        builder.append(Surrogate.highSurrogate(code));
        builder.append(Surrogate.lowSurrogate(code));
        ++i;
      }
 else {
        throw new SerializationException("String_Node_Str");
      }
    }
    return builder.toString();
  }
 catch (  BufferUnderflowException ignore) {
    throw new EOFException();
  }
}
Program: 170645
Project: 170645
Buggy source:
@Override public synchronized Throwable fillInStackTrace(){
  return this;
}

Fixed version (ground truth):
@Override public synchronized Throwable fillInStackTrace(){
  setStackTrace(new StackTraceElement[0]);
  return this;
}
Program: 170646
Project: 170646
Buggy source:
/** 
 * Creates a new music folder.
 * @param musicFolder The music folder to create.
 */
public void createMusicFolder(MusicFolder musicFolder){
  String sql="String_Node_Str" + INSERT_COLUMNS + "String_Node_Str";
  update(sql,musicFolder.getPath(),musicFolder.getName(),musicFolder.isEnabled(),musicFolder.getChanged());
  Integer id=queryForInt("String_Node_Str",0);
  update("String_Node_Str" + userDao.getUserTable(),id);
  LOG.info("String_Node_Str" + musicFolder.getPath());
}

Fixed version (ground truth):
/** 
 * Creates a new music folder.
 * @param musicFolder The music folder to create.
 */
public void createMusicFolder(MusicFolder musicFolder){
  String sql="String_Node_Str" + INSERT_COLUMNS + "String_Node_Str";
  update(sql,musicFolder.getPath().getPath(),musicFolder.getName(),musicFolder.isEnabled(),musicFolder.getChanged());
  Integer id=queryForInt("String_Node_Str",0);
  update("String_Node_Str" + userDao.getUserTable(),id);
  LOG.info("String_Node_Str" + musicFolder.getPath());
}
Program: 170647
Project: 170647
Buggy source:
/** 
 * Creates a new player.
 * @param player The player to create.
 */
public synchronized void createPlayer(Player player){
  int id=getJdbcTemplate().queryForObject("String_Node_Str",Integer.class) + 1;
  player.setId(String.valueOf(id));
  String sql="String_Node_Str" + COLUMNS + "String_Node_Str"+ questionMarks(COLUMNS)+ "String_Node_Str";
  update(sql,player.getId(),player.getName(),player.getType(),player.getUsername(),player.getIpAddress(),player.isAutoControlEnabled(),player.isM3uBomEnabled(),player.getLastSeen(),CoverArtScheme.MEDIUM.name(),player.getTranscodeScheme().name(),player.isDynamicIp(),player.getTechnology().name(),player.getClientId());
  addPlaylist(player);
  LOG.info("String_Node_Str" + id + '.');
}

Fixed version (ground truth):
/** 
 * Creates a new player.
 * @param player The player to create.
 */
public synchronized void createPlayer(Player player){
  Integer existingMax=getJdbcTemplate().queryForObject("String_Node_Str",Integer.class);
  if (existingMax == null) {
    existingMax=0;
  }
  int id=existingMax + 1;
  player.setId(String.valueOf(id));
  String sql="String_Node_Str" + COLUMNS + "String_Node_Str"+ questionMarks(COLUMNS)+ "String_Node_Str";
  update(sql,player.getId(),player.getName(),player.getType(),player.getUsername(),player.getIpAddress(),player.isAutoControlEnabled(),player.isM3uBomEnabled(),player.getLastSeen(),CoverArtScheme.MEDIUM.name(),player.getTranscodeScheme().name(),player.isDynamicIp(),player.getTechnology().name(),player.getClientId());
  addPlaylist(player);
  LOG.info("String_Node_Str" + id + '.');
}
Program: 170648
Project: 170648
Buggy source:
/** 
 * Creates a new transcoding.
 * @param transcoding The transcoding to create.
 */
public synchronized void createTranscoding(Transcoding transcoding){
  int id=getJdbcTemplate().queryForObject("String_Node_Str",Integer.class);
  transcoding.setId(id);
  String sql="String_Node_Str" + COLUMNS + "String_Node_Str"+ questionMarks(COLUMNS)+ "String_Node_Str";
  update(sql,transcoding.getId(),transcoding.getName(),transcoding.getSourceFormats(),transcoding.getTargetFormat(),transcoding.getStep1(),transcoding.getStep2(),transcoding.getStep3(),transcoding.isDefaultActive());
  LOG.info("String_Node_Str" + transcoding.getName());
}

Fixed version (ground truth):
/** 
 * Creates a new transcoding.
 * @param transcoding The transcoding to create.
 */
public synchronized void createTranscoding(Transcoding transcoding){
  Integer existingMax=getJdbcTemplate().queryForObject("String_Node_Str",Integer.class);
  if (existingMax == null) {
    existingMax=0;
  }
  transcoding.setId(existingMax + 1);
  String sql="String_Node_Str" + COLUMNS + "String_Node_Str"+ questionMarks(COLUMNS)+ "String_Node_Str";
  update(sql,transcoding.getId(),transcoding.getName(),transcoding.getSourceFormats(),transcoding.getTargetFormat(),transcoding.getStep1(),transcoding.getStep2(),transcoding.getStep3(),transcoding.isDefaultActive());
  LOG.info("String_Node_Str" + transcoding.getName());
}
Program: 170649
Project: 170649
Buggy source:
/** 
 * Creates a new player.
 * @param player The player to create.
 */
public synchronized void createPlayer(Player player){
  int id=getJdbcTemplate().queryForObject("String_Node_Str",Integer.class) + 1;
  player.setId(String.valueOf(id));
  String sql="String_Node_Str" + COLUMNS + "String_Node_Str"+ questionMarks(COLUMNS)+ "String_Node_Str";
  update(sql,player.getId(),player.getName(),player.getType(),player.getUsername(),player.getIpAddress(),player.isAutoControlEnabled(),player.getLastSeen(),CoverArtScheme.MEDIUM.name(),player.getTranscodeScheme().name(),player.isDynamicIp(),player.getTechnology().name(),player.getClientId());
  addPlaylist(player);
  LOG.info("String_Node_Str" + id + '.');
}

Fixed version (ground truth):
/** 
 * Creates a new player.
 * @param player The player to create.
 */
public synchronized void createPlayer(Player player){
  Integer existingMax=getJdbcTemplate().queryForObject("String_Node_Str",Integer.class);
  if (existingMax == null) {
    existingMax=0;
  }
  int id=existingMax + 1;
  player.setId(String.valueOf(id));
  String sql="String_Node_Str" + COLUMNS + "String_Node_Str"+ questionMarks(COLUMNS)+ "String_Node_Str";
  update(sql,player.getId(),player.getName(),player.getType(),player.getUsername(),player.getIpAddress(),player.isAutoControlEnabled(),player.getLastSeen(),CoverArtScheme.MEDIUM.name(),player.getTranscodeScheme().name(),player.isDynamicIp(),player.getTechnology().name(),player.getClientId());
  addPlaylist(player);
  LOG.info("String_Node_Str" + id + '.');
}
Program: 170650
Project: 170650
Buggy source:
/** 
 * Creates a new transcoding.
 * @param transcoding The transcoding to create.
 */
public synchronized void createTranscoding(Transcoding transcoding){
  int id=getJdbcTemplate().queryForObject("String_Node_Str",Integer.class);
  transcoding.setId(id);
  String sql="String_Node_Str" + COLUMNS + "String_Node_Str"+ questionMarks(COLUMNS)+ "String_Node_Str";
  update(sql,transcoding.getId(),transcoding.getName(),transcoding.getSourceFormats(),transcoding.getTargetFormat(),transcoding.getStep1(),transcoding.getStep2(),transcoding.getStep3(),transcoding.isDefaultActive());
  LOG.info("String_Node_Str" + transcoding.getName());
}

Fixed version (ground truth):
/** 
 * Creates a new transcoding.
 * @param transcoding The transcoding to create.
 */
public synchronized void createTranscoding(Transcoding transcoding){
  Integer existingMax=getJdbcTemplate().queryForObject("String_Node_Str",Integer.class);
  if (existingMax == null) {
    existingMax=0;
  }
  transcoding.setId(existingMax + 1);
  String sql="String_Node_Str" + COLUMNS + "String_Node_Str"+ questionMarks(COLUMNS)+ "String_Node_Str";
  update(sql,transcoding.getId(),transcoding.getName(),transcoding.getSourceFormats(),transcoding.getTargetFormat(),transcoding.getStep1(),transcoding.getStep2(),transcoding.getStep3(),transcoding.isDefaultActive());
  LOG.info("String_Node_Str" + transcoding.getName());
}
Program: 170651
Project: 170651
Buggy source:
public void setLocale(){
  Locale locale=settings.getLocale();
  Locale.setDefault(locale);
  Configuration config=new Configuration();
  config.locale=locale;
  getBaseContext().getResources().updateConfiguration(config,getBaseContext().getResources().getDisplayMetrics());
}

Fixed version (ground truth):
public void setLocale(){
  Locale locale=settings.getLocale();
  Locale.setDefault(locale);
  Resources resources=getBaseContext().getResources();
  Configuration config=resources.getConfiguration();
  config.locale=locale;
  resources.updateConfiguration(config,resources.getDisplayMetrics());
}
Program: 170652
Project: 170652
Buggy source:
public void checkPassword(String plainPassword){
  if (!oldPassword) {
    try {
      EncryptionHelper.PBKDF2Credentials credentials=EncryptionHelper.generatePBKDF2Credentials(plainPassword,settings.getSalt(),settings.getIterations());
      byte[] passwordArray=Base64.decode(password,Base64.URL_SAFE);
      if (Arrays.equals(passwordArray,credentials.password)) {
        finishWithResult(true,credentials.key);
      }
 else {
        finishWithResult(false,null);
      }
    }
 catch (    NoSuchAlgorithmException|InvalidKeySpecException e) {
      e.printStackTrace();
      finishWithResult(false,null);
    }
  }
 else {
    String hashedPassword=new String(Hex.encodeHex(DigestUtils.sha256(plainPassword)));
    if (hashedPassword.equals(password)) {
      byte[] key=settings.setAuthCredentials(plainPassword);
      if (key == null)       Toast.makeText(this,R.string.settings_toast_auth_upgrade_failed,Toast.LENGTH_LONG).show();
      if (authMethod == AuthMethod.PASSWORD)       settings.removeAuthPasswordHash();
 else       if (authMethod == AuthMethod.PIN)       settings.removeAuthPINHash();
      finishWithResult(true,key);
    }
 else {
      finishWithResult(false,null);
    }
  }
}

Fixed version (ground truth):
public void checkPassword(String plainPassword){
  if (!oldPassword) {
    try {
      EncryptionHelper.PBKDF2Credentials credentials=EncryptionHelper.generatePBKDF2Credentials(plainPassword,settings.getSalt(),settings.getIterations());
      byte[] passwordArray=Base64.decode(password,Base64.URL_SAFE);
      if (Arrays.equals(passwordArray,credentials.password)) {
        finishWithResult(true,credentials.key);
      }
 else {
        finishWithResult(false,null);
      }
    }
 catch (    NoSuchAlgorithmException|InvalidKeySpecException|IllegalArgumentException e) {
      e.printStackTrace();
      finishWithResult(false,null);
    }
  }
 else {
    String hashedPassword=new String(Hex.encodeHex(DigestUtils.sha256(plainPassword)));
    if (hashedPassword.equals(password)) {
      byte[] key=settings.setAuthCredentials(plainPassword);
      if (key == null)       Toast.makeText(this,R.string.settings_toast_auth_upgrade_failed,Toast.LENGTH_LONG).show();
      if (authMethod == AuthMethod.PASSWORD)       settings.removeAuthPasswordHash();
 else       if (authMethod == AuthMethod.PIN)       settings.removeAuthPINHash();
      finishWithResult(true,key);
    }
 else {
      finishWithResult(false,null);
    }
  }
}
Program: 170653
Project: 170653
Buggy source:
@Override public void onCreate(){
  String prefs=getDefaultSharedPreferencesName();
  SharedPreferencesBackupHelper sharedPreferencesBackupHelper=new SharedPreferencesBackupHelper(this,prefs);
  addHelper(PREFS_BACKUP_KEY,sharedPreferencesBackupHelper);
  FileBackupHelper fileBackupHelper=new FileBackupHelper(this,DatabaseHelper.KEY_FILE,DatabaseHelper.SETTINGS_FILE);
  addHelper(FILES_BACKUP_KEY,fileBackupHelper);
}

Fixed version (ground truth):
@Override public void onCreate(){
  String prefs=getDefaultSharedPreferencesName();
  SharedPreferencesBackupHelper sharedPreferencesBackupHelper=new SharedPreferencesBackupHelper(this,prefs);
  addHelper(PREFS_BACKUP_KEY,sharedPreferencesBackupHelper);
  FileBackupHelper fileBackupHelper=new FileBackupHelper(this,Constants.FILENAME_ENCRYPTED_KEY,Constants.FILENAME_DATABASE,Constants.FILENAME_DATABASE_BACKUP);
  addHelper(FILES_BACKUP_KEY,fileBackupHelper);
}
Program: 170654
Project: 170654
Buggy source:
public void updateAuthPassword(String newAuth){
  PasswordHashPreference pwPref=(PasswordHashPreference)catSecurity.findPreference(getString(R.string.settings_key_auth_password));
  PasswordHashPreference pinPref=(PasswordHashPreference)catSecurity.findPreference(getString(R.string.settings_key_auth_pin));
  if (pwPref != null)   catSecurity.removePreference(pwPref);
  if (pinPref != null)   catSecurity.removePreference(pinPref);
switch (newAuth) {
case "String_Node_Str":
    PasswordHashPreference authPassword=new PasswordHashPreference(getActivity(),null);
  authPassword.setTitle(R.string.settings_title_auth_password);
authPassword.setOrder(3);
authPassword.setKey(getString(R.string.settings_key_auth_password_hash));
authPassword.setMode(PasswordHashPreference.Mode.PASSWORD);
catSecurity.addPreference(authPassword);
break;
case "String_Node_Str":
PasswordHashPreference authPIN=new PasswordHashPreference(getActivity(),null);
authPIN.setTitle(R.string.settings_title_auth_pin);
authPIN.setOrder(3);
authPIN.setKey(getString(R.string.settings_key_auth_pin_hash));
authPIN.setMode(PasswordHashPreference.Mode.PIN);
catSecurity.addPreference(authPIN);
break;
default :
break;
}
}

Fixed version (ground truth):
public void updateAuthPassword(String newAuth){
  PasswordHashPreference pwPref=(PasswordHashPreference)catSecurity.findPreference(getString(R.string.settings_key_auth_password_hash));
  PasswordHashPreference pinPref=(PasswordHashPreference)catSecurity.findPreference(getString(R.string.settings_key_auth_pin_hash));
  if (pwPref != null)   catSecurity.removePreference(pwPref);
  if (pinPref != null)   catSecurity.removePreference(pinPref);
switch (newAuth) {
case "String_Node_Str":
    PasswordHashPreference authPassword=new PasswordHashPreference(getActivity(),null);
  authPassword.setTitle(R.string.settings_title_auth_password);
authPassword.setOrder(3);
authPassword.setKey(getString(R.string.settings_key_auth_password_hash));
authPassword.setMode(PasswordHashPreference.Mode.PASSWORD);
catSecurity.addPreference(authPassword);
break;
case "String_Node_Str":
PasswordHashPreference authPIN=new PasswordHashPreference(getActivity(),null);
authPIN.setTitle(R.string.settings_title_auth_pin);
authPIN.setOrder(3);
authPIN.setKey(getString(R.string.settings_key_auth_pin_hash));
authPIN.setMode(PasswordHashPreference.Mode.PIN);
catSecurity.addPreference(authPIN);
break;
default :
break;
}
}
Program: 170656
Project: 170656
Buggy source:
private void showSimpleSnackbar(String msg){
  Snackbar.make(fab,msg,Snackbar.LENGTH_LONG).setCallback(new Snackbar.Callback(){
    @Override public void onDismissed(    Snackbar snackbar,    int event){
      super.onDismissed(snackbar,event);
      if (entries.isEmpty()) {
        showNoAccount();
      }
    }
  }
).show();
}

Fixed version (ground truth):
private void showSimpleSnackbar(String msg){
  Snackbar.make(fab,msg,Snackbar.LENGTH_LONG).addCallback(new Snackbar.Callback(){
    @Override public void onDismissed(    Snackbar snackbar,    int event){
      super.onDismissed(snackbar,event);
      if (entries.isEmpty()) {
        showNoAccount();
      }
    }
  }
).show();
}
Program: 170657
Project: 170657
Buggy source:
public void editEntryLabel(final int pos){
  AlertDialog.Builder builder=new AlertDialog.Builder(this);
  builder.setTitle(R.string.alert_rename);
  final EditText input=new EditText(this);
  input.setText(adapter.getItem(pos).getLabel());
  input.setSingleLine();
  FrameLayout container=new FrameLayout(this);
  FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  params.leftMargin=getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin);
  params.rightMargin=getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin);
  input.setLayoutParams(params);
  container.addView(input);
  builder.setView(container);
  builder.setPositiveButton(R.string.button_save,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
      adapter.getItem(pos).setLabel(input.getEditableText().toString());
      adapter.notifyDataSetChanged();
      SettingsHelper.store(getBaseContext(),entries);
    }
  }
);
  builder.setNegativeButton(R.string.button_cancel,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
      dialogInterface.cancel();
    }
  }
);
  builder.show();
}

Fixed version (ground truth):
public void editEntryLabel(final int pos){
  AlertDialog.Builder builder=new AlertDialog.Builder(this);
  builder.setTitle(R.string.alert_rename);
  final EditText input=new EditText(this);
  input.setText(adapter.getItem(pos).getLabel());
  input.setSingleLine();
  FrameLayout container=new FrameLayout(this);
  FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  params.leftMargin=getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin);
  params.rightMargin=getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin);
  input.setLayoutParams(params);
  container.addView(input);
  builder.setView(container);
  builder.setPositiveButton(R.string.button_save,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
      adapter.getItem(pos).setLabel(input.getEditableText().toString());
      adapter.notifyItemChanged(pos);
      SettingsHelper.store(getBaseContext(),entries);
    }
  }
);
  builder.setNegativeButton(R.string.button_cancel,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
      dialogInterface.cancel();
    }
  }
);
  builder.show();
}
Program: 170658
Project: 170658
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent intent){
  super.onActivityResult(requestCode,resultCode,intent);
  if (requestCode == IntentIntegrator.REQUEST_CODE && resultCode == Activity.RESULT_OK) {
    try {
      Entry e=new Entry(intent.getStringExtra(Intents.Scan.RESULT));
      e.setCurrentOTP(TOTPHelper.generate(e.getSecret(),e.getPeriod()));
      entries.add(e);
      SettingsHelper.store(this,entries);
      adapter.notifyDataSetChanged();
      Snackbar.make(fab,R.string.msg_account_added,Snackbar.LENGTH_LONG).show();
    }
 catch (    Exception e) {
      Snackbar.make(fab,R.string.msg_invalid_qr_code,Snackbar.LENGTH_LONG).setCallback(new Snackbar.Callback(){
        @Override public void onDismissed(        Snackbar snackbar,        int event){
          super.onDismissed(snackbar,event);
          if (entries.isEmpty()) {
            showNoAccount();
          }
        }
      }
).show();
      return;
    }
  }
 else   if (requestCode == INTENT_OPEN_DOCUMENT && resultCode == Activity.RESULT_OK) {
    Uri file=null;
    if (intent != null) {
      file=intent.getData();
      doImportJSON(file);
    }
  }
 else   if (requestCode == INTENT_SAVE_DOCUMENT && resultCode == Activity.RESULT_OK) {
    Uri file=null;
    if (intent != null) {
      file=intent.getData();
      doExportJSON(file);
    }
  }
  if (entries.isEmpty()) {
    showNoAccount();
  }
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent intent){
  super.onActivityResult(requestCode,resultCode,intent);
  if (requestCode == IntentIntegrator.REQUEST_CODE && resultCode == Activity.RESULT_OK) {
    try {
      Entry e=new Entry(intent.getStringExtra(Intents.Scan.RESULT));
      e.setCurrentOTP(TOTPHelper.generate(e.getSecret(),e.getPeriod()));
      entries.add(e);
      SettingsHelper.store(this,entries);
      adapter.notifyDataSetChanged();
      Snackbar.make(fab,R.string.msg_account_added,Snackbar.LENGTH_LONG).show();
    }
 catch (    Exception e) {
      showSimpleSnackbar(R.string.msg_invalid_qr_code);
      return;
    }
  }
 else   if (requestCode == INTENT_OPEN_DOCUMENT && resultCode == Activity.RESULT_OK) {
    Uri file;
    if (intent != null) {
      file=intent.getData();
      doImportJSON(file);
    }
  }
 else   if (requestCode == INTENT_SAVE_DOCUMENT && resultCode == Activity.RESULT_OK) {
    Uri file;
    if (intent != null) {
      file=intent.getData();
      doExportJSON(file);
    }
  }
  if (entries.isEmpty()) {
    showNoAccount();
  }
}
Program: 170659
Project: 170659
Buggy source:
private void showAbout(){
  View messageView=getLayoutInflater().inflate(R.layout.dialog_about,null,false);
  String versionName="String_Node_Str";
  try {
    PackageInfo packageInfo=getPackageManager().getPackageInfo(getPackageName(),0);
    versionName=packageInfo.versionName;
  }
 catch (  PackageManager.NameNotFoundException e) {
    e.printStackTrace();
  }
  TextView versionText=(TextView)messageView.findViewById(R.id.about_version);
  versionText.setText(versionName);
  AlertDialog.Builder builder=new AlertDialog.Builder(this);
  builder.setTitle(R.string.app_name);
  builder.setIcon(R.mipmap.ic_launcher);
  builder.setView(messageView);
  builder.create();
  builder.show();
}

Fixed version (ground truth):
private void showAbout(){
  ViewGroup container=(ViewGroup)findViewById(R.id.main_content);
  View messageView=getLayoutInflater().inflate(R.layout.dialog_about,container,false);
  String versionName="String_Node_Str";
  try {
    PackageInfo packageInfo=getPackageManager().getPackageInfo(getPackageName(),0);
    versionName=packageInfo.versionName;
  }
 catch (  PackageManager.NameNotFoundException e) {
    e.printStackTrace();
  }
  TextView versionText=(TextView)messageView.findViewById(R.id.about_version);
  versionText.setText(versionName);
  AlertDialog.Builder builder=new AlertDialog.Builder(this);
  builder.setTitle(R.string.app_name);
  builder.setIcon(R.mipmap.ic_launcher);
  builder.setView(messageView);
  builder.create();
  builder.show();
}
Program: 170661
Project: 170661
Buggy source:
@Override public void run(){
  int progress=(int)(System.currentTimeMillis() / 1000) % 30;
  progressBar.setProgress(progress * 100);
  ObjectAnimator animation=ObjectAnimator.ofInt(progressBar,"String_Node_Str",(progress + 1) * 100);
  animation.setDuration(1000);
  animation.setInterpolator(new LinearInterpolator());
  animation.start();
  for (int i=0; i < adapter.getCount(); i++) {
    if (progress == 0 || adapter.getItem(i).getCurrentOTP() == null) {
      adapter.getItem(i).setCurrentOTP(TOTPHelper.generate(adapter.getItem(i).getSecret()));
    }
  }
  adapter.notifyDataSetChanged();
  handler.postDelayed(this,1000);
}

Fixed version (ground truth):
@Override public void run(){
  int progress=(int)(System.currentTimeMillis() / 1000) % 30;
  progressBar.setProgress(progress * 100);
  ObjectAnimator animation=ObjectAnimator.ofInt(progressBar,"String_Node_Str",(progress + 1) * 100);
  animation.setDuration(1000);
  animation.setInterpolator(new LinearInterpolator());
  animation.start();
  for (int i=0; i < adapter.getCount(); i++) {
    adapter.getItem(i).setCurrentOTP(TOTPHelper.generate(adapter.getItem(i).getSecret()));
  }
  adapter.notifyDataSetChanged();
  handler.postDelayed(this,1000);
}
Program: 170662
Project: 170662
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  storiesProgressView=(StoriesProgressView)findViewById(R.id.stories);
  storiesProgressView.setStoriesCount(PROGRESS_COUNT);
  storiesProgressView.setStoryDuration(5000L);
  storiesProgressView.setStoriesListener(this);
  storiesProgressView.startStories();
  image=(ImageView)findViewById(R.id.image);
  image.setImageResource(resources[counter]);
  View reverse=findViewById(R.id.reverse);
  reverse.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      storiesProgressView.reverse();
    }
  }
);
  View skip=findViewById(R.id.skip);
  skip.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      storiesProgressView.skip();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.activity_main);
  storiesProgressView=(StoriesProgressView)findViewById(R.id.stories);
  storiesProgressView.setStoriesCount(PROGRESS_COUNT);
  storiesProgressView.setStoryDuration(3000L);
  storiesProgressView.setStoriesListener(this);
  storiesProgressView.startStories();
  image=(ImageView)findViewById(R.id.image);
  image.setImageResource(resources[counter]);
  View reverse=findViewById(R.id.reverse);
  reverse.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      storiesProgressView.reverse();
    }
  }
);
  reverse.setOnTouchListener(onTouchListener);
  View skip=findViewById(R.id.skip);
  skip.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      storiesProgressView.skip();
    }
  }
);
  skip.setOnTouchListener(onTouchListener);
}
Program: 170663
Project: 170663
Buggy source:
@Override public void onComplete(){
  Log.d(TAG,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void onComplete(){
}
Program: 170664
Project: 170664
Buggy source:
@Override public void onPrev(){
  Log.d(TAG,"String_Node_Str");
  if ((counter - 1) < 0)   return;
  image.setImageResource(resources[--counter]);
}

Fixed version (ground truth):
@Override public void onPrev(){
  if ((counter - 1) < 0)   return;
  image.setImageResource(resources[--counter]);
}
Program: 170665
Project: 170665
Buggy source:
@Override public void onNext(){
  Log.d(TAG,"String_Node_Str");
  image.setImageResource(resources[++counter]);
}

Fixed version (ground truth):
@Override public void onNext(){
  image.setImageResource(resources[++counter]);
}
Program: 170666
Project: 170666
Buggy source:
private void finishProgress(boolean isMax){
  int res=isMax ? R.color.progress_max_active : R.color.progress_max_inactive;
  maxProgressView.setBackgroundResource(res);
  maxProgressView.setVisibility(VISIBLE);
  if (animation != null) {
    animation.setAnimationListener(null);
    animation.cancel();
    if (callback != null) {
      callback.onFinishProgress();
    }
  }
}

Fixed version (ground truth):
private void finishProgress(boolean isMax){
  if (isMax)   maxProgressView.setBackgroundResource(R.color.progress_max_active);
  maxProgressView.setVisibility(isMax ? VISIBLE : GONE);
  if (animation != null) {
    animation.setAnimationListener(null);
    animation.cancel();
    if (callback != null) {
      callback.onFinishProgress();
    }
  }
}
Program: 170667
Project: 170667
Buggy source:
public void resume(){
  progressBars.get(current).resumeProgress();
}

Fixed version (ground truth):
/** 
 * Resume story
 */
public void resume(){
  progressBars.get(current).resumeProgress();
}
Program: 170668
Project: 170668
Buggy source:
@Override public void onStartProgress(){
  Log.d(TAG,"String_Node_Str" + current + "String_Node_Str");
  current=index;
}

Fixed version (ground truth):
@Override public void onStartProgress(){
  current=index;
}
Program: 170669
Project: 170669
Buggy source:
public void pause(){
  progressBars.get(current).pauseProgress();
}

Fixed version (ground truth):
/** 
 * Pause story
 */
public void pause(){
  progressBars.get(current).pauseProgress();
}
Program: 170670
Project: 170670
Buggy source:
private PausableProgressBar.Callback callback(final int index){
  return new PausableProgressBar.Callback(){
    @Override public void onStartProgress(){
      Log.d(TAG,"String_Node_Str" + current + "String_Node_Str");
      current=index;
    }
    @Override public void onFinishProgress(){
      Log.d(TAG,"String_Node_Str" + current + "String_Node_Str");
      if (isReverse) {
        isReverse=false;
        if (storiesListener != null)         storiesListener.onPrev();
        if (0 <= (current - 1)) {
          PausableProgressBar p=progressBars.get(current - 1);
          p.setMinWithoutCallback();
          progressBars.get(--current).startProgress();
        }
 else {
          progressBars.get(current).startProgress();
        }
        return;
      }
      int next=current + 1;
      if (next <= (progressBars.size() - 1)) {
        if (storiesListener != null)         storiesListener.onNext();
        progressBars.get(next).startProgress();
      }
 else {
        isComplete=true;
        if (storiesListener != null)         storiesListener.onComplete();
      }
    }
  }
;
}

Fixed version (ground truth):
private PausableProgressBar.Callback callback(final int index){
  return new PausableProgressBar.Callback(){
    @Override public void onStartProgress(){
      current=index;
    }
    @Override public void onFinishProgress(){
      if (isReverse) {
        isReverse=false;
        if (storiesListener != null)         storiesListener.onPrev();
        if (0 <= (current - 1)) {
          PausableProgressBar p=progressBars.get(current - 1);
          p.setMinWithoutCallback();
          progressBars.get(--current).startProgress();
        }
 else {
          progressBars.get(current).startProgress();
        }
        return;
      }
      int next=current + 1;
      if (next <= (progressBars.size() - 1)) {
        if (storiesListener != null)         storiesListener.onNext();
        progressBars.get(next).startProgress();
      }
 else {
        isComplete=true;
        if (storiesListener != null)         storiesListener.onComplete();
      }
    }
  }
;
}
Program: 170671
Project: 170671
Buggy source:
@Override public void onFinishProgress(){
  Log.d(TAG,"String_Node_Str" + current + "String_Node_Str");
  if (isReverse) {
    isReverse=false;
    if (storiesListener != null)     storiesListener.onPrev();
    if (0 <= (current - 1)) {
      PausableProgressBar p=progressBars.get(current - 1);
      p.setMinWithoutCallback();
      progressBars.get(--current).startProgress();
    }
 else {
      progressBars.get(current).startProgress();
    }
    return;
  }
  int next=current + 1;
  if (next <= (progressBars.size() - 1)) {
    if (storiesListener != null)     storiesListener.onNext();
    progressBars.get(next).startProgress();
  }
 else {
    isComplete=true;
    if (storiesListener != null)     storiesListener.onComplete();
  }
}

Fixed version (ground truth):
@Override public void onFinishProgress(){
  if (isReverse) {
    isReverse=false;
    if (storiesListener != null)     storiesListener.onPrev();
    if (0 <= (current - 1)) {
      PausableProgressBar p=progressBars.get(current - 1);
      p.setMinWithoutCallback();
      progressBars.get(--current).startProgress();
    }
 else {
      progressBars.get(current).startProgress();
    }
    return;
  }
  int next=current + 1;
  if (next <= (progressBars.size() - 1)) {
    if (storiesListener != null)     storiesListener.onNext();
    progressBars.get(next).startProgress();
  }
 else {
    isComplete=true;
    if (storiesListener != null)     storiesListener.onComplete();
  }
}