nus-yam/ex-repair huggingface dataset:
Program: 28398
Project: 28398
Buggy source:
/** 
 * 生成一个数字列表<br> 自动判定正序反序
 * @param includedStart 开始的数字（包含）
 * @param excludedEnd 结束的数字（不包含）
 * @param step 步进
 * @return 数字列表
 */
public static int[] range(int includedStart,int excludedEnd,int step){
  if (includedStart > excludedEnd) {
    int tmp=includedStart;
    includedStart=excludedEnd;
    excludedEnd=tmp;
  }
  if (step <= 0) {
    step=1;
  }
  int length=(excludedEnd - includedStart) / step;
  int[] range=new int[length];
  for (int i=0; i < length; i++) {
    range[i]=includedStart;
    includedStart+=step;
  }
  return range;
}

Fixed version (ground truth):
/** 
 * 生成一个数字列表<br> 自动判定正序反序
 * @param includedStart 开始的数字（包含）
 * @param excludedEnd 结束的数字（不包含）
 * @param step 步进
 * @return 数字列表
 */
public static int[] range(int includedStart,int excludedEnd,int step){
  if (includedStart > excludedEnd) {
    int tmp=includedStart;
    includedStart=excludedEnd;
    excludedEnd=tmp;
  }
  if (step <= 0) {
    step=1;
  }
  int deviation=excludedEnd - includedStart;
  int length=deviation / step;
  if (deviation % step != 0) {
    length+=1;
  }
  int[] range=new int[length];
  for (int i=0; i < length; i++) {
    range[i]=includedStart;
    includedStart+=step;
  }
  return range;
}
Program: 28399
Project: 28399
Buggy source:
/** 
 * Compute and return a measure of distance. Must be >= 0.
 * @param s1
 * @param s2
 * @return
 */
double distance(String s1,String s2);

Fixed version (ground truth):
/** 
 * Compute and return a measure of distance. Must be &gt;= 0.
 * @param s1
 * @param s2
 * @return
 */
double distance(String s1,String s2);
Program: 28400
Project: 28400
Buggy source:
/** 
 * Compute Jaccard index: |A inter B| / |A union B|.
 * @param s1 The first string to compare.
 * @param s2 The second string to compare.
 * @return The Jaccard index in the range [0, 1]
 * @throws NullPointerException if s1 or s2 is null.
 */
public final double similarity(final String s1,final String s2){
  if (s1 == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (s2 == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (s1.equals(s2)) {
    return 1;
  }
  Map<String,Integer> profile1=getProfile(s1);
  Map<String,Integer> profile2=getProfile(s2);
  Set<String> union=new HashSet<String>();
  union.addAll(profile1.keySet());
  union.addAll(profile2.keySet());
  int inter=0;
  for (  String key : union) {
    if (profile1.containsKey(key) && profile2.containsKey(key)) {
      inter++;
    }
  }
  return 1.0 * inter / union.size();
}

Fixed version (ground truth):
/** 
 * Compute Jaccard index: |A inter B| / |A union B|.
 * @param s1 The first string to compare.
 * @param s2 The second string to compare.
 * @return The Jaccard index in the range [0, 1]
 * @throws NullPointerException if s1 or s2 is null.
 */
public final double similarity(final String s1,final String s2){
  if (s1 == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (s2 == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (s1.equals(s2)) {
    return 1;
  }
  Map<String,Integer> profile1=getProfile(s1);
  Map<String,Integer> profile2=getProfile(s2);
  Set<String> union=new HashSet<String>();
  union.addAll(profile1.keySet());
  union.addAll(profile2.keySet());
  int inter=profile1.keySet().size() + profile2.keySet().size() - union.size();
  return 1.0 * inter / union.size();
}
Program: 28401
Project: 28401
Buggy source:
/** 
 * Return k, the length of k-shingles (aka n-grams).
 * @return The length of k-shingles.
 */
public int getK(){
  return k;
}

Fixed version (ground truth):
/** 
 * Return k, the length of k-shingles (aka n-grams).
 * @return The length of k-shingles.
 */
public final int getK(){
  return k;
}
Program: 28402
Project: 28402
Buggy source:
/** 
 * The distance between two strings is defined as the L1 norm of the difference of their profiles (the number of occurence of each k-shingle).
 * @param s1 The first string to compare.
 * @param s2 The second string to compare.
 * @return The computed Q-gram distance.
 * @throws NullPointerException if s1 or s2 is null.
 */
public final double distance(final String s1,final String s2){
  if (s1 == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (s2 == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (s1.equals(s2)) {
    return 0;
  }
  Map<String,Integer> profile1=getProfile(s1);
  Map<String,Integer> profile2=getProfile(s2);
  Set<String> union=new HashSet<String>();
  union.addAll(profile1.keySet());
  union.addAll(profile2.keySet());
  int agg=0;
  for (  String key : union) {
    int v1=0;
    int v2=0;
    Integer iv1=profile1.get(key);
    if (iv1 != null) {
      v1=iv1;
    }
    Integer iv2=profile2.get(key);
    if (iv2 != null) {
      v2=iv2;
    }
    agg+=Math.abs(v1 - v2);
  }
  return agg;
}

Fixed version (ground truth):
/** 
 * Compute QGram distance using precomputed profiles.
 * @param profile1
 * @param profile2
 * @return
 */
public final double distance(final Map<String,Integer> profile1,final Map<String,Integer> profile2){
  Set<String> union=new HashSet<String>();
  union.addAll(profile1.keySet());
  union.addAll(profile2.keySet());
  int agg=0;
  for (  String key : union) {
    int v1=0;
    int v2=0;
    Integer iv1=profile1.get(key);
    if (iv1 != null) {
      v1=iv1;
    }
    Integer iv2=profile2.get(key);
    if (iv2 != null) {
      v2=iv2;
    }
    agg+=Math.abs(v1 - v2);
  }
  return agg;
}
Program: 28404
Project: 28404
Buggy source:
/** 
 * Test of distance method, of class NGram.
 */
@Test public void testDistance(){
  System.out.println("String_Node_Str");
  String s0="String_Node_Str";
  String s1="String_Node_Str";
  String s2="String_Node_Str";
  NGram ngram=new NGram();
  System.out.println(ngram.distance(s0,s1));
  System.out.println(ngram.distance(s0,s2));
  Assert.assertTrue(ngram.distance(s0,s1) < ngram.distance(s0,s2));
}

Fixed version (ground truth):
/** 
 * Test of distance method, of class NGram.
 */
@Test public void testDistance(){
  System.out.println("String_Node_Str");
  String s0="String_Node_Str";
  String s1="String_Node_Str";
  String s2="String_Node_Str";
  NGram ngram=new NGram();
  System.out.println(ngram.distance(s0,s1));
  System.out.println(ngram.distance(s0,s2));
  Assert.assertTrue(ngram.distance(s0,s1) < ngram.distance(s0,s2));
  assertEquals(0.0,ngram.distance("String_Node_Str","String_Node_Str"),0.0);
  assertEquals(0.0,ngram.distance("String_Node_Str","String_Node_Str"),0.0);
  assertEquals(1.0,ngram.distance("String_Node_Str","String_Node_Str"),0.0);
  assertEquals(1.0,ngram.distance("String_Node_Str","String_Node_Str"),0.0);
}
Program: 28405
Project: 28405
Buggy source:
/** 
 * Test of distance method, of class QGram.
 */
@Test public final void testDistance(){
  System.out.println("String_Node_Str");
  QGram instance=new QGram(2);
  double result=instance.distance("String_Node_Str","String_Node_Str");
  assertEquals(2.0,result,0.0);
}

Fixed version (ground truth):
/** 
 * Test of distance method, of class QGram.
 */
@Test public final void testDistance(){
  System.out.println("String_Node_Str");
  QGram instance=new QGram(2);
  double result=instance.distance("String_Node_Str","String_Node_Str");
  assertEquals(2.0,result,0.0);
  assertEquals(0.0,instance.distance("String_Node_Str","String_Node_Str"),0.0);
  assertEquals(0.0,instance.distance("String_Node_Str","String_Node_Str"),0.0);
}
Program: 28406
Project: 28406
Buggy source:
public double distance(String s1,String s2){
  return 1.0 - similarity(s1,s2);
}

Fixed version (ground truth):
/** 
 * Return 1.0 - similarity.
 * @param s1
 * @param s2
 * @return
 */
public double distance(final String s1,final String s2){
  return 1.0 - similarity(s1,s2);
}
Program: 28407
Project: 28407
Buggy source:
public double similarity(String s1,String s2){
  if (s1.length() < k || s2.length() < k) {
    return 0;
  }
  KShingling ks=new KShingling(k);
  int[] profile1=ks.getArrayProfile(s1);
  int[] profile2=ks.getArrayProfile(s2);
  return dotProduct(profile1,profile2) / (norm(profile1) * norm(profile2));
}

Fixed version (ground truth):
/** 
 * Compute the cosine similarity between strings.
 * @param s1
 * @param s2
 * @return
 */
public final double similarity(final String s1,final String s2){
  if (s1.length() < k || s2.length() < k) {
    return 0;
  }
  KShingling ks=new KShingling(k);
  int[] profile1=ks.getArrayProfile(s1);
  int[] profile2=ks.getArrayProfile(s2);
  return dotProduct(profile1,profile2) / (norm(profile1) * norm(profile2));
}
Program: 28408
Project: 28408
Buggy source:
protected static double dotProduct(int[] profile1,int[] profile2){
  int length=Math.max(profile1.length,profile2.length);
  profile1=java.util.Arrays.copyOf(profile1,length);
  profile2=java.util.Arrays.copyOf(profile2,length);
  double agg=0;
  for (int i=0; i < length; i++) {
    agg+=profile1[i] * profile2[i];
  }
  return agg;
}

Fixed version (ground truth):
protected static double dotProduct(final int[] profile1,final int[] profile2){
  int length=Math.max(profile1.length,profile2.length);
  int[] copy1=java.util.Arrays.copyOf(profile1,length);
  int[] copy2=java.util.Arrays.copyOf(profile2,length);
  double agg=0;
  for (int i=0; i < length; i++) {
    agg+=1.0 * copy1[i] * copy2[i];
  }
  return agg;
}
Program: 28409
Project: 28409
Buggy source:
/** 
 * Compute the norm L2 : sqrt(Sum_i( v_i²)).
 * @param profile
 * @return L2 norm
 */
protected static double norm(int[] profile){
  double agg=0;
  for (  int v : profile) {
    agg+=v * v;
  }
  return Math.sqrt(agg);
}

Fixed version (ground truth):
/** 
 * Compute the norm L2 : sqrt(Sum_i( v_i²)).
 * @param profile
 * @return L2 norm
 */
protected static double norm(final int[] profile){
  double agg=0;
  for (  int v : profile) {
    agg+=1.0 * v * v;
  }
  return Math.sqrt(agg);
}
Program: 28410
Project: 28410
Buggy source:
private void startInternal(){
  handler.removeCallbacks(this);
  handler.postDelayed(this,10L);
  isAnimating=true;
}

Fixed version (ground truth):
private void startInternal(){
  Utils.postOnAnimation(FoldableListLayout.this,this);
  isAnimating=true;
}
Program: 28411
Project: 28411
Buggy source:
void stop(){
  handler.removeCallbacks(this);
  isAnimating=false;
}

Fixed version (ground truth):
void stop(){
  FoldableListLayout.this.removeCallbacks(this);
  isAnimating=false;
}
Program: 28412
Project: 28412
Buggy source:
@Override protected void animateFold(float to){
  super.animateFold(to);
  if (to > getFoldRotation()) {
    setState(STATE_UNFOLDING);
  }
 else {
    setState(STATE_FOLDING);
  }
}

Fixed version (ground truth):
@Override protected void animateFold(float to){
  super.animateFold(to);
  if (to <= getFoldRotation() && state != STATE_FOLDED) {
    setState(STATE_FOLDING);
  }
}
Program: 28413
Project: 28413
Buggy source:
/** 
 * Starting unfold animation for given views.
 */
public void unfold(View coverView,View detailsView){
  if (this.coverView == coverView && this.detailsView == detailsView) {
    scrollToPosition(1);
    return;
  }
  if ((this.coverView != null && this.coverView != coverView) || (this.detailsView != null && this.detailsView != detailsView)) {
    scheduledCoverView=coverView;
    scheduledDetailsView=detailsView;
    foldBack();
    return;
  }
  setCoverViewInternal(coverView);
  setDetailsViewInternal(detailsView);
  setAdapter(adapter);
  scrollToPosition(1);
}

Fixed version (ground truth):
/** 
 * Starting unfold animation for given views.
 */
public void unfold(View coverView,View detailsView){
  if (this.coverView == coverView && this.detailsView == detailsView) {
    scrollToPosition(1);
    return;
  }
  if ((this.coverView != null && this.coverView != coverView) || (this.detailsView != null && this.detailsView != detailsView)) {
    scheduledCoverView=coverView;
    scheduledDetailsView=detailsView;
    foldBack();
    return;
  }
  setCoverViewInternal(coverView);
  setDetailsViewInternal(detailsView);
  setAdapter(adapter);
  setState(STATE_UNFOLDING);
  scrollToPosition(1);
}
Program: 28414
Project: 28414
Buggy source:
/** 
 * Sets shading to use during fold rotation. Should be called before   {@link #setAdapter(android.widget.BaseAdapter)}
 */
public void setFoldShading(FoldShading shading){
  foldShading=shading;
}

Fixed version (ground truth):
/** 
 * Sets shading to use during fold rotation. Should be called before  {@link #setAdapter(android.widget.BaseAdapter)}
 */
public void setFoldShading(FoldShading shading){
  foldShading=shading;
}
Program: 28415
Project: 28415
Buggy source:
public void scrollToPosition(int index){
  index=Math.max(0,Math.min(index,getCount() - 1));
  final float from=getFoldRotation();
  final float to=index * 180f;
  final long duration=(long)Math.abs(ANIMATION_DURATION_PER_ITEM * (to - from) / 180f);
  flingAnimation.stop();
  animator.cancel();
  animator.setFloatValues(from,to);
  animator.setDuration(duration).start();
}

Fixed version (ground truth):
public void scrollToPosition(int index){
  index=Math.max(0,Math.min(index,getCount() - 1));
  animateFold(index * 180f);
}
Program: 28416
Project: 28416
Buggy source:
private boolean processTouch(MotionEvent event){
  long eventTime=event.getEventTime();
  int action=event.getActionMasked();
  if (lastTouchEventTime == eventTime && lastTouchEventAction == action) {
    return lastTouchEventResult;
  }
  lastTouchEventTime=eventTime;
  lastTouchEventAction=action;
  if (getCount() > 0) {
    MotionEvent eventCopy=MotionEvent.obtain(event);
    eventCopy.offsetLocation(0,getTranslationY());
    lastTouchEventResult=gestureDetector.onTouchEvent(eventCopy);
    eventCopy.recycle();
  }
 else {
    lastTouchEventResult=false;
  }
  if (action == MotionEvent.ACTION_UP) {
    onUp();
  }
  return lastTouchEventResult;
}

Fixed version (ground truth):
private boolean processTouch(MotionEvent event){
  long eventTime=event.getEventTime();
  int action=event.getActionMasked();
  if (lastTouchEventTime == eventTime && lastTouchEventAction == action) {
    return lastTouchEventResult;
  }
  lastTouchEventTime=eventTime;
  lastTouchEventAction=action;
  if (getCount() > 0) {
    MotionEvent eventCopy=MotionEvent.obtain(event);
    eventCopy.offsetLocation(0,getTranslationY());
    lastTouchEventResult=gestureDetector.onTouchEvent(eventCopy);
    eventCopy.recycle();
  }
 else {
    lastTouchEventResult=false;
  }
  if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
    onUpOrCancel();
  }
  return lastTouchEventResult;
}
Program: 28417
Project: 28417
Buggy source:
protected void scrollToNearestPosition(){
  float current=getFoldRotation();
  scrollToPosition((int)((current + 90f) / 180f));
}

Fixed version (ground truth):
protected void scrollToNearestPosition(){
  scrollToPosition((int)((getFoldRotation() + 90f) / 180f));
}
Program: 28418
Project: 28418
Buggy source:
private void updateAdapterData(){
  int size=getCount();
  minRotation=0f;
  maxRotation=size == 0 ? 0f : 180f * (size - 1);
  freeAllLayouts();
  recycledViews.clear();
  viewsTypesMap.clear();
  setFoldRotation(foldRotation);
}

Fixed version (ground truth):
private void updateAdapterData(){
  int count=getCount();
  minRotation=0f;
  maxRotation=count == 0 ? 0f : 180f * (count - 1);
  freeAllLayouts();
  recycledViews.clear();
  viewsTypesMap.clear();
  setFoldRotation(foldRotation);
}
Program: 28419
Project: 28419
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean isFoldingBack(){
  return isFoldingBack;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean isFoldingBack(){
  return state == STATE_FOLDING;
}
Program: 28420
Project: 28420
Buggy source:
public boolean isUnfolded(){
  return isUnfolded;
}

Fixed version (ground truth):
public boolean isUnfolded(){
  return state == STATE_UNFOLDED;
}
Program: 28421
Project: 28421
Buggy source:
public boolean isUnfolding(){
  return isUnfolding;
}

Fixed version (ground truth):
public boolean isUnfolding(){
  return state == STATE_UNFOLDING;
}
Program: 28422
Project: 28422
Buggy source:
@Override protected void setFoldRotation(float rotation,boolean isFromUser){
  super.setFoldRotation(rotation,isFromUser);
  if (coverView == null || detailsView == null) {
    return;
  }
  rotation=getFoldRotation();
  float stage=rotation / 180f;
  float fromX=coverViewPosition.centerX();
  float toX=detailsViewPosition.centerX();
  float fromY=coverViewPosition.top;
  float toY=detailsViewPosition.centerY();
  setTranslationX((fromX - toX) * (1f - stage));
  setTranslationY((fromY - toY) * (1f - stage));
  float lastRotation=lastFoldRotation;
  lastFoldRotation=rotation;
  if (foldingListener != null) {
    foldingListener.onFoldProgress(this,stage);
  }
  if (rotation > lastRotation && !isUnfolding) {
    isUnfolding=true;
    isFoldingBack=false;
    isUnfolded=false;
    if (foldingListener != null) {
      foldingListener.onUnfolding(this);
    }
  }
  if (rotation < lastRotation && !isFoldingBack) {
    isUnfolding=false;
    isFoldingBack=true;
    isUnfolded=false;
    if (foldingListener != null) {
      foldingListener.onFoldingBack(this);
    }
  }
  if (rotation == 180f && !isUnfolded) {
    isUnfolding=false;
    isFoldingBack=false;
    isUnfolded=true;
    if (foldingListener != null) {
      foldingListener.onUnfolded(this);
    }
  }
  if (rotation == 0f && isFoldingBack) {
    isUnfolding=false;
    isFoldingBack=false;
    isUnfolded=false;
    onFoldedBack();
    if (foldingListener != null) {
      foldingListener.onFoldedBack(this);
    }
  }
}

Fixed version (ground truth):
@Override protected void setFoldRotation(float rotation,boolean isFromUser){
  super.setFoldRotation(rotation,isFromUser);
  if (coverView == null || detailsView == null) {
    return;
  }
  rotation=getFoldRotation();
  float stage=rotation / 180f;
  float fromX=coverViewPosition.centerX();
  float toX=detailsViewPosition.centerX();
  float fromY=coverViewPosition.top;
  float toY=detailsViewPosition.centerY();
  setTranslationX((fromX - toX) * (1f - stage));
  setTranslationY((fromY - toY) * (1f - stage));
  final float lastRotation=lastFoldRotation;
  lastFoldRotation=rotation;
  if (foldingListener != null) {
    foldingListener.onFoldProgress(this,stage);
  }
  if (rotation > lastRotation) {
    setState(STATE_UNFOLDING);
  }
  if (rotation < lastRotation) {
    setState(STATE_FOLDING);
  }
  if (rotation == 180f) {
    setState(STATE_UNFOLDED);
  }
  if (rotation == 0f && state == STATE_FOLDING) {
    setState(STATE_FOLDED);
  }
}
Program: 28423
Project: 28423
Buggy source:
/** 
 * Starting unfold animation for given views.
 */
public void unfold(View coverView,View detailsView){
  if (this.coverView == coverView && this.detailsView == detailsView) {
    return;
  }
  if ((this.coverView != null && this.coverView != coverView) || (this.detailsView != null && this.detailsView != detailsView)) {
    scheduledDetailsView=detailsView;
    scheduledCoverView=coverView;
    foldBack();
    return;
  }
  setCoverViewInternal(coverView);
  setDetailsViewInternal(detailsView);
  setAdapter(adapter);
  scrollToPosition(1);
}

Fixed version (ground truth):
/** 
 * Starting unfold animation for given views.
 */
public void unfold(View coverView,View detailsView){
  if (this.coverView == coverView && this.detailsView == detailsView) {
    scrollToPosition(1);
    return;
  }
  if ((this.coverView != null && this.coverView != coverView) || (this.detailsView != null && this.detailsView != detailsView)) {
    scheduledCoverView=coverView;
    scheduledDetailsView=detailsView;
    foldBack();
    return;
  }
  setCoverViewInternal(coverView);
  setDetailsViewInternal(detailsView);
  setAdapter(adapter);
  scrollToPosition(1);
}
Program: 28424
Project: 28424
Buggy source:
private void setDrawToCache(boolean drawToCache){
  if (isDrawToCache != drawToCache) {
    isDrawToCache=drawToCache;
    invalidate();
  }
}

Fixed version (ground truth):
void setDrawToCache(boolean drawToCache){
  if (isDrawToCache != drawToCache) {
    isDrawToCache=drawToCache;
    invalidate();
  }
}
Program: 28425
Project: 28425
Buggy source:
/** 
 * Translation preserving middle line splitting.
 */
public void setRollingDistance(float distance){
  topPart.applyRollingDistance(distance,scale * scaleFactor);
  bottomPart.applyRollingDistance(distance,scale * scaleFactor);
}

Fixed version (ground truth):
/** 
 * Translation preserving middle line splitting.
 */
public void setRollingDistance(float distance){
  final float scaleY=scale * scaleFactor * scaleFactorY;
  topPart.applyRollingDistance(distance,scaleY);
  bottomPart.applyRollingDistance(distance,scaleY);
}
Program: 28426
Project: 28426
Buggy source:
private void setCacheCanvas(Canvas cacheCanvas){
  this.cacheCanvas=cacheCanvas;
}

Fixed version (ground truth):
void setCacheCanvas(Canvas cacheCanvas){
  this.cacheCanvas=cacheCanvas;
}
Program: 28427
Project: 28427
Buggy source:
private BaseLayout(FoldableItemLayout layout){
  super(layout.getContext());
  final int matchParent=ViewGroup.LayoutParams.MATCH_PARENT;
  LayoutParams params=new LayoutParams(matchParent,matchParent);
  layout.addView(this,params);
  setWillNotDraw(false);
}

Fixed version (ground truth):
BaseLayout(FoldableItemLayout layout){
  super(layout.getContext());
  final int matchParent=ViewGroup.LayoutParams.MATCH_PARENT;
  LayoutParams params=new LayoutParams(matchParent,matchParent);
  layout.addView(this,params);
  setWillNotDraw(false);
}
Program: 28428
Project: 28428
Buggy source:
public void setScale(float scale){
  this.scale=scale;
  topPart.applyScale(scale * scaleFactor);
  bottomPart.applyScale(scale * scaleFactor);
}

Fixed version (ground truth):
public void setScale(float scale){
  this.scale=scale;
  final float scaleX=scale * scaleFactor;
  final float scaleY=scale * scaleFactor * scaleFactorY;
  baseLayout.setScaleY(scaleFactorY);
  topPart.setScaleX(scaleX);
  topPart.setScaleY(scaleY);
  bottomPart.setScaleX(scaleX);
  bottomPart.setScaleY(scaleY);
}
Program: 28429
Project: 28429
Buggy source:
void applyRollingDistance(float distance,float scale){
  setTranslationY((int)(distance * scale + 0.5f));
  final int h=getHeight() / 2;
  final float topClipping=h == 0 ? 0.5f : 0.5f * (h - distance) / h;
  clippingFactor=gravity == Gravity.TOP ? topClipping : 1f - topClipping;
  calculateBitmapBounds();
}

Fixed version (ground truth):
void applyRollingDistance(float distance,float scaleY){
  setTranslationY((int)(distance * scaleY + 0.5f));
  final int h=getHeight() / 2;
  final float topClipping=h == 0 ? 0.5f : 0.5f * (h - distance) / h;
  clippingFactor=gravity == Gravity.TOP ? topClipping : 1f - topClipping;
  calculateBitmapBounds();
}
Program: 28430
Project: 28430
Buggy source:
/** 
 * Fold rotation value in degrees.
 */
public void setFoldRotation(float rotation){
  foldRotation=rotation;
  topPart.applyFoldRotation(rotation);
  bottomPart.applyFoldRotation(rotation);
  setInTransformation(rotation != 0f);
  if (isAutoScaleEnabled) {
    scaleFactor=1f;
    if (width > 0) {
      double sin=Math.abs(Math.sin(Math.toRadians(rotation)));
      float dw=(float)(height * sin) * CAMERA_DISTANCE_MAGIC_FACTOR;
      scaleFactor=width / (width + dw);
    }
    setScale(scale);
  }
}

Fixed version (ground truth):
/** 
 * Fold rotation value in degrees.
 */
public void setFoldRotation(float rotation){
  foldRotation=rotation;
  topPart.applyFoldRotation(rotation);
  bottomPart.applyFoldRotation(rotation);
  setInTransformation(rotation != 0f);
  scaleFactor=1f;
  if (isAutoScaleEnabled && width > 0) {
    double sin=Math.abs(Math.sin(Math.toRadians(rotation)));
    float dw=(float)(height * sin) * CAMERA_DISTANCE_MAGIC_FACTOR;
    scaleFactor=width / (width + dw);
    setScale(scale);
  }
}
Program: 28431
Project: 28431
Buggy source:
public synchronized void update(Markup markup){
  if (markup == null)   return;
  if (markup instanceof MarkerItemMarkup) {
    mapView.items().removeItem(mapView.items().getByUid(markup.getId()));
    mapView.items().addItem(((MarkerItemMarkup)markup).getMarkerItem(context));
  }
 else   if (markup instanceof DrawableMarkup) {
    updateDrawableLayer();
    mapView.drawables().update();
  }
  redraw();
}

Fixed version (ground truth):
public synchronized void update(Markup markup){
  if (markup == null)   return;
  if (markup instanceof MarkerItemMarkup) {
    MarkerItem item=mapView.items().getByUid(markup.getId());
    if (item != null) {
      mapView.items().removeItem(item);
    }
    item=((MarkerItemMarkup)markup).getMarkerItem(context);
    if (item != null) {
      mapView.items().addItem(item);
    }
  }
 else   if (markup instanceof DrawableMarkup) {
    updateDrawableLayer();
    mapView.drawables().update();
  }
  redraw();
}
Program: 28432
Project: 28432
Buggy source:
public synchronized <T extends MarkerItemMarkup>T add(T markup){
  if (markup == null)   return null;
  markupMap.put(markup.getId(),markup);
  mapView.items().addItem(markup.getMarkerItem(context));
  redraw();
  return markup;
}

Fixed version (ground truth):
public synchronized <T extends MarkerItemMarkup>T add(T markup){
  if (markup == null)   return null;
  markupMap.put(markup.getId(),markup);
  MarkerItem item=markup.getMarkerItem(context);
  mapView.items().addItem(item);
  redraw();
  return markup;
}
Program: 28433
Project: 28433
Buggy source:
public void startActivitiesAsUser(Intent[] intents,Bundle options,UserHandle userHandle){
  safeInvoke("String_Node_Str",new Class[]{Intent[].class,Bundle.class,UserHandle.class},intents,options,userHandle);
}

Fixed version (ground truth):
@TargetApi(17) public void startActivitiesAsUser(Intent[] intents,Bundle options,UserHandle userHandle){
  safeInvoke("String_Node_Str",new Class[]{Intent[].class,Bundle.class,UserHandle.class},intents,options,userHandle);
}
Program: 28434
Project: 28434
Buggy source:
public void startActivityAsUser(Intent intent,Bundle options,UserHandle userId){
  safeInvoke("String_Node_Str",Intent.class,Bundle.class,UserHandle.class,intent,options,userId);
}

Fixed version (ground truth):
@TargetApi(17) public void startActivityAsUser(Intent intent,Bundle options,UserHandle userId){
  safeInvoke("String_Node_Str",Intent.class,Bundle.class,UserHandle.class,intent,options,userId);
}
Program: 28435
Project: 28435
Buggy source:
public void startActivitiesAsUser(Intent[] intents,Bundle options,UserHandle userHandle){
  safeInvoke("String_Node_Str",new Class[]{Intent[].class,Bundle.class,UserHandle.class},intents,options,userHandle);
}

Fixed version (ground truth):
@TargetApi(17) public void startActivitiesAsUser(Intent[] intents,Bundle options,UserHandle userHandle){
  safeInvoke("String_Node_Str",new Class[]{Intent[].class,Bundle.class,UserHandle.class},intents,options,userHandle);
}
Program: 28436
Project: 28436
Buggy source:
public void startActivityAsUser(Intent intent,Bundle options,UserHandle userId){
  safeInvoke("String_Node_Str",Intent.class,Bundle.class,UserHandle.class,intent,options,userId);
}

Fixed version (ground truth):
@TargetApi(17) public void startActivityAsUser(Intent intent,Bundle options,UserHandle userId){
  safeInvoke("String_Node_Str",Intent.class,Bundle.class,UserHandle.class,intent,options,userId);
}
Program: 28437
Project: 28437
Buggy source:
@Override public void requestLocationSettingsDialog(LocationSettingsRequest settingsRequest,ISettingsCallbacks callback,String packageName) throws RemoteException {
  Log.d(TAG,"String_Node_Str" + settingsRequest);
  callback.onLocationSettingsResult(new LocationSettingsResult(Status.CANCELED));
}

Fixed version (ground truth):
@Override public void requestLocationSettingsDialog(LocationSettingsRequest settingsRequest,ISettingsCallbacks callback,String packageName) throws RemoteException {
  Log.d(TAG,"String_Node_Str" + settingsRequest);
  callback.onLocationSettingsResult(new LocationSettingsResult(new LocationSettingsStates(true,true,false,true,true,false),Status.CANCELED));
}
Program: 28438
Project: 28438
Buggy source:
@Override public ReportingState getReportingState(Account account) throws RemoteException {
  return new ReportingState();
}

Fixed version (ground truth):
@Override public ReportingState getReportingState(Account account) throws RemoteException {
  Log.d(TAG,"String_Node_Str");
  return new ReportingState();
}
Program: 28439
Project: 28439
Buggy source:
@Override public UploadRequestResult requestUpload(UploadRequest request) throws RemoteException {
  return new UploadRequestResult();
}

Fixed version (ground truth):
@Override public UploadRequestResult requestUpload(UploadRequest request) throws RemoteException {
  Log.d(TAG,"String_Node_Str");
  return new UploadRequestResult();
}
Program: 28440
Project: 28440
Buggy source:
@Override public int reportDeviceAtPlace(Account account,PlaceReport report) throws RemoteException {
  return 0;
}

Fixed version (ground truth):
@Override public int reportDeviceAtPlace(Account account,PlaceReport report) throws RemoteException {
  Log.d(TAG,"String_Node_Str");
  return 0;
}
Program: 28441
Project: 28441
Buggy source:
@Override public int tryOptIn(Account account) throws RemoteException {
  return 0;
}

Fixed version (ground truth):
@Override public int tryOptIn(Account account) throws RemoteException {
  Log.d(TAG,"String_Node_Str");
  return 0;
}
Program: 28442
Project: 28442
Buggy source:
@Override public int cancelUploadRequest(long l) throws RemoteException {
  return 0;
}

Fixed version (ground truth):
@Override public int cancelUploadRequest(long l) throws RemoteException {
  Log.d(TAG,"String_Node_Str");
  return 0;
}
Program: 28443
Project: 28443
Buggy source:
/** 
 * 生成sign HMAC-SHA256 或 MD5 签名
 * @param map map
 * @param sign_type HMAC-SHA256 或 MD5
 * @param paternerKey paternerKey
 * @return sign
 */
public static String generateSign(Map<String,String> map,String sign_type,String paternerKey){
  Map<String,String> tmap=MapUtil.order(map);
  if (tmap.containsKey("String_Node_Str")) {
    tmap.remove("String_Node_Str");
  }
  String str=MapUtil.mapJoin(tmap,false,false);
  if (sign_type == null) {
    sign_type=tmap.get("String_Node_Str");
  }
  if ("String_Node_Str".equalsIgnoreCase(sign_type)) {
    try {
      Mac sha256_HMAC=Mac.getInstance("String_Node_Str");
      SecretKeySpec secret_key=new SecretKeySpec(paternerKey.getBytes("String_Node_Str"),"String_Node_Str");
      sha256_HMAC.init(secret_key);
      return Hex.encodeHexString(sha256_HMAC.doFinal((str + "String_Node_Str" + paternerKey).getBytes("String_Node_Str"))).toUpperCase();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return null;
  }
 else {
    return DigestUtils.md5Hex(str + "String_Node_Str" + paternerKey).toUpperCase();
  }
}

Fixed version (ground truth):
/** 
 * 生成sign HMAC-SHA256 或 MD5 签名
 * @param map map
 * @param sign_type HMAC-SHA256 或 MD5
 * @param paternerKey paternerKey
 * @return sign
 */
public static String generateSign(Map<String,String> map,String sign_type,String paternerKey){
  Map<String,String> tmap=MapUtil.order(map);
  if (tmap.containsKey("String_Node_Str")) {
    tmap.remove("String_Node_Str");
  }
  String str=MapUtil.mapJoin(tmap,false,false);
  if (sign_type == null) {
    sign_type=tmap.get("String_Node_Str");
  }
  if (tmap.containsKey("String_Node_Str")) {
    tmap.remove("String_Node_Str");
  }
  if ("String_Node_Str".equalsIgnoreCase(sign_type)) {
    try {
      Mac sha256_HMAC=Mac.getInstance("String_Node_Str");
      SecretKeySpec secret_key=new SecretKeySpec(paternerKey.getBytes("String_Node_Str"),"String_Node_Str");
      sha256_HMAC.init(secret_key);
      return Hex.encodeHexString(sha256_HMAC.doFinal((str + "String_Node_Str" + paternerKey).getBytes("String_Node_Str"))).toUpperCase();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return null;
  }
 else {
    return DigestUtils.md5Hex(str + "String_Node_Str" + paternerKey).toUpperCase();
  }
}
Program: 28444
Project: 28444
Buggy source:
private static Bitmap buildBitmap(Bitmap bitmap,boolean canReuseInBitmap){
  Bitmap rBitmap;
  if (canReuseInBitmap) {
    rBitmap=bitmap;
  }
 else {
    rBitmap=bitmap.copy(bitmap.getConfig(),true);
  }
  return (rBitmap);
}

Fixed version (ground truth):
private static Bitmap buildBitmap(Bitmap original,boolean canReuseInBitmap){
  if (original == null)   throw new NullPointerException("String_Node_Str");
  Bitmap.Config config=original.getConfig();
  if (config != Bitmap.Config.ARGB_8888 && config != Bitmap.Config.RGB_565) {
    throw new RuntimeException("String_Node_Str");
  }
  Bitmap rBitmap;
  if (canReuseInBitmap) {
    rBitmap=original;
  }
 else {
    rBitmap=original.copy(config,true);
  }
  return (rBitmap);
}
Program: 28446
Project: 28446
Buggy source:
public AvroFileWriter(LogFilePath logFilePath,CompressionCodec codec) throws IOException {
  file=new File(logFilePath.getLogFilePath());
  LOG.debug("String_Node_Str",logFilePath.getLogFilePath());
  CompressionCodecName codecName=CompressionCodecName.fromCompressionCodec(codec != null ? codec.getClass() : null);
  topic=logFilePath.getTopic();
  Schema schema=schemaRegistryClient.getSchema(topic);
  SpecificDatumWriter specificDatumWriter=new SpecificDatumWriter(schema);
  writer=new DataFileWriter(specificDatumWriter);
  writer.setCodec(CodecFactory.fromString(codecName.name()));
  writer.create(schema,file);
}

Fixed version (ground truth):
public AvroFileWriter(LogFilePath logFilePath,CompressionCodec codec) throws IOException {
  file=new File(logFilePath.getLogFilePath());
  file.getParentFile().mkdirs();
  LOG.debug("String_Node_Str",logFilePath.getLogFilePath());
  topic=logFilePath.getTopic();
  Schema schema=schemaRegistryClient.getSchema(topic);
  SpecificDatumWriter specificDatumWriter=new SpecificDatumWriter(schema);
  writer=new DataFileWriter(specificDatumWriter);
  writer.setCodec(getCodecFactory(codec));
  writer.create(schema,file);
}
Program: 28447
Project: 28447
Buggy source:
public AvroFileReader(LogFilePath logFilePath,CompressionCodec codec) throws IOException {
  String topic=logFilePath.getTopic();
  Schema schema=schemaRegistryClient.getSchema(topic);
  DatumReader datumReader=new SpecificDatumReader(schema);
  try {
    reader=new DataFileReader(new File(logFilePath.getLogFilePath()),datumReader);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  writer=new SpecificDatumWriter(schema);
  offset=logFilePath.getOffset();
}

Fixed version (ground truth):
public AvroFileReader(LogFilePath logFilePath,CompressionCodec codec) throws IOException {
  file=new File(logFilePath.getLogFilePath() + "String_Node_Str");
  file.getParentFile().mkdirs();
  String topic=logFilePath.getTopic();
  Schema schema=schemaRegistryClient.getSchema(topic);
  DatumReader datumReader=new SpecificDatumReader(schema);
  try {
    reader=new DataFileReader(file,datumReader);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  writer=new SpecificDatumWriter(schema);
  offset=logFilePath.getOffset();
}
Program: 28448
Project: 28448
Buggy source:
public SecorSchemaRegistryClient(SecorConfig config){
  try {
    Properties props=new Properties();
    props.put("String_Node_Str",config.getSchemaRegistryUrl());
    CachedSchemaRegistryClient schemaRegistryClient=new CachedSchemaRegistryClient(config.getSchemaRegistryUrl(),30);
    decoder=new KafkaAvroDecoder(schemaRegistryClient);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public SecorSchemaRegistryClient(SecorConfig config){
  try {
    Properties props=new Properties();
    props.put("String_Node_Str",config.getSchemaRegistryUrl());
    schemaRegistryClient=new CachedSchemaRegistryClient(config.getSchemaRegistryUrl(),30);
    init(config);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw new RuntimeException(e);
  }
}
Program: 28449
Project: 28449
Buggy source:
public GenericRecord decodeMessage(String topic,byte[] message){
  GenericRecord record=(GenericRecord)decoder.fromBytes(message);
  Schema schema=record.getSchema();
  schemas.putIfAbsent(topic,schema);
  return record;
}

Fixed version (ground truth):
public GenericRecord decodeMessage(String topic,byte[] message){
  GenericRecord record=(GenericRecord)decoder.fromBytes(message);
  Schema schema=record.getSchema();
  schemas.put(topic,schema);
  return record;
}
Program: 28450
Project: 28450
Buggy source:
public SecorSchemaRegistryClient(SecorConfig config){
  try {
    LOG.info("String_Node_Str",config.getSchemaRegistryUrl());
    Properties props=new Properties();
    props.put("String_Node_Str",config.getSchemaRegistryUrl());
    CachedSchemaRegistryClient schemaRegistryClient=new CachedSchemaRegistryClient(config.getSchemaRegistryUrl(),30);
    decoder=new KafkaAvroDecoder(schemaRegistryClient);
    schemas=new ConcurrentHashMap<>();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public SecorSchemaRegistryClient(SecorConfig config){
  try {
    Properties props=new Properties();
    props.put("String_Node_Str",config.getSchemaRegistryUrl());
    CachedSchemaRegistryClient schemaRegistryClient=new CachedSchemaRegistryClient(config.getSchemaRegistryUrl(),30);
    decoder=new KafkaAvroDecoder(schemaRegistryClient);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw new RuntimeException(e);
  }
}
Program: 28452
Project: 28452
Buggy source:
public Message decodeJsonMessage(String topic,byte[] payload){
  try {
    Method builderGetter=allTopics ? messageClassForAll.getDeclaredMethod("String_Node_Str") : messageClassByTopic.get(topic).getDeclaredMethod("String_Node_Str");
    com.google.protobuf.GeneratedMessageV3.Builder builder=(com.google.protobuf.GeneratedMessageV3.Builder)builderGetter.invoke(null);
    jsonParser.merge(new InputStreamReader(new ByteArrayInputStream(payload)),builder);
    return builder.build();
  }
 catch (  NoSuchMethodException|IllegalAccessException|InvocationTargetException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
catch (  InvalidProtocolBufferException e) {
    LOG.info("String_Node_Str",new String(payload,Charsets.UTF_8));
    return null;
  }
catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public Message decodeJsonMessage(String topic,byte[] payload) throws InvalidProtocolBufferException {
  try {
    Method builderGetter=allTopics ? messageClassForAll.getDeclaredMethod("String_Node_Str") : messageClassByTopic.get(topic).getDeclaredMethod("String_Node_Str");
    com.google.protobuf.GeneratedMessageV3.Builder builder=(com.google.protobuf.GeneratedMessageV3.Builder)builderGetter.invoke(null);
    jsonParser.merge(new InputStreamReader(new ByteArrayInputStream(payload)),builder);
    return builder.build();
  }
 catch (  NoSuchMethodException|IllegalAccessException|InvocationTargetException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
catch (  InvalidProtocolBufferException e) {
    LOG.info("String_Node_Str",new String(payload,Charsets.UTF_8));
    throw e;
  }
catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 28453
Project: 28453
Buggy source:
/** 
 * Decodes protobuf message
 * @param topic Kafka topic name
 * @param payload Byte array containing encoded protobuf message
 * @return protobuf message instance
 * @throws RuntimeException when there's problem decoding protobuf message
 */
public Message decodeMessage(String topic,byte[] payload){
  try {
    if (shouldDecodeFromJsonMessage(topic)) {
      return decodeJsonMessage(topic,payload);
    }
    Method parseMethod=allTopics ? messageParseMethodForAll : messageParseMethodByTopic.get(topic);
    return (Message)parseMethod.invoke(null,payload);
  }
 catch (  IllegalArgumentException e) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str",e);
  }
catch (  IllegalAccessException e) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str",e);
  }
catch (  InvocationTargetException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Decodes protobuf message
 * @param topic Kafka topic name
 * @param payload Byte array containing encoded protobuf message
 * @return protobuf message instance
 * @throws RuntimeException when there's problem decoding protobuf message
 */
public Message decodeMessage(String topic,byte[] payload){
  try {
    if (shouldDecodeFromJsonMessage(topic)) {
      try {
        return decodeJsonMessage(topic,payload);
      }
 catch (      InvalidProtocolBufferException e) {
        LOG.info("String_Node_Str");
      }
    }
    Method parseMethod=allTopics ? messageParseMethodForAll : messageParseMethodByTopic.get(topic);
    return (Message)parseMethod.invoke(null,payload);
  }
 catch (  IllegalArgumentException e) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str",e);
  }
catch (  IllegalAccessException e) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str",e);
  }
catch (  InvocationTargetException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 28454
Project: 28454
Buggy source:
private boolean shouldDecodeFromJsonMessage(String topic){
}

Fixed version (ground truth):
private boolean shouldDecodeFromJsonMessage(String topic){
  if (StringUtils.isNotEmpty(messageFormatForAll) && StringUtils.equalsIgnoreCase(messageFormatForAll,JSON)) {
    return true;
  }
 else   if (StringUtils.equalsIgnoreCase(messageFormatByTopic.getOrDefault(topic,"String_Node_Str"),JSON)) {
    return true;
  }
  return false;
}
Program: 28455
Project: 28455
Buggy source:
@Override public TypeDescription getSchema(String topic,LogFilePath logFilePath){
  return topicToSchemaMap.getOrDefault(topic,schemaForAlltopic);
}

Fixed version (ground truth):
@Override public TypeDescription getSchema(String topic,LogFilePath logFilePath){
  TypeDescription topicSpecificTD=topicToSchemaMap.get(topic);
  if (null != topicSpecificTD) {
    return topicSpecificTD;
  }
  return schemaForAlltopic;
}
Program: 28456
Project: 28456
Buggy source:
public Message(String topic,int kafkaPartition,long offset,byte[] payload){
  mTopic=topic;
  mKafkaPartition=kafkaPartition;
  mOffset=offset;
  mPayload=payload;
}

Fixed version (ground truth):
public Message(String topic,int kafkaPartition,long offset,byte[] payload){
  mTopic=topic;
  mKafkaPartition=kafkaPartition;
  mOffset=offset;
  mPayload=payload;
  if (mPayload == null) {
    mPayload=new byte[0];
  }
}
Program: 28457
Project: 28457
Buggy source:
/** 
 * Helper to publish stats to statsD client
 */
private void exportToStatsD(List<Stat> stats){
  HostAndPort hostPort=HostAndPort.fromString(mConfig.getStatsDHostPort());
  NonBlockingStatsDClient client=new NonBlockingStatsDClient(mConfig.getKafkaGroup(),hostPort.getHostText(),hostPort.getPort());
  for (  Stat stat : stats) {
    @SuppressWarnings("String_Node_Str") Map<String,String> tags=(Map<String,String>)stat.get(Stat.STAT_KEYS.TAGS.getName());
    String aspect=new StringBuilder((String)stat.get(Stat.STAT_KEYS.METRIC.getName())).append(PERIOD).append(tags.get(Stat.STAT_KEYS.TOPIC.getName())).append(PERIOD).append(tags.get(Stat.STAT_KEYS.PARTITION.getName())).toString();
    client.recordGaugeValue(aspect,(Long)stat.get(Stat.STAT_KEYS.VALUE.getName()));
  }
}

Fixed version (ground truth):
/** 
 * Helper to publish stats to statsD client
 */
private void exportToStatsD(List<Stat> stats){
  HostAndPort hostPort=HostAndPort.fromString(mConfig.getStatsDHostPort());
  NonBlockingStatsDClient client=new NonBlockingStatsDClient(mConfig.getKafkaGroup(),hostPort.getHostText(),hostPort.getPort());
  for (  Stat stat : stats) {
    @SuppressWarnings("String_Node_Str") Map<String,String> tags=(Map<String,String>)stat.get(Stat.STAT_KEYS.TAGS.getName());
    String aspect=new StringBuilder((String)stat.get(Stat.STAT_KEYS.METRIC.getName())).append(PERIOD).append(tags.get(Stat.STAT_KEYS.TOPIC.getName())).append(PERIOD).append(tags.get(Stat.STAT_KEYS.PARTITION.getName())).toString();
    client.recordGaugeValue(aspect,Long.parseLong((String)stat.get(Stat.STAT_KEYS.VALUE.getName())));
  }
}
Program: 28458
Project: 28458
Buggy source:
public void write(ParsedMessage message) throws Exception {
  TopicPartition topicPartition=new TopicPartition(message.getTopic(),message.getKafkaPartition());
  long offset=mOffsetTracker.getAdjustedCommittedOffsetCount(topicPartition);
  LogFilePath path=new LogFilePath(mLocalPrefix,mConfig.getGeneration(),offset,message,mFileExtension);
  FileWriter writer=mFileRegistry.getOrCreateWriter(path,mCodec);
  writer.write(new KeyValue(message.getOffset(),message.getPayload()));
  LOG.debug("String_Node_Str" + message + "String_Node_Str"+ path.getLogFilePath()+ "String_Node_Str"+ writer.getLength());
}

Fixed version (ground truth):
public void write(ParsedMessage message) throws Exception {
  TopicPartition topicPartition=new TopicPartition(message.getTopic(),message.getKafkaPartition());
  long offset=mOffsetTracker.getAdjustedCommittedOffsetCount(topicPartition);
  LogFilePath path=new LogFilePath(mLocalPrefix,mConfig.getGeneration(),offset,message,mFileExtension);
  FileWriter writer=mFileRegistry.getOrCreateWriter(path,mCodec);
  writer.write(new KeyValue(message.getOffset(),message.getPayload()));
  LOG.debug("String_Node_Str",message,path.getLogFilePath(),writer.getLength());
}
Program: 28459
Project: 28459
Buggy source:
public static void main(String[] args){
  RemoteControl remoteControl=new RemoteControl();
  Light livingRoomLight=new Light("String_Node_Str");
  Light kitchenLight=new Light("String_Node_Str");
  CeilingFan ceilingFan=new CeilingFan("String_Node_Str");
  GarageDoor garageDoor=new GarageDoor("String_Node_Str");
  Stereo stereo=new Stereo("String_Node_Str");
  remoteControl.setCommand(0,livingRoomLight::on,livingRoomLight::off);
  remoteControl.setCommand(1,kitchenLight::on,kitchenLight::off);
  remoteControl.setCommand(2,ceilingFan::high,ceilingFan::off);
  Command stereoOnWithCD=() -> {
    stereo.on();
    stereo.setCD();
    stereo.setVolume(11);
  }
;
  remoteControl.setCommand(3,stereoOnWithCD,stereo::off);
  remoteControl.setCommand(3,garageDoor::up,garageDoor::down);
  System.out.println(remoteControl);
  remoteControl.onButtonWasPushed(0);
  remoteControl.offButtonWasPushed(0);
  remoteControl.onButtonWasPushed(1);
  remoteControl.offButtonWasPushed(1);
  remoteControl.onButtonWasPushed(2);
  remoteControl.offButtonWasPushed(2);
  remoteControl.onButtonWasPushed(3);
  remoteControl.offButtonWasPushed(3);
  remoteControl.onButtonWasPushed(4);
}

Fixed version (ground truth):
public static void main(String[] args){
  RemoteControl remoteControl=new RemoteControl();
  Light livingRoomLight=new Light("String_Node_Str");
  Light kitchenLight=new Light("String_Node_Str");
  CeilingFan ceilingFan=new CeilingFan("String_Node_Str");
  GarageDoor garageDoor=new GarageDoor("String_Node_Str");
  Stereo stereo=new Stereo("String_Node_Str");
  remoteControl.setCommand(0,livingRoomLight::on,livingRoomLight::off);
  remoteControl.setCommand(1,kitchenLight::on,kitchenLight::off);
  remoteControl.setCommand(2,ceilingFan::high,ceilingFan::off);
  Command stereoOnWithCD=() -> {
    stereo.on();
    stereo.setCD();
    stereo.setVolume(11);
  }
;
  remoteControl.setCommand(3,stereoOnWithCD,stereo::off);
  remoteControl.setCommand(4,garageDoor::up,garageDoor::down);
  System.out.println(remoteControl);
  remoteControl.onButtonWasPushed(0);
  remoteControl.offButtonWasPushed(0);
  remoteControl.onButtonWasPushed(1);
  remoteControl.offButtonWasPushed(1);
  remoteControl.onButtonWasPushed(2);
  remoteControl.offButtonWasPushed(2);
  remoteControl.onButtonWasPushed(3);
  remoteControl.offButtonWasPushed(3);
  remoteControl.onButtonWasPushed(4);
  remoteControl.offButtonWasPushed(4);
  remoteControl.onButtonWasPushed(5);
}