nus-yam/ex-repair huggingface dataset:
Program: 25812
Project: 25812
Buggy source:
public CtConstructor makeClassInitializer() throws CannotCompileException {
  CtConstructor clinit=getClassInitializer();
  if (clinit != null)   return clinit;
  checkModify();
  ClassFile cf=getClassFile2();
  Bytecode code=new Bytecode(cf.getConstPool(),0,0);
  try {
    modifyClassConstructor(cf,b,0,0);
  }
 catch (  CompileError e) {
    throw new CannotCompileException(e);
  }
  return getClassInitializer();
}

Fixed version (ground truth):
public CtConstructor makeClassInitializer() throws CannotCompileException {
  CtConstructor clinit=getClassInitializer();
  if (clinit != null)   return clinit;
  checkModify();
  ClassFile cf=getClassFile2();
  Bytecode code=new Bytecode(cf.getConstPool(),0,0);
  modifyClassConstructor(cf,code,0,0);
  return getClassInitializer();
}
Program: 25813
Project: 25813
Buggy source:
/** 
 * Returns true if the called method is of a superclass of the current class.
 */
boolean isSuper(){
  return iterator.byteAt(currentPos) == INVOKESPECIAL && !where().getDeclaringClass().getName().equals(getClassName());
}

Fixed version (ground truth):
/** 
 * Returns true if the called method is of a superclass of the current class.
 */
public boolean isSuper(){
  return iterator.byteAt(currentPos) == INVOKESPECIAL && !where().getDeclaringClass().getName().equals(getClassName());
}
Program: 25814
Project: 25814
Buggy source:
private boolean needsSuperCall(Stmnt body){
  if (body.getOperator() == BLOCK) {
    Stmnt first=(Stmnt)body.head();
    if (first != null && first.getOperator() == EXPR) {
      ASTree expr=first.head();
      if (expr != null && expr instanceof Expr && ((Expr)expr).getOperator() == CALL) {
        ASTree target=((Expr)expr).head();
        if (target instanceof Keyword) {
          int token=((Keyword)target).get();
          return token != THIS && token != SUPER;
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean needsSuperCall(Stmnt body) throws CompileError {
  if (body.getOperator() == BLOCK)   body=(Stmnt)body.head();
  if (body != null && body.getOperator() == EXPR) {
    ASTree expr=body.head();
    if (expr != null && expr instanceof Expr && ((Expr)expr).getOperator() == CALL) {
      ASTree target=((Expr)expr).head();
      if (target instanceof Keyword) {
        int token=((Keyword)target).get();
        return token != THIS && token != SUPER;
      }
    }
  }
  return true;
}
Program: 25815
Project: 25815
Buggy source:
/** 
 * Compiles a method (or constructor) body.
 */
public Bytecode compileBody(CtBehavior method,String src) throws CompileError {
  try {
    int mod=method.getModifiers();
    recordParams(method.getParameterTypes(),Modifier.isStatic(mod));
    CtClass rtype;
    if (method instanceof CtMethod) {
      gen.setThisMethod((CtMethod)method);
      rtype=((CtMethod)method).getReturnType();
    }
 else     rtype=CtClass.voidType;
    recordReturnType(rtype,false);
    boolean isVoid=rtype == CtClass.voidType;
    Parser p=new Parser(new Lex(src));
    SymbolTable stb=new SymbolTable(stable);
    Stmnt s=p.parseStatement(stb);
    gen.atMethodBody(s,method instanceof CtConstructor,isVoid);
    return bytecode;
  }
 catch (  NotFoundException e) {
    throw new CompileError(e.toString());
  }
}

Fixed version (ground truth):
/** 
 * Compiles a method (or constructor) body.
 * @src	a single statement or a block.
 */
public Bytecode compileBody(CtBehavior method,String src) throws CompileError {
  try {
    int mod=method.getModifiers();
    recordParams(method.getParameterTypes(),Modifier.isStatic(mod));
    CtClass rtype;
    if (method instanceof CtMethod) {
      gen.setThisMethod((CtMethod)method);
      rtype=((CtMethod)method).getReturnType();
    }
 else     rtype=CtClass.voidType;
    recordReturnType(rtype,false);
    boolean isVoid=rtype == CtClass.voidType;
    Parser p=new Parser(new Lex(src));
    SymbolTable stb=new SymbolTable(stable);
    Stmnt s=p.parseStatement(stb);
    gen.atMethodBody(s,method instanceof CtConstructor,isVoid);
    return bytecode;
  }
 catch (  NotFoundException e) {
    throw new CompileError(e.toString());
  }
}
Program: 25818
Project: 25818
Buggy source:
public void onTouchUp(PointF touchPointF,int selectedIndex){
  maslipcandlestickchart.setTouchPoint(touchPointF);
  maslipcandlestickchart.setClickPostX(touchPointF.x);
  maslipcandlestickchart.setClickPostY(touchPointF.y);
  maslipcandlestickchart.postInvalidate();
}

Fixed version (ground truth):
public void onTouchUp(PointF touchPointF,int selectedIndex){
  maslipcandlestickchart.setTouchPoint(touchPointF);
  maslipcandlestickchart.postInvalidate();
}
Program: 25819
Project: 25819
Buggy source:
public void onTouchMoved(PointF touchPointF,int selectedIndex){
  maslipcandlestickchart.setTouchPoint(touchPointF);
  maslipcandlestickchart.setClickPostX(touchPointF.x);
  maslipcandlestickchart.setClickPostY(touchPointF.y);
  maslipcandlestickchart.postInvalidate();
}

Fixed version (ground truth):
public void onTouchMoved(PointF touchPointF,int selectedIndex){
  maslipcandlestickchart.setTouchPoint(touchPointF);
  maslipcandlestickchart.postInvalidate();
}
Program: 25820
Project: 25820
Buggy source:
public void onTouchDown(PointF touchPointF,int selectedIndex){
  maslipcandlestickchart.setTouchPoint(touchPointF);
  maslipcandlestickchart.setClickPostX(touchPointF.x);
  maslipcandlestickchart.setClickPostY(touchPointF.y);
  maslipcandlestickchart.postInvalidate();
}

Fixed version (ground truth):
public void onTouchDown(PointF touchPointF,int selectedIndex){
  maslipcandlestickchart.setTouchPoint(touchPointF);
  maslipcandlestickchart.postInvalidate();
}
Program: 25822
Project: 25822
Buggy source:
/** 
 * <p> calculate the distance between two touch points </p> <p> 複数タッチしたポイントの距離 </p> <p> 计算两点触控时两点之间的距离 </p>
 * @param event
 * @return float<p> distance </p> <p> 距離 </p> <p> 距离 </p>
 */
private float calcDistance(MotionEvent event){
  float x=event.getX(0) - event.getX(1);
  float y=event.getY(0) - event.getY(1);
  return FloatMath.sqrt(x * x + y * y);
}

Fixed version (ground truth):
/** 
 * <p> calculate the distance between two touch points </p> <p> 複数タッチしたポイントの距離 </p> <p> 计算两点触控时两点之间的距离 </p>
 * @param event
 * @return float<p> distance </p> <p> 距離 </p> <p> 距离 </p>
 */
protected float calcDistance(MotionEvent event){
  if (event.getPointerCount() <= 1) {
    return 0f;
  }
 else {
    float x=event.getX(0) - event.getX(1);
    float y=event.getY(0) - event.getY(1);
    return FloatMath.sqrt(x * x + y * y);
  }
}
Program: 25823
Project: 25823
Buggy source:
/** 
 * <p> calculate the distance between two touch points </p> <p> 複数タッチしたポイントの距離 </p> <p> 计算两点触控时两点之间的距离 </p>
 * @param event
 * @return float<p> distance </p> <p> 距離 </p> <p> 距离 </p>
 */
protected float calcDistance(MotionEvent event){
  float x=event.getX(0) - event.getX(1);
  float y=event.getY(0) - event.getY(1);
  return FloatMath.sqrt(x * x + y * y);
}

Fixed version (ground truth):
/** 
 * <p> calculate the distance between two touch points </p> <p> 複数タッチしたポイントの距離 </p> <p> 计算两点触控时两点之间的距离 </p>
 * @param event
 * @return float<p> distance </p> <p> 距離 </p> <p> 距离 </p>
 */
protected float calcDistance(MotionEvent event){
  if (event.getPointerCount() <= 1) {
    return 0f;
  }
 else {
    float x=event.getX(0) - event.getX(1);
    float y=event.getY(0) - event.getY(1);
    return FloatMath.sqrt(x * x + y * y);
  }
}
Program: 25824
Project: 25824
Buggy source:
/** 
 * <p> calculate the distance between two touch points </p> <p> 複数タッチしたポイントの距離 </p> <p> 计算两点触控时两点之间的距离 </p>
 * @param event
 * @return float<p> distance </p> <p> 距離 </p> <p> 距离 </p>
 */
protected float calcDistance(MotionEvent event){
  float x=event.getX(0) - event.getX(1);
  float y=event.getY(0) - event.getY(1);
  return FloatMath.sqrt(x * x + y * y);
}

Fixed version (ground truth):
/** 
 * <p> calculate the distance between two touch points </p> <p> 複数タッチしたポイントの距離 </p> <p> 计算两点触控时两点之间的距离 </p>
 * @param event
 * @return float<p> distance </p> <p> 距離 </p> <p> 距离 </p>
 */
protected float calcDistance(MotionEvent event){
  if (event.getPointerCount() <= 1) {
    return 0f;
  }
 else {
    float x=event.getX(0) - event.getX(1);
    float y=event.getY(0) - event.getY(1);
    return FloatMath.sqrt(x * x + y * y);
  }
}
Program: 25825
Project: 25825
Buggy source:
/** 
 * <p> calculate the distance between two touch points </p> <p> 複数タッチしたポイントの距離 </p> <p> 计算两点触控时两点之间的距离 </p>
 * @param event
 * @return float<p> distance </p> <p> 距離 </p> <p> 距离 </p>
 */
private float calcDistance(MotionEvent event){
  float x=event.getX(0) - event.getX(1);
  float y=event.getY(0) - event.getY(1);
  return FloatMath.sqrt(x * x + y * y);
}

Fixed version (ground truth):
/** 
 * <p> calculate the distance between two touch points </p> <p> 複数タッチしたポイントの距離 </p> <p> 计算两点触控时两点之间的距离 </p>
 * @param event
 * @return float<p> distance </p> <p> 距離 </p> <p> 距离 </p>
 */
protected float calcDistance(MotionEvent event){
  if (event.getPointerCount() <= 1) {
    return 0f;
  }
 else {
    float x=event.getX(0) - event.getX(1);
    float y=event.getY(0) - event.getY(1);
    return FloatMath.sqrt(x * x + y * y);
  }
}
Program: 25826
Project: 25826
Buggy source:
protected float getDataQuadrantPaddingEndY(){
  return getDataQuadrantEndY() - dataQuadrantPaddingTop;
}

Fixed version (ground truth):
protected float getDataQuadrantPaddingEndY(){
  return getDataQuadrantEndY() - dataQuadrantPaddingBottom;
}
Program: 25829
Project: 25829
Buggy source:
public static void main(String[] args) throws IOException, InvalidRemoteException, TransportException, GitAPIException {
  File localPath=File.createTempFile("String_Node_Str","String_Node_Str");
  localPath.delete();
  System.out.println("String_Node_Str" + REMOTE_URL + "String_Node_Str"+ localPath);
  try (Git result=Git.cloneRepository().setURI(REMOTE_URL).setDirectory(localPath).call()){
    System.out.println("String_Node_Str" + result.getRepository().getDirectory());
    result.getRepository().close();
  }
 }

Fixed version (ground truth):
public static void main(String[] args) throws IOException, InvalidRemoteException, TransportException, GitAPIException {
  File localPath=File.createTempFile("String_Node_Str","String_Node_Str");
  localPath.delete();
  System.out.println("String_Node_Str" + REMOTE_URL + "String_Node_Str"+ localPath);
  try (Git result=Git.cloneRepository().setURI(REMOTE_URL).setDirectory(localPath).call()){
    System.out.println("String_Node_Str" + result.getRepository().getDirectory());
  }
 }
Program: 25830
Project: 25830
Buggy source:
public static void main(String[] args) throws IOException, InvalidRemoteException, TransportException, GitAPIException {
  CredentialsProvider allowHosts=new CredentialsProvider(){
    @Override public boolean supports(    CredentialItem... items){
      for (      CredentialItem item : items) {
        if ((item instanceof CredentialItem.YesNoType)) {
          return true;
        }
      }
      return false;
    }
    @Override public boolean get(    URIish uri,    CredentialItem... items) throws UnsupportedCredentialItem {
      for (      CredentialItem item : items) {
        if (item instanceof CredentialItem.YesNoType) {
          ((CredentialItem.YesNoType)item).setValue(true);
          return true;
        }
      }
      return false;
    }
    @Override public boolean isInteractive(){
      return false;
    }
  }
;
  File localPath=File.createTempFile("String_Node_Str","String_Node_Str");
  localPath.delete();
  System.out.println("String_Node_Str" + REMOTE_URL + "String_Node_Str"+ localPath);
  try (Git result=Git.cloneRepository().setURI(REMOTE_URL).setDirectory(localPath).setCredentialsProvider(allowHosts).call()){
    System.out.println("String_Node_Str" + result.getRepository().getDirectory());
    result.getRepository().close();
  }
 }

Fixed version (ground truth):
public static void main(String[] args) throws IOException, InvalidRemoteException, TransportException, GitAPIException {
  CredentialsProvider allowHosts=new CredentialsProvider(){
    @Override public boolean supports(    CredentialItem... items){
      for (      CredentialItem item : items) {
        if ((item instanceof CredentialItem.YesNoType)) {
          return true;
        }
      }
      return false;
    }
    @Override public boolean get(    URIish uri,    CredentialItem... items) throws UnsupportedCredentialItem {
      for (      CredentialItem item : items) {
        if (item instanceof CredentialItem.YesNoType) {
          ((CredentialItem.YesNoType)item).setValue(true);
          return true;
        }
      }
      return false;
    }
    @Override public boolean isInteractive(){
      return false;
    }
  }
;
  File localPath=File.createTempFile("String_Node_Str","String_Node_Str");
  localPath.delete();
  System.out.println("String_Node_Str" + REMOTE_URL + "String_Node_Str"+ localPath);
  try (Git result=Git.cloneRepository().setURI(REMOTE_URL).setDirectory(localPath).setCredentialsProvider(allowHosts).call()){
    System.out.println("String_Node_Str" + result.getRepository().getDirectory());
  }
 }
Program: 25831
Project: 25831
Buggy source:
public static void main(String[] args) throws IOException, InvalidRemoteException, TransportException, GitAPIException {
  File localPath=File.createTempFile("String_Node_Str","String_Node_Str");
  localPath.delete();
  System.out.println("String_Node_Str" + REMOTE_URL + "String_Node_Str"+ localPath);
  try (Git result=Git.cloneRepository().setURI(REMOTE_URL).setDirectory(localPath).call()){
    System.out.println("String_Node_Str" + result.getRepository().getDirectory());
    try (Git git=new Git(result.getRepository())){
      git.pull().call();
    }
     System.out.println("String_Node_Str" + result.getRepository().getDirectory());
    result.getRepository().close();
  }
 }

Fixed version (ground truth):
public static void main(String[] args) throws IOException, InvalidRemoteException, TransportException, GitAPIException {
  File localPath=File.createTempFile("String_Node_Str","String_Node_Str");
  localPath.delete();
  System.out.println("String_Node_Str" + REMOTE_URL + "String_Node_Str"+ localPath);
  try (Git result=Git.cloneRepository().setURI(REMOTE_URL).setDirectory(localPath).call()){
    System.out.println("String_Node_Str" + result.getRepository().getDirectory());
    try (Git git=new Git(result.getRepository())){
      git.pull().call();
    }
     System.out.println("String_Node_Str" + result.getRepository().getDirectory());
  }
 }
Program: 25832
Project: 25832
Buggy source:
private void doSave(){
  File file=ImageLoader.getInstance().getDiscCache().get(url);
  if (file == null || !file.isFile()) {
    return;
  }
  String ext=url.toLowerCase().endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
  final String fileName="String_Node_Str" + System.currentTimeMillis() + ext;
  File dest=new File(IOHelper.getPictureDir(this),fileName);
  if (dest.exists() || IOHelper.copyFile(file,dest)) {
    Utils.mediaScan(this,Uri.fromFile(dest));
    Utils.notifyLong(this,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void doSave(){
  File file=ImageLoader.getInstance().getDiscCache().get(url);
  if (file == null || !file.isFile()) {
    return;
  }
  String ext=url.toLowerCase().endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
  final String fileName="String_Node_Str" + System.currentTimeMillis() + ext;
  File dest=new File(IOHelper.getPictureDir(this),fileName);
  if (dest.exists() || IOHelper.copyFile(file,dest)) {
    Utils.mediaScan(this,Uri.fromFile(dest));
    Utils.notify(this,"String_Node_Str");
  }
}
Program: 25833
Project: 25833
Buggy source:
private void doSave(){
  final StatusModel model=mGalleryPagerAdapter.getUrlAt(mViewPager.getCurrentItem());
  final String imageUri=model.getPhotoLargeUrl().split("String_Node_Str")[0];
  if (TextUtils.isEmpty(imageUri)) {
    return;
  }
  File file=ImageLoader.getInstance().getDiscCache().get(imageUri);
  if (file == null || !file.isFile()) {
    return;
  }
  String ext=imageUri.toLowerCase().endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
  final String fileName="String_Node_Str" + System.currentTimeMillis() + ext;
  File dest=new File(IOHelper.getPictureDir(getActivity()),fileName);
  if (dest.exists() || IOHelper.copyFile(file,dest)) {
    Utils.mediaScan(getActivity(),Uri.fromFile(dest));
    Utils.notifyLong(getActivity(),"String_Node_Str");
  }
}

Fixed version (ground truth):
private void doSave(){
  final StatusModel model=mGalleryPagerAdapter.getUrlAt(mViewPager.getCurrentItem());
  final String imageUri=model.getPhotoLargeUrl().split("String_Node_Str")[0];
  if (TextUtils.isEmpty(imageUri)) {
    return;
  }
  File file=ImageLoader.getInstance().getDiscCache().get(imageUri);
  if (file == null || !file.isFile()) {
    return;
  }
  String ext=imageUri.toLowerCase().endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
  final String fileName="String_Node_Str" + System.currentTimeMillis() + ext;
  File dest=new File(IOHelper.getPictureDir(getActivity()),fileName);
  if (dest.exists() || IOHelper.copyFile(file,dest)) {
    Utils.mediaScan(getActivity(),Uri.fromFile(dest));
    Utils.notify(getActivity(),"String_Node_Str");
  }
}
Program: 25834
Project: 25834
Buggy source:
@BusReceiver public void onEvent(StatusUpdateEvent event){
  if (AppContext.DEBUG) {
    Log.d(TAG,"String_Node_Str");
  }
  Utils.notify(getActivity(),"String_Node_Str");
  startRefresh();
}

Fixed version (ground truth):
@BusReceiver public void onEvent(StatusUpdateEvent event){
  if (AppContext.DEBUG) {
    Log.d(TAG,"String_Node_Str");
  }
  Utils.notify(getActivity(),"String_Node_Str");
  doRefresh();
}
Program: 25835
Project: 25835
Buggy source:
@Override protected void onHandleIntent(Intent intent){
  super.onHandleIntent(intent);
  doWakefulWork(intent);
  PushReceiver.completeWakefulIntent(intent);
}

Fixed version (ground truth):
@Override protected void onHandleIntent(Intent intent){
  super.onHandleIntent(intent);
  debug("String_Node_Str");
  doWakefulWork(intent);
  PushReceiver.completeWakefulIntent(intent);
}
Program: 25836
Project: 25836
Buggy source:
protected void doWakefulWork(Intent intent){
  boolean enabled=PreferenceHelper.getInstance(this).isPushNotificationEnabled();
  if (!enabled) {
    return;
  }
  final Calendar calendar=Calendar.getInstance();
  if (calendar.get(Calendar.HOUR_OF_DAY) < 6) {
    return;
  }
  int type=intent.getIntExtra("String_Node_Str",TYPE_ALL);
  debug("String_Node_Str" + type);
switch (type) {
case TYPE_MENTION:
    checkMentions();
  break;
case TYPE_MESSAGE:
checkDirectMessages();
break;
case TYPE_ALL:
checkMentions();
checkDirectMessages();
break;
default :
break;
}
}

Fixed version (ground truth):
protected void doWakefulWork(Intent intent){
  boolean enabled=PreferenceHelper.getInstance(this).isPushNotificationEnabled();
  if (!enabled) {
    debug("String_Node_Str");
    return;
  }
  final Calendar calendar=Calendar.getInstance();
  if (calendar.get(Calendar.HOUR_OF_DAY) < 6) {
    return;
  }
  int type=intent.getIntExtra("String_Node_Str",TYPE_ALL);
  debug("String_Node_Str" + type);
switch (type) {
case TYPE_MENTION:
    checkMentions();
  break;
case TYPE_MESSAGE:
checkDirectMessages();
break;
case TYPE_ALL:
checkMentions();
checkDirectMessages();
break;
default :
break;
}
}
Program: 25837
Project: 25837
Buggy source:
private void checkMentions(){
  String sinceId=getSinceId();
  debug("String_Node_Str" + sinceId);
  if (!TextUtils.isEmpty(sinceId)) {
    Api api=AppContext.getApi();
    Paging p=new Paging();
    p.sinceId=sinceId;
    try {
      List<StatusModel> ss=api.getMentions(p);
      if (ss != null && ss.size() > 0) {
        debug("String_Node_Str" + ss);
        DataController.store(this,ss);
        StatusModel sm=ss.get(0);
        if (AppContext.homeVisible) {
          Bus.getDefault().post(new PushStatusEvent(sm));
        }
 else {
          showMention(sm);
        }
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void checkMentions(){
  String sinceId=getSinceId();
  debug("String_Node_Str" + sinceId);
  if (!TextUtils.isEmpty(sinceId)) {
    Api api=AppContext.getApi();
    Paging p=new Paging();
    p.sinceId=sinceId;
    try {
      List<StatusModel> ss=api.getMentions(p);
      if (ss != null && ss.size() > 0) {
        debug("String_Node_Str" + ss);
        DataController.store(this,ss);
        StatusModel sm=ss.get(0);
        showMention(sm);
        if (AppContext.homeVisible) {
          Bus.getDefault().post(new PushStatusEvent(sm));
        }
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 25838
Project: 25838
Buggy source:
private void checkDirectMessages(){
  String sinceId=getDMSinceId();
  debug("String_Node_Str" + sinceId);
  if (!TextUtils.isEmpty(sinceId)) {
    Api api=AppContext.getApi();
    Paging p=new Paging();
    p.sinceId=sinceId;
    try {
      List<DirectMessageModel> dms=api.getDirectMessagesInbox(p);
      if (dms != null && dms.size() > 0) {
        debug("String_Node_Str" + dms);
        DataController.store(this,dms);
        DirectMessageModel dm=dms.get(0);
        if (AppContext.homeVisible) {
          Bus.getDefault().post(new PushMessageEvent(dm));
        }
 else {
          showDM(dm);
        }
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
 else {
    debug("String_Node_Str");
    SyncService.getConversationList(getApplication());
  }
}

Fixed version (ground truth):
private void checkDirectMessages(){
  String sinceId=getDMSinceId();
  debug("String_Node_Str" + sinceId);
  if (!TextUtils.isEmpty(sinceId)) {
    Api api=AppContext.getApi();
    Paging p=new Paging();
    p.sinceId=sinceId;
    try {
      List<DirectMessageModel> dms=api.getDirectMessagesInbox(p);
      if (dms != null && dms.size() > 0) {
        debug("String_Node_Str" + dms);
        DataController.store(this,dms);
        DirectMessageModel dm=dms.get(0);
        showDM(dm);
        if (AppContext.homeVisible) {
          Bus.getDefault().post(new PushMessageEvent(dm));
        }
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
 else {
    debug("String_Node_Str");
    SyncService.getConversationList(getApplication());
  }
}
Program: 25839
Project: 25839
Buggy source:
private void doClose(){
  mExecutor.shutdownNow();
  mExecutor=null;
  mCommandHandler.removeCallbacksAndMessages(null);
  mCommandHandler.getLooper().quit();
  mCommandHandler=null;
  mNotificationManager.cancelAll();
}

Fixed version (ground truth):
private void doClose(){
  mExecutor.shutdownNow();
  mExecutor=null;
  mCommandHandler.removeCallbacksAndMessages(null);
  mCommandHandler.getLooper().quit();
  mCommandHandler=null;
}
Program: 25840
Project: 25840
Buggy source:
private void onMenuClearClick(){
  DataController.clear(mContext,RecordColumns.CONTENT_URI);
  Utils.notify(this,"String_Node_Str");
  finish();
}

Fixed version (ground truth):
private void onMenuClearClick(){
  DataController.clear(mContext,StatusUpdateInfoColumns.CONTENT_URI);
  Utils.notify(this,"String_Node_Str");
  finish();
}
Program: 25841
Project: 25841
Buggy source:
private void setListView(){
  mCursor=managedQuery(RecordColumns.CONTENT_URI,null,null,null,null);
  mAdapter=new RecordCursorAdaper(this,mCursor);
  mListView=(ListView)findViewById(android.R.id.list);
  mListView.setAdapter(mAdapter);
  mListView.setOnItemClickListener(this);
  registerForContextMenu(mListView);
}

Fixed version (ground truth):
private void setListView(){
  mCursor=managedQuery(StatusUpdateInfoColumns.CONTENT_URI,null,null,null,null);
  mAdapter=new RecordCursorAdaper(this,mCursor);
  mListView=(ListView)findViewById(android.R.id.list);
  mListView.setAdapter(mAdapter);
  mListView.setOnItemClickListener(this);
  registerForContextMenu(mListView);
}
Program: 25842
Project: 25842
Buggy source:
private void parseIntent(){
  type=TYPE_NORMAL;
  Intent intent=getIntent();
  if (intent != null) {
    String action=intent.getAction();
    if (action == null) {
      type=intent.getIntExtra("String_Node_Str",TYPE_NORMAL);
      text=intent.getStringExtra("String_Node_Str");
      inReplyToStatusId=intent.getStringExtra("String_Node_Str");
      File file=(File)intent.getSerializableExtra("String_Node_Str");
      long draftId=intent.getIntExtra("String_Node_Str",-1);
      parsePhoto(file);
      updateUI();
      deleteRecord(draftId);
    }
 else     if (action.equals(Intent.ACTION_SEND) || action.equals(Constants.ACTION_SEND)) {
      Bundle extras=intent.getExtras();
      if (extras != null) {
        text=extras.getString(Intent.EXTRA_TEXT);
        Uri uri=extras.getParcelable(Intent.EXTRA_STREAM);
        parsePhoto(uri);
        updateUI();
      }
    }
    if (AppContext.DEBUG) {
      log("String_Node_Str" + type);
      log("String_Node_Str" + text);
    }
  }
}

Fixed version (ground truth):
private void parseIntent(){
  type=StatusUpdateInfo.TYPE_NONE;
  Intent intent=getIntent();
  if (intent != null) {
    String action=intent.getAction();
    if (action == null) {
      type=intent.getIntExtra("String_Node_Str",StatusUpdateInfo.TYPE_NONE);
      text=intent.getStringExtra("String_Node_Str");
      inReplyToStatusId=intent.getStringExtra("String_Node_Str");
      File file=(File)intent.getSerializableExtra("String_Node_Str");
      long draftId=intent.getIntExtra("String_Node_Str",-1);
      parsePhoto(file);
      updateUI();
      deleteRecord(draftId);
    }
 else     if (action.equals(Intent.ACTION_SEND) || action.equals(Constants.ACTION_SEND)) {
      Bundle extras=intent.getExtras();
      if (extras != null) {
        text=extras.getString(Intent.EXTRA_TEXT);
        Uri uri=extras.getParcelable(Intent.EXTRA_STREAM);
        parsePhoto(uri);
        updateUI();
      }
    }
    if (AppContext.DEBUG) {
      log("String_Node_Str" + type);
      log("String_Node_Str" + text);
    }
  }
}
Program: 25843
Project: 25843
Buggy source:
private void startSendService(){
  Intent i=new Intent(mContext,SyncService.class);
  i.putExtra("String_Node_Str",SyncService.STATUS_UPDATE);
  i.putExtra("String_Node_Str",type);
  i.putExtra("String_Node_Str",content);
  i.putExtra("String_Node_Str",photo);
  i.putExtra("String_Node_Str",mLocationString);
  i.putExtra("String_Node_Str",inReplyToStatusId);
  if (AppContext.DEBUG) {
    log("String_Node_Str" + i);
  }
  startService(i);
}

Fixed version (ground truth):
private void startSendService(){
  Intent i=new Intent(mContext,SyncService.class);
  StatusUpdateInfo info=new StatusUpdateInfo();
  info.type=type;
  info.userId=AppContext.getAccount();
  info.text=content;
  info.fileName=photo == null ? null : photo.toString();
  info.location=mLocationString;
  info.reply=inReplyToStatusId;
  info.repost=inReplyToStatusId;
  i.putExtra("String_Node_Str",SyncService.STATUS_UPDATE);
  i.putExtra(StatusUpdateInfo.TAG,info);
  if (AppContext.DEBUG) {
    log("String_Node_Str" + i);
  }
  startService(i);
}
Program: 25844
Project: 25844
Buggy source:
private void updateUI(){
  if (!StringHelper.isEmpty(text)) {
    mAutoCompleteTextView.setText(text);
    if (type != TYPE_REPOST) {
      Selection.setSelection(mAutoCompleteTextView.getText(),mAutoCompleteTextView.getText().length());
    }
  }
  showInfo(mAutoCompleteTextView.getText().length());
  if (photoUri != null) {
    showPhoto();
  }
}

Fixed version (ground truth):
private void updateUI(){
  if (!StringHelper.isEmpty(text)) {
    mAutoCompleteTextView.setText(text);
    if (type != StatusUpdateInfo.TYPE_REPOST) {
      Selection.setSelection(mAutoCompleteTextView.getText(),mAutoCompleteTextView.getText().length());
    }
  }
  showInfo(mAutoCompleteTextView.getText().length());
  if (photoUri != null) {
    showPhoto();
  }
}
Program: 25845
Project: 25845
Buggy source:
private void doSaveRecord(){
  RecordModel rm=new RecordModel();
  rm.setType(type);
  rm.setText(content);
  rm.setFile(photo == null ? "String_Node_Str" : photo.toString());
  rm.setReply(inReplyToStatusId);
  getContentResolver().insert(RecordColumns.CONTENT_URI,rm.values());
}

Fixed version (ground truth):
private void doSaveRecord(){
  RecordModel rm=new RecordModel();
  rm.setType(type);
  rm.setText(content);
  rm.setFile(photo == null ? "String_Node_Str" : photo.toString());
  rm.setReply(inReplyToStatusId);
  getContentResolver().insert(StatusUpdateInfoColumns.CONTENT_URI,rm.values());
}
Program: 25846
Project: 25846
Buggy source:
public static void clearDatabase(Context context){
  ContentResolver cr=context.getContentResolver();
  cr.delete(StatusColumns.CONTENT_URI,null,null);
  cr.delete(UserColumns.CONTENT_URI,null,null);
  cr.delete(DirectMessageColumns.CONTENT_URI,null,null);
  cr.delete(RecordColumns.CONTENT_URI,null,null);
}

Fixed version (ground truth):
public static void clearDatabase(Context context){
  ContentResolver cr=context.getContentResolver();
  cr.delete(StatusColumns.CONTENT_URI,null,null);
  cr.delete(UserColumns.CONTENT_URI,null,null);
  cr.delete(DirectMessageColumns.CONTENT_URI,null,null);
  cr.delete(StatusUpdateInfoColumns.CONTENT_URI,null,null);
}
Program: 25847
Project: 25847
Buggy source:
public static int deleteRecord(Context context,long id){
  Uri uri=ContentUris.withAppendedId(RecordColumns.CONTENT_URI,id);
  return context.getContentResolver().delete(uri,null,null);
}

Fixed version (ground truth):
public static int deleteRecord(Context context,long id){
  Uri uri=ContentUris.withAppendedId(StatusUpdateInfoColumns.CONTENT_URI,id);
  return context.getContentResolver().delete(uri,null,null);
}
Program: 25848
Project: 25848
Buggy source:
public static void doRetweet(Activity context,final StatusModel status){
  Intent intent=new Intent(context,UIWrite.class);
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str").append(status.getUserScreenName()).append("String_Node_Str").append(status.getSimpleText());
  intent.putExtra("String_Node_Str",builder.toString());
  intent.putExtra("String_Node_Str",status.getId());
  intent.putExtra("String_Node_Str",UIWrite.TYPE_REPOST);
  startUIByAnimation(context,intent);
}

Fixed version (ground truth):
public static void doRetweet(Activity context,final StatusModel status){
  Intent intent=new Intent(context,UIWrite.class);
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str").append(status.getUserScreenName()).append("String_Node_Str").append(status.getSimpleText());
  intent.putExtra("String_Node_Str",builder.toString());
  intent.putExtra("String_Node_Str",status.getId());
  intent.putExtra("String_Node_Str",StatusUpdateInfo.TYPE_REPOST);
  startUIByAnimation(context,intent);
}
Program: 25849
Project: 25849
Buggy source:
public static void doReply(Activity context,StatusModel status){
  if (status != null) {
    StringBuilder sb=new StringBuilder();
    boolean replyToAll=true;
    if (replyToAll) {
      ArrayList<String> names=StatusHelper.getMentions(status);
      for (      String name : names) {
        sb.append("String_Node_Str").append(name).append("String_Node_Str");
      }
    }
 else {
      sb.append("String_Node_Str").append(status.getUserScreenName()).append("String_Node_Str");
    }
    Intent intent=new Intent(context,UIWrite.class);
    intent.putExtra("String_Node_Str",status.getId());
    intent.putExtra("String_Node_Str",sb.toString());
    intent.putExtra("String_Node_Str",UIWrite.TYPE_REPLY);
    startUIByAnimation(context,intent);
  }
 else {
    showWrite(context);
  }
}

Fixed version (ground truth):
public static void doReply(Activity context,StatusModel status){
  if (status != null) {
    StringBuilder sb=new StringBuilder();
    boolean replyToAll=true;
    if (replyToAll) {
      ArrayList<String> names=StatusHelper.getMentions(status);
      for (      String name : names) {
        sb.append("String_Node_Str").append(name).append("String_Node_Str");
      }
    }
 else {
      sb.append("String_Node_Str").append(status.getUserScreenName()).append("String_Node_Str");
    }
    Intent intent=new Intent(context,UIWrite.class);
    intent.putExtra("String_Node_Str",status.getId());
    intent.putExtra("String_Node_Str",sb.toString());
    intent.putExtra("String_Node_Str",StatusUpdateInfo.TYPE_REPLY);
    startUIByAnimation(context,intent);
  }
 else {
    showWrite(context);
  }
}
Program: 25850
Project: 25850
Buggy source:
private int deleteRecordById(Uri uri){
  String id=uri.getPathSegments().get(1);
  String table=RecordColumns.TABLE_NAME;
  String where=BaseColumns._ID + "String_Node_Str" + id;
  return dbHelper.getWritableDatabase().delete(table,where,null);
}

Fixed version (ground truth):
private int deleteRecordById(Uri uri){
  String id=uri.getPathSegments().get(1);
  String table=StatusUpdateInfoColumns.TABLE_NAME;
  String where=BaseColumns._ID + "String_Node_Str" + id;
  return dbHelper.getWritableDatabase().delete(table,where,null);
}
Program: 25851
Project: 25851
Buggy source:
@Override public String getType(Uri uri){
switch (sUriMatcher.match(uri)) {
case USERS:
    return UserColumns.CONTENT_TYPE;
case USER_ID:
  return UserColumns.CONTENT_ITEM_TYPE;
case STATUSES:
return StatusColumns.CONTENT_TYPE;
case STATUS_ID:
return StatusColumns.CONTENT_ITEM_TYPE;
case MESSAGES:
return DirectMessageColumns.CONTENT_TYPE;
case MESSAGE_ID:
return DirectMessageColumns.CONTENT_ITEM_TYPE;
case RECORDS:
return RecordColumns.CONTENT_TYPE;
case RECORD_ID:
return RecordColumns.CONTENT_ITEM_TYPE;
default :
throw new IllegalArgumentException("String_Node_Str" + uri);
}
}

Fixed version (ground truth):
@Override public String getType(Uri uri){
switch (sUriMatcher.match(uri)) {
case USERS:
    return UserColumns.CONTENT_TYPE;
case USER_ID:
  return UserColumns.CONTENT_ITEM_TYPE;
case STATUSES:
return StatusColumns.CONTENT_TYPE;
case STATUS_ID:
return StatusColumns.CONTENT_ITEM_TYPE;
case MESSAGES:
return DirectMessageColumns.CONTENT_TYPE;
case MESSAGE_ID:
return DirectMessageColumns.CONTENT_ITEM_TYPE;
case RECORDS:
return StatusUpdateInfoColumns.CONTENT_TYPE;
case RECORD_ID:
return StatusUpdateInfoColumns.CONTENT_ITEM_TYPE;
default :
throw new IllegalArgumentException("String_Node_Str" + uri);
}
}
Program: 25852
Project: 25852
Buggy source:
@Override public void onCreate(SQLiteDatabase db){
  db.execSQL(StatusColumns.CREATE_TABLE);
  db.execSQL(UserColumns.CREATE_TABLE);
  db.execSQL(DirectMessageColumns.CREATE_TABLE);
  db.execSQL(RecordColumns.CREATE_TABLE);
}

Fixed version (ground truth):
@Override public void onCreate(SQLiteDatabase db){
  db.execSQL(StatusColumns.CREATE_TABLE);
  db.execSQL(UserColumns.CREATE_TABLE);
  db.execSQL(DirectMessageColumns.CREATE_TABLE);
  db.execSQL(StatusUpdateInfoColumns.CREATE_TABLE);
}
Program: 25853
Project: 25853
Buggy source:
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  db.execSQL("String_Node_Str" + StatusColumns.TABLE_NAME);
  db.execSQL("String_Node_Str" + UserColumns.TABLE_NAME);
  db.execSQL("String_Node_Str" + DirectMessageColumns.TABLE_NAME);
  db.execSQL("String_Node_Str" + RecordColumns.TABLE_NAME);
  onCreate(db);
}

Fixed version (ground truth):
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  db.execSQL("String_Node_Str" + StatusColumns.TABLE_NAME);
  db.execSQL("String_Node_Str" + UserColumns.TABLE_NAME);
  db.execSQL("String_Node_Str" + DirectMessageColumns.TABLE_NAME);
  db.execSQL("String_Node_Str" + StatusUpdateInfoColumns.TABLE_NAME);
  onCreate(db);
}
Program: 25854
Project: 25854
Buggy source:
@Override public ContentValues values(){
  ContentValues cv=new ContentValues();
  cv.put(RecordColumns.TYPE,type);
  cv.put(RecordColumns.TEXT,text);
  cv.put(RecordColumns.REPLY,reply);
  cv.put(RecordColumns.FILE,file);
  return cv;
}

Fixed version (ground truth):
@Override public ContentValues values(){
  ContentValues cv=new ContentValues();
  cv.put(StatusUpdateInfoColumns.TYPE,type);
  cv.put(StatusUpdateInfoColumns.TEXT,text);
  cv.put(StatusUpdateInfoColumns.REPLY,reply);
  cv.put(StatusUpdateInfoColumns.FILE,file);
  return cv;
}
Program: 25855
Project: 25855
Buggy source:
@Override public Uri getContentUri(){
  return RecordColumns.CONTENT_URI;
}

Fixed version (ground truth):
@Override public Uri getContentUri(){
  return StatusUpdateInfoColumns.CONTENT_URI;
}
Program: 25856
Project: 25856
Buggy source:
@Override public String getTable(){
  return RecordColumns.TABLE_NAME;
}

Fixed version (ground truth):
@Override public String getTable(){
  return StatusUpdateInfoColumns.TABLE_NAME;
}
Program: 25857
Project: 25857
Buggy source:
public static RecordModel from(Cursor cursor){
  if (cursor == null) {
    return null;
  }
  RecordModel rm=new RecordModel();
  rm.id=DataController.parseInt(cursor,BaseColumns._ID);
  rm.type=DataController.parseInt(cursor,RecordColumns.TYPE);
  rm.text=DataController.parseString(cursor,RecordColumns.TEXT);
  rm.reply=DataController.parseString(cursor,RecordColumns.REPLY);
  rm.file=DataController.parseString(cursor,RecordColumns.FILE);
  return rm;
}

Fixed version (ground truth):
public static RecordModel from(Cursor cursor){
  if (cursor == null) {
    return null;
  }
  RecordModel rm=new RecordModel();
  rm.id=DataController.parseInt(cursor,BaseColumns._ID);
  rm.type=DataController.parseInt(cursor,StatusUpdateInfoColumns.TYPE);
  rm.text=DataController.parseString(cursor,StatusUpdateInfoColumns.TEXT);
  rm.reply=DataController.parseString(cursor,StatusUpdateInfoColumns.REPLY);
  rm.file=DataController.parseString(cursor,StatusUpdateInfoColumns.FILE);
  return rm;
}
Program: 25858
Project: 25858
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  SparseBooleanArray sba=mListView.getCheckedItemPositions();
  mUserNames.clear();
  for (int i=0; i < sba.size(); i++) {
    int key=sba.keyAt(i);
    boolean value=sba.valueAt(i);
    mCursorAdapter.setItemChecked(key,value);
    if (value) {
      final Cursor cursor=(Cursor)mCursorAdapter.getItem(key);
      final UserModel u=UserModel.from(cursor);
      mUserNames.add(u.getScreenName());
    }
  }
  if (AppContext.DEBUG) {
    log(StringHelper.toString(mUserNames));
  }
  if (mViewStub != null) {
    initViewStub();
  }
  if (mUserNames.isEmpty()) {
    mButtonGroup.setVisibility(View.GONE);
  }
 else {
    mButtonGroup.setVisibility(View.VISIBLE);
  }
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  SparseBooleanArray sba=mListView.getCheckedItemPositions();
  mUserNames.clear();
  for (int i=0; i < sba.size(); i++) {
    int key=sba.keyAt(i);
    boolean value=sba.valueAt(i);
    mCursorAdapter.setItemChecked(key,value);
    log("String_Node_Str" + key + "String_Node_Str"+ value+ "String_Node_Str"+ position);
    if (value) {
      final Cursor cursor=(Cursor)mCursorAdapter.getItem(key);
      final UserModel u=UserModel.from(cursor);
      mUserNames.add(u.getScreenName());
    }
  }
  if (AppContext.DEBUG) {
    log(StringHelper.toString(mUserNames));
  }
  if (mViewStub != null) {
    initViewStub();
  }
  if (mUserNames.isEmpty()) {
    mButtonGroup.setVisibility(View.GONE);
  }
 else {
    mButtonGroup.setVisibility(View.VISIBLE);
  }
}
Program: 25859
Project: 25859
Buggy source:
@Override public void bindView(View view,Context context,Cursor cursor){
  View row=view;
  final UserCheckBoxViewHolder holder=(UserCheckBoxViewHolder)row.getTag();
  final UserModel u=UserModel.from(cursor);
  String headUrl=u.getProfileImageUrl();
  mImageLoader.displayImage(headUrl,holder.headIcon);
  holder.lockIcon.setVisibility(u.isProtect() ? View.VISIBLE : View.GONE);
  holder.nameText.setText(u.getScreenName());
  holder.idText.setText("String_Node_Str" + u.getId() + "String_Node_Str");
  holder.genderText.setText(u.getGender());
  holder.locationText.setText(u.getLocation());
  Boolean b=mStateMap.get(cursor.getPosition());
  if (b == null || b.equals(Boolean.FALSE)) {
    holder.checkBox.setChecked(false);
  }
 else {
    holder.checkBox.setChecked(true);
  }
}

Fixed version (ground truth):
@Override public void bindView(View view,Context context,Cursor cursor){
  View row=view;
  final UserCheckBoxViewHolder holder=(UserCheckBoxViewHolder)row.getTag();
  final UserModel u=UserModel.from(cursor);
  String headUrl=u.getProfileImageUrl();
  mImageLoader.displayImage(headUrl,holder.headIcon);
  holder.lockIcon.setVisibility(u.isProtect() ? View.VISIBLE : View.GONE);
  holder.nameText.setText(u.getScreenName());
  holder.idText.setText("String_Node_Str" + u.getId() + "String_Node_Str");
  holder.genderText.setText(u.getGender());
  holder.locationText.setText(u.getLocation());
  Boolean b=mStateMap.get(cursor.getPosition());
  holder.checkBox.setChecked(Boolean.TRUE == b);
}
Program: 25860
Project: 25860
Buggy source:
public void setItemChecked(int position,boolean checked){
  mStateMap.put(position,checked);
}

Fixed version (ground truth):
public void setItemChecked(int position,boolean checked){
  mStateMap.put(position,checked);
  notifyDataSetChanged();
}
Program: 25861
Project: 25861
Buggy source:
private void initialize(){
  mStates=new ArrayList<Boolean>();
  mStateMap=new HashMap<Integer,Boolean>();
}

Fixed version (ground truth):
private void initialize(){
  mStates=new ArrayList<Boolean>();
  mStateMap=new SparseBooleanArray();
}
Program: 25862
Project: 25862
Buggy source:
@Override protected void setLayout(){
  setContentView(R.layout.list_pull);
  mPullToRefreshListView=(PullToRefreshListView)findViewById(R.id.pull_list);
  mPullToRefreshListView.setOnRefreshListener(this);
  mList=mPullToRefreshListView.getRefreshableView();
  mList.setOnItemClickListener(this);
  mList.setOnItemLongClickListener(this);
  mStatusAdapter=new SearchResultsAdapter(this,mStatuses);
  mList.setAdapter(mStatusAdapter);
  search();
}

Fixed version (ground truth):
@Override protected void setLayout(){
  setContentView(R.layout.list_pull);
  mPullToRefreshListView=(PullToRefreshListView)findViewById(R.id.pull_list);
  mPullToRefreshListView.setOnRefreshListener(this);
  mList=mPullToRefreshListView.getRefreshableView();
  mList.setOnItemClickListener(this);
  mList.setOnItemLongClickListener(this);
  mStatusAdapter=new SearchResultsAdapter(this,null);
  mList.setAdapter(mStatusAdapter);
  search();
}
Program: 25863
Project: 25863
Buggy source:
@Override protected void onPreExecute(){
  if (maxId == null) {
    mStatuses.clear();
    mStatusAdapter.notifyDataSetChanged();
  }
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  if (maxId == null) {
    mStatusAdapter.clear();
  }
}
Program: 25864
Project: 25864
Buggy source:
protected void search(){
  parseIntent();
  mStatuses.clear();
  doSearch(true);
  mPullToRefreshListView.setRefreshing();
}

Fixed version (ground truth):
protected void search(){
  parseIntent();
  maxId=null;
  mStatusAdapter.clear();
  doSearch(true);
  mPullToRefreshListView.setRefreshing();
}
Program: 25865
Project: 25865
Buggy source:
@Override protected List<StatusModel> doInBackground(Void... params){
  if (StringHelper.isEmpty(keyword)) {
    return null;
  }
  List<StatusModel> result=null;
  Paging p=new Paging();
  p.count=FanFouService.DEFAULT_TIMELINE_COUNT;
  if (App.getApnType() == ApnType.WIFI) {
    p.count=FanFouService.MAX_TIMELINE_COUNT;
  }
  try {
    result=api.search(keyword,p);
  }
 catch (  ApiException e) {
    if (App.DEBUG)     e.printStackTrace();
  }
  return result;
}

Fixed version (ground truth):
@Override protected List<StatusModel> doInBackground(Void... params){
  if (TextUtils.isEmpty(keyword)) {
    return null;
  }
  List<StatusModel> result=null;
  Paging p=new Paging();
  p.maxId=maxId;
  if (App.getApnType() == ApnType.WIFI) {
    p.count=FanFouService.MAX_TIMELINE_COUNT;
  }
 else {
    p.count=FanFouService.DEFAULT_TIMELINE_COUNT;
  }
  try {
    result=api.search(keyword,p);
  }
 catch (  ApiException e) {
    if (App.DEBUG)     e.printStackTrace();
  }
  return result;
}
Program: 25866
Project: 25866
Buggy source:
@Override protected void onPostExecute(List<StatusModel> result){
  mPullToRefreshListView.onRefreshComplete();
  if (result != null && result.size() > 0) {
    int size=result.size();
    log("String_Node_Str" + size);
    maxId=result.get(size - 1).getId();
    log("String_Node_Str" + maxId);
    mStatuses.addAll(result);
    updateUI(size < 20);
  }
  mPullToRefreshListView.onRefreshComplete();
}

Fixed version (ground truth):
@Override protected void onPostExecute(List<StatusModel> result){
  mPullToRefreshListView.onRefreshComplete();
  if (result != null && result.size() > 0) {
    int size=result.size();
    maxId=result.get(size - 1).getId();
    log("String_Node_Str" + size);
    log("String_Node_Str" + maxId + "String_Node_Str"+ result.get(size - 1));
    for (    StatusModel s : result) {
      Log.d(TAG,s.toString());
    }
    onRefreshComplete(result);
  }
}
Program: 25867
Project: 25867
Buggy source:
@Override protected void initialize(){
  mStatuses=new ArrayList<StatusModel>();
  api=App.getApi();
}

Fixed version (ground truth):
@Override protected void initialize(){
  api=App.getApi();
}
Program: 25868
Project: 25868
Buggy source:
public void updateDataAndUI(List<StatusModel> data,String keyword){
  mKeyword=keyword;
  mPattern=Pattern.compile(mKeyword);
  setData(data);
  notifyDataSetChanged();
}

Fixed version (ground truth):
public void updateDataAndUI(List<StatusModel> data,String keyword){
  mKeyword=keyword;
  mPattern=Pattern.compile(mKeyword);
  addData(data);
}
Program: 25869
Project: 25869
Buggy source:
private SpannableStringBuilder buildHighlightSpan(String text){
  SpannableStringBuilder span=new SpannableStringBuilder(text);
  if (!StringHelper.isEmpty(mKeyword)) {
    Matcher m=mPattern.matcher(span);
    while (m.find()) {
      int start=m.start();
      int end=m.end();
      span.setSpan(new ForegroundColorSpan(mContext.getResources().getColor(R.color.profile_relation_blue)),start,end,Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
      span.setSpan(new StyleSpan(Typeface.BOLD),start,end,Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    }
  }
  return span;
}

Fixed version (ground truth):
private SpannableStringBuilder buildHighlightSpan(String text){
  SpannableStringBuilder span=new SpannableStringBuilder(text);
  if (!TextUtils.isEmpty(mKeyword)) {
    Matcher m=mPattern.matcher(span);
    while (m.find()) {
      int start=m.start();
      int end=m.end();
      span.setSpan(new ForegroundColorSpan(mContext.getResources().getColor(R.color.profile_relation_blue)),start,end,Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
      span.setSpan(new StyleSpan(Typeface.BOLD),start,end,Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    }
  }
  return span;
}
Program: 25870
Project: 25870
Buggy source:
private Bitmap loadFromFile(String key){
  String filename=StringHelper.md5(key) + "String_Node_Str";
  File file=new File(mCacheDir,filename);
  FileInputStream fis=null;
  Bitmap bitmap=null;
  try {
    fis=new FileInputStream(file);
    bitmap=BitmapFactory.decodeStream(fis);
    if (App.DEBUG) {
      Log.d(TAG,"String_Node_Str" + key);
    }
  }
 catch (  FileNotFoundException e) {
    if (App.DEBUG) {
      Log.d(TAG,"String_Node_Str" + e.getMessage());
    }
  }
 finally {
    IOHelper.forceClose(fis);
  }
  return bitmap;
}

Fixed version (ground truth):
private Bitmap loadFromFile(String key){
  String filename=StringHelper.md5(key) + "String_Node_Str";
  File file=new File(mCacheDir,filename);
  FileInputStream fis=null;
  Bitmap bitmap=null;
  try {
    fis=new FileInputStream(file);
    bitmap=BitmapFactory.decodeStream(fis);
  }
 catch (  FileNotFoundException e) {
  }
 finally {
    IOHelper.forceClose(fis);
  }
  return bitmap;
}