nus-yam/ex-repair huggingface dataset:
Program: 171950
Project: 171950
Buggy source:
/** 
 * REST API POST /mkfile/<fileSize>/key/<encodedKey>/mimeType/<encodedMimeType>/x:user-var/<encodedUserVars> HTTP/1.1 Host:           <UpHost> Content-Type:   text/plain Content-Length: <ctxListSize> Authorization:  UpToken <UploadToken> <ctxList> Request params: - fileSize - encodeKey - encodedMimeType - encodedUserVars Response: { "hash": "<ContentHash  string>", "key":  "<Key          string>" }
 * @param fileTotalSize
 * @param uploadFileCtxs
 * @param retry
 * @return
 * @throws Exception
 */
public QiniuMKFileResponseData makeFile(int fileTotalSize,List<String> uploadFileCtxs,int retry) throws Exception {
  try {
    String endPoint=String.format(QINIU_MKFILE_EP,fileTotalSize,AVUtils.Base64Encode(this.fileKey));
    final String joinedFileCtx=AVUtils.joinCollection(uploadFileCtxs,"String_Node_Str");
    Request.Builder builder=new Request.Builder();
    builder.url(endPoint);
    builder.addHeader(HEAD_CONTENT_TYPE,TEXT_CONTENT_TYPE);
    builder.addHeader(HEAD_CONTENT_LENGTH,String.valueOf(joinedFileCtx.length()));
    builder.addHeader(HEAD_AUTHORIZATION,"String_Node_Str" + this.uploadToken);
    builder=builder.post(RequestBody.create(MediaType.parse(TEXT_CONTENT_TYPE),joinedFileCtx));
    Response response=this.client.newCall(builder.build()).execute();
    return parseQiniuResponse(response,QiniuMKFileResponseData.class);
  }
 catch (  Exception e) {
    LogUtil.log.e("String_Node_Str" + retry,e);
    if (retry-- > 0) {
      return makeFile(fileTotalSize,uploadFileCtxs,retry);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * REST API POST /mkfile/<fileSize>/key/<encodedKey>/mimeType/<encodedMimeType>/x:user-var/<encodedUserVars> HTTP/1.1 Host:           <UpHost> Content-Type:   text/plain Content-Length: <ctxListSize> Authorization:  UpToken <UploadToken> <ctxList> Request params: - fileSize - encodeKey - encodedMimeType - encodedUserVars Response: { "hash": "<ContentHash  string>", "key":  "<Key          string>" }
 * @param fileTotalSize
 * @param uploadFileCtxs
 * @param retry
 * @return
 * @throws Exception
 */
public QiniuMKFileResponseData makeFile(int fileTotalSize,List<String> uploadFileCtxs,int retry) throws Exception {
  try {
    String endPoint=String.format(QINIU_MKFILE_EP,fileTotalSize,AVUtils.base64Encode(this.fileKey));
    final String joinedFileCtx=AVUtils.joinCollection(uploadFileCtxs,"String_Node_Str");
    Request.Builder builder=new Request.Builder();
    builder.url(endPoint);
    builder.addHeader(HEAD_CONTENT_TYPE,TEXT_CONTENT_TYPE);
    builder.addHeader(HEAD_CONTENT_LENGTH,String.valueOf(joinedFileCtx.length()));
    builder.addHeader(HEAD_AUTHORIZATION,"String_Node_Str" + this.uploadToken);
    builder=builder.post(RequestBody.create(MediaType.parse(TEXT_CONTENT_TYPE),joinedFileCtx));
    Response response=this.client.newCall(builder.build()).execute();
    return parseQiniuResponse(response,QiniuMKFileResponseData.class);
  }
 catch (  Exception e) {
    LogUtil.log.e("String_Node_Str" + retry,e);
    if (retry-- > 0) {
      return makeFile(fileTotalSize,uploadFileCtxs,retry);
    }
  }
  return null;
}
Program: 171951
Project: 171951
Buggy source:
private QiniuMKFileResponseData makeFile(int dataSize,String key,int retry) throws Exception {
  try {
    String endPoint=String.format(QINIU_MKFILE_EP,dataSize,AVUtils.Base64Encode(key));
    List<String> list=new LinkedList<String>();
    Collections.addAll(list,uploadFileCtx);
    final String joinedFileCtx=AVUtils.joinCollection(list,"String_Node_Str");
    Request.Builder builder=new Request.Builder();
    builder.url(endPoint);
    builder=builder.post(RequestBody.create(MediaType.parse("String_Node_Str"),joinedFileCtx));
    builder=addAuthHeader(builder);
    mergeFileRequestCall=getOKHttpClient().newCall(builder.build());
    return parseQiniuResponse(mergeFileRequestCall.execute(),QiniuMKFileResponseData.class);
  }
 catch (  Exception e) {
    if (retry-- > 0) {
      return makeFile(dataSize,key,retry);
    }
 else {
      LogUtil.log.e("String_Node_Str",e);
    }
  }
  return null;
}

Fixed version (ground truth):
private QiniuMKFileResponseData makeFile(int dataSize,String key,int retry) throws Exception {
  try {
    String endPoint=String.format(QINIU_MKFILE_EP,dataSize,AVUtils.base64Encode(key));
    List<String> list=new LinkedList<String>();
    Collections.addAll(list,uploadFileCtx);
    final String joinedFileCtx=AVUtils.joinCollection(list,"String_Node_Str");
    Request.Builder builder=new Request.Builder();
    builder.url(endPoint);
    builder=builder.post(RequestBody.create(MediaType.parse("String_Node_Str"),joinedFileCtx));
    builder=addAuthHeader(builder);
    mergeFileRequestCall=getOKHttpClient().newCall(builder.build());
    return parseQiniuResponse(mergeFileRequestCall.execute(),QiniuMKFileResponseData.class);
  }
 catch (  Exception e) {
    if (retry-- > 0) {
      return makeFile(dataSize,key,retry);
    }
 else {
      LogUtil.log.e("String_Node_Str",e);
    }
  }
  return null;
}
Program: 171952
Project: 171952
Buggy source:
private void queryMessagesFromCache(String msgId,long timestamp,int limit,final AVIMMessagesQueryCallback callback){
  if (null != callback) {
    storage.getMessages(msgId,timestamp,limit,conversationId,new AVIMMessageStorage.StorageQueryCallback(){
      @Override public void done(      List<AVIMMessage> messages,      List<Boolean> breakpoints){
        Collections.reverse(messages);
        callback.internalDone(messages,null);
      }
    }
);
  }
}

Fixed version (ground truth):
private void queryMessagesFromCache(final String msgId,final long timestamp,final int limit,final AVIMMessagesQueryCallback callback){
  if (null != callback) {
    storage.getMessages(msgId,timestamp,limit,conversationId,new AVIMMessageStorage.StorageQueryCallback(){
      @Override public void done(      List<AVIMMessage> messages,      List<Boolean> breakpoints){
        Collections.reverse(messages);
        callback.internalDone(messages,null);
      }
    }
);
  }
}
Program: 171954
Project: 171954
Buggy source:
void dumpMessages(String conversationId){
  long curTs=System.currentTimeMillis();
  SQLiteDatabase db=dbHelper.getReadableDatabase();
  String condition=SQL.TIMESTAMP_LESS_AND_CONVERSATION_ID;
  String[] conditionArgs=new String[]{Long.toString(curTs),conversationId};
  Cursor cursor=db.query(MESSAGE_TABLE,null,condition,conditionArgs,null,null,SQL.ORDER_BY_TIMESTAMP_DESC_THEN_MESSAGE_ID_DESC);
  if (cursor.moveToFirst()) {
    while (!cursor.isAfterLast()) {
      AVIMMessage message=createMessageFromCursor(cursor);
      boolean breakpoint=cursor.getInt(cursor.getColumnIndex(COLUMN_BREAKPOINT)) != 0;
      System.out.println("String_Node_Str" + message.toString() + "String_Node_Str"+ breakpoint);
      cursor.moveToNext();
    }
  }
}

Fixed version (ground truth):
void dumpMessages(String conversationId){
  long curTs=System.currentTimeMillis();
  SQLiteDatabase db=dbHelper.getReadableDatabase();
  String condition=SQL.TIMESTAMP_LESS_AND_CONVERSATION_ID;
  String[] conditionArgs=new String[]{Long.toString(curTs),conversationId};
  Cursor cursor=db.query(MESSAGE_TABLE,null,condition,conditionArgs,null,null,SQL.ORDER_BY_TIMESTAMP_DESC_THEN_MESSAGE_ID_DESC);
  if (cursor.moveToFirst()) {
    while (!cursor.isAfterLast()) {
      AVIMMessage message=createMessageFromCursor(cursor);
      boolean breakpoint=cursor.getInt(cursor.getColumnIndex(COLUMN_BREAKPOINT)) != 0;
      System.out.println("String_Node_Str" + message.getMessageId() + "String_Node_Str"+ message.getTimestamp()+ "String_Node_Str"+ breakpoint+ "String_Node_Str");
      cursor.moveToNext();
    }
  }
}
Program: 171955
Project: 171955
Buggy source:
/** 
 * 顺序由调用者保证，需要按照时间升序排列
 * @param messages
 * @param conversationId
 */
public void insertContinuousMessages(List<AVIMMessage> messages,String conversationId){
  if (messages.isEmpty())   return;
  AVIMMessage firstMessage=messages.get(0);
  List<AVIMMessage> tailMessages=messages.subList(1,messages.size());
  AVIMMessage lastMessage=messages.get(messages.size() - 1);
  if (!containMessage(lastMessage)) {
    AVIMMessage eldestMessage=getNextMessage(lastMessage);
    if (eldestMessage != null) {
      updateBreakpoints(Arrays.asList(eldestMessage),true,conversationId);
    }
  }
  if (!tailMessages.isEmpty()) {
    insertMessages(tailMessages,false);
    updateBreakpoints(tailMessages,false,conversationId);
  }
  insertMessage(firstMessage,true);
}

Fixed version (ground truth):
/** 
 * 顺序由调用者保证，需要按照时间升序排列
 * @param messages
 * @param conversationId
 */
public void insertContinuousMessages(List<AVIMMessage> messages,String conversationId){
  if (null == messages || messages.isEmpty() || AVUtils.isBlankString(conversationId)) {
    return;
  }
  AVIMMessage firstMessage=messages.get(0);
  List<AVIMMessage> tailMessages=messages.subList(1,messages.size());
  AVIMMessage lastMessage=messages.get(messages.size() - 1);
  if (!containMessage(lastMessage)) {
    AVIMMessage eldestMessage=getNextMessage(lastMessage);
    if (eldestMessage != null) {
      updateBreakpoints(Arrays.asList(eldestMessage),true,conversationId);
    }
  }
  if (!tailMessages.isEmpty()) {
    insertMessages(tailMessages,false);
    updateBreakpoints(tailMessages,false,conversationId);
  }
  insertMessage(firstMessage,true);
}
Program: 171956
Project: 171956
Buggy source:
public void insertMessage(AVIMMessage message,boolean breakpoint){
  insertMessages(Arrays.asList(message),breakpoint);
}

Fixed version (ground truth):
public void insertMessage(AVIMMessage message,boolean breakpoint){
  if (null == message) {
    return;
  }
  insertMessages(Arrays.asList(message),breakpoint);
}
Program: 171958
Project: 171958
Buggy source:
public AVException doWork(){
  String fileKey=AVUtils.parseFileKey(avFile.getName());
  if (AVUtils.isBlankString(uploadUrl)) {
    final AVException getBucketException=fetchUploadBucket("String_Node_Str",fileKey,true,new AVCallback<String>(){
      @Override protected void internalDone0(      String s,      AVException avException){
        if (null == avException) {
          AVException ex=handleGetBucketResponse(s);
          if (null != ex) {
            LogUtil.log.e("String_Node_Str",ex);
          }
        }
 else {
          LogUtil.log.e("String_Node_Str",avException);
        }
      }
    }
);
    if (getBucketException != null) {
      return getBucketException;
    }
  }
  publishProgress(PROGRESS_GET_TOKEN);
  Uploader uploader=getUploaderImplementation(fileKey);
  AVException uploadException=uploader.doWork();
  if (uploadException == null) {
    if (null != callback) {
      callback.finishedWithResults(finalObjectId,finalUrl);
    }
    publishProgress(PROGRESS_COMPLETE);
    completeFileUpload(true);
    return null;
  }
 else {
    completeFileUpload(false);
    return uploadException;
  }
}

Fixed version (ground truth):
public AVException doWork(){
  String fileKey=AVUtils.parseFileKey(avFile.getName());
  if (AVUtils.isBlankString(uploadUrl)) {
    final AVException getBucketException=fetchUploadBucket("String_Node_Str",fileKey,true,new AVCallback<String>(){
      @Override protected void internalDone0(      String s,      AVException avException){
        if (null == avException) {
          AVException ex=handleGetBucketResponse(s);
          if (null != ex) {
            LogUtil.log.e("String_Node_Str",ex);
          }
        }
 else {
          LogUtil.log.e("String_Node_Str",avException);
        }
      }
      @Override protected boolean mustRunOnUIThread(){
        return false;
      }
    }
);
    if (getBucketException != null) {
      return getBucketException;
    }
  }
  publishProgress(PROGRESS_GET_TOKEN);
  Uploader uploader=getUploaderImplementation(fileKey);
  AVException uploadException=uploader.doWork();
  if (uploadException == null) {
    if (null != callback) {
      callback.finishedWithResults(finalObjectId,finalUrl);
    }
    publishProgress(PROGRESS_COMPLETE);
    completeFileUpload(true);
    return null;
  }
 else {
    completeFileUpload(false);
    return uploadException;
  }
}
Program: 171959
Project: 171959
Buggy source:
public AVIMMessage(Parcel in){
  this.conversationId=in.readString();
  this.setContent(in.readString());
  this.setFrom(in.readString());
  this.setTimestamp(in.readLong());
  this.setDeliveredAt(in.readLong());
  this.setReadAt(in.readLong());
  this.setUpdateAt(in.readLong());
  this.setMessageId(in.readString());
  this.status=AVIMMessageStatus.getMessageStatus(in.readInt());
  this.ioType=AVIMMessageIOType.getMessageIOType(in.readInt());
  this.uniqueToken=in.readString();
  this.mentionAll=in.readByte() != 0;
  in.readStringList(this.mentionList);
  this.initMessage(in);
}

Fixed version (ground truth):
public AVIMMessage(Parcel in){
  this.conversationId=in.readString();
  this.setContent(in.readString());
  this.setFrom(in.readString());
  this.setTimestamp(in.readLong());
  this.setDeliveredAt(in.readLong());
  this.setReadAt(in.readLong());
  this.setUpdateAt(in.readLong());
  this.setMessageId(in.readString());
  this.status=AVIMMessageStatus.getMessageStatus(in.readInt());
  this.ioType=AVIMMessageIOType.getMessageIOType(in.readInt());
  this.uniqueToken=in.readString();
  this.mentionAll=in.readByte() != 0;
  this.mentionList=new ArrayList<>(0);
  in.readStringList(this.mentionList);
  this.initMessage(in);
}
Program: 171960
Project: 171960
Buggy source:
/** 
 * Gets the data for this object in a background thread.
 * @param dataCallback A GetDataCallback that is called when the get completes.
 */
public void getDataInBackground(GetDataCallback dataCallback){
  getDataInBackground(dataCallback,null);
}

Fixed version (ground truth):
/** 
 * Gets the data for this object in a background thread. Notice: for large file(above 20MB), it is dangerous to read whole data once time, instead of, you should use   {@link #getDataStreamInBackground(GetDataStreamCallback)} to read the content.
 * @param dataCallback A GetDataCallback that is called when the get completes.
 */
public void getDataInBackground(GetDataCallback dataCallback){
  getDataInBackground(dataCallback,null);
}
Program: 171961
Project: 171961
Buggy source:
/** 
 * Synchronously gets the data input stream for this object. You probably want to use  {@link #getDataStreamInBackground(GetDataStreamCallback)} insteadunless you're already in a background thread.
 * @throws AVException
 */
@JSONField(serialize=false) public InputStream getDataStream() throws AVException {
  String filePath="String_Node_Str";
  if (!AVUtils.isBlankString(localPath)) {
    filePath=localPath;
  }
 else   if (!AVUtils.isBlankString(localTmpFilePath)) {
    filePath=localTmpFilePath;
  }
 else   if (!AVUtils.isBlankString(url)) {
    File cacheFile=AVFileDownloader.getCacheFile(url);
    if (null == cacheFile || !cacheFile.exists()) {
      if (!AVUtils.isConnected(AVOSCloud.applicationContext)) {
        throw new AVException(AVException.CONNECTION_FAILED,"String_Node_Str");
      }
 else {
        cancelDownloadIfNeed();
        downloader=new AVFileDownloader();
        AVException exception=downloader.doWork(getUrl());
        if (exception != null) {
          throw exception;
        }
      }
    }
    filePath=cacheFile.getAbsolutePath();
  }
  if (!AVUtils.isBlankString(filePath)) {
    try {
      return AVPersistenceUtils.getInputStreamFromFile(new File(filePath));
    }
 catch (    IOException e) {
      throw new AVException(e);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Synchronously gets the data input stream for this object. You probably want to use  {@link #getDataStreamInBackground(GetDataStreamCallback)} insteadunless you're already in a background thread. Notice: You need to close the input stream after reading content from it.
 * @throws AVException
 */
@JSONField(serialize=false) public InputStream getDataStream() throws AVException {
  String filePath="String_Node_Str";
  if (!AVUtils.isBlankString(localPath)) {
    filePath=localPath;
  }
 else   if (!AVUtils.isBlankString(localTmpFilePath)) {
    filePath=localTmpFilePath;
  }
 else   if (!AVUtils.isBlankString(url)) {
    File cacheFile=AVFileDownloader.getCacheFile(url);
    if (null == cacheFile || !cacheFile.exists()) {
      if (!AVUtils.isConnected(AVOSCloud.applicationContext)) {
        throw new AVException(AVException.CONNECTION_FAILED,"String_Node_Str");
      }
 else {
        cancelDownloadIfNeed();
        downloader=new AVFileDownloader();
        AVException exception=downloader.doWork(getUrl());
        if (exception != null) {
          throw exception;
        }
      }
    }
    filePath=cacheFile.getAbsolutePath();
  }
  if (!AVUtils.isBlankString(filePath)) {
    try {
      return AVPersistenceUtils.getInputStreamFromFile(new File(filePath));
    }
 catch (    IOException e) {
      throw new AVException(e);
    }
  }
  return null;
}
Program: 171962
Project: 171962
Buggy source:
/** 
 * Synchronously gets the data for this object. You probably want to use  {@link #getDataInBackground(GetDataCallback)} insteadunless you're already in a background thread.
 * @throws AVException
 */
@Deprecated @JSONField(serialize=false) public byte[] getData() throws AVException {
  if (!AVUtils.isBlankString(localPath)) {
    return getLocalFileData();
  }
 else   if (!AVUtils.isBlankString(localTmpFilePath)) {
    return getTmpFileData();
  }
 else   if (!AVUtils.isBlankString(url)) {
    byte[] data=getCacheData();
    if (null != data) {
      return data;
    }
    if (!AVUtils.isConnected(AVOSCloud.applicationContext)) {
      throw new AVException(AVException.CONNECTION_FAILED,"String_Node_Str");
    }
 else {
      cancelDownloadIfNeed();
      downloader=new AVFileDownloader();
      AVException exception=downloader.doWork(getUrl());
      if (exception != null) {
        throw exception;
      }
      return getCacheData();
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Synchronously gets the data for this object. You probably want to use  {@link #getDataInBackground(GetDataCallback)} insteadunless you're already in a background thread. Notice: for large file(above 20MB), it is dangerous to read whole data once time, instead of, you should use  {@link #getDataStream()} to read the content.
 * @throws AVException
 */
@Deprecated @JSONField(serialize=false) public byte[] getData() throws AVException {
  if (!AVUtils.isBlankString(localPath)) {
    return getLocalFileData();
  }
 else   if (!AVUtils.isBlankString(localTmpFilePath)) {
    return getTmpFileData();
  }
 else   if (!AVUtils.isBlankString(url)) {
    byte[] data=getCacheData();
    if (null != data) {
      return data;
    }
    if (!AVUtils.isConnected(AVOSCloud.applicationContext)) {
      throw new AVException(AVException.CONNECTION_FAILED,"String_Node_Str");
    }
 else {
      cancelDownloadIfNeed();
      downloader=new AVFileDownloader();
      AVException exception=downloader.doWork(getUrl());
      if (exception != null) {
        throw exception;
      }
      return getCacheData();
    }
  }
  return null;
}
Program: 171963
Project: 171963
Buggy source:
@Test public void testGetDataStreamForExternalFile() throws Exception {
  AVFile file=new AVFile("String_Node_Str","String_Node_Str");
  file.getDataStreamInBackground(new GetDataStreamCallback(){
    @Override public void done(    InputStream data,    AVException e){
      if (null != e || null == data) {
        Assert.fail();
      }
 else {
        byte content[]=new byte[10240];
        try {
          int totalRead=0;
          int curRead=data.read(content);
          while (curRead > 0) {
            totalRead+=curRead;
            curRead=data.read(content);
          }
          data.close();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
          Assert.fail();
        }
      }
    }
  }
);
}

Fixed version (ground truth):
@Test public void testGetDataStreamForExternalFile() throws Exception {
  final String testUrl="String_Node_Str";
  AVFile file=new AVFile("String_Node_Str",testUrl);
  final CountDownLatch latch=new CountDownLatch(1);
  file.getDataStreamInBackground(new GetDataStreamCallback(){
    @Override public void done(    InputStream data,    AVException e){
      if (null != e || null == data) {
        Assert.fail();
      }
 else {
        byte content[]=new byte[10240];
        try {
          int totalRead=0;
          int curRead=data.read(content);
          while (curRead > 0) {
            totalRead+=curRead;
            curRead=data.read(content);
          }
          data.close();
          Assert.assertTrue(totalRead > 0);
          System.out.println("String_Node_Str" + testUrl + "String_Node_Str"+ totalRead);
        }
 catch (        Exception ex) {
          ex.printStackTrace();
          Assert.fail();
        }
      }
      latch.countDown();
    }
  }
);
  latch.await(30,TimeUnit.SECONDS);
}
Program: 171964
Project: 171964
Buggy source:
@Test public void testGetDataStreamForLargeFile() throws Exception {
  AVFile file=new AVFile("String_Node_Str","String_Node_Str");
  file.getDataStreamInBackground(new GetDataStreamCallback(){
    @Override public void done(    InputStream data,    AVException e){
      if (null != e || null == data) {
        Assert.fail();
      }
 else {
        byte content[]=new byte[10240];
        try {
          int totalRead=0;
          int curRead=data.read(content);
          while (curRead > 0) {
            totalRead+=curRead;
            curRead=data.read(content);
          }
          data.close();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
          Assert.fail();
        }
      }
    }
  }
);
}

Fixed version (ground truth):
@Test public void testGetDataStreamForLargeFile() throws Exception {
  final String testUrl="String_Node_Str";
  AVFile file=new AVFile("String_Node_Str",testUrl);
  final CountDownLatch latch=new CountDownLatch(1);
  file.getDataStreamInBackground(new GetDataStreamCallback(){
    @Override public void done(    InputStream data,    AVException e){
      if (null != e || null == data) {
        Assert.fail();
      }
 else {
        byte content[]=new byte[10240];
        try {
          int totalRead=0;
          int curRead=data.read(content);
          while (curRead > 0) {
            totalRead+=curRead;
            curRead=data.read(content);
          }
          data.close();
          Assert.assertTrue(totalRead > 0);
          System.out.println("String_Node_Str" + testUrl + "String_Node_Str"+ totalRead);
        }
 catch (        Exception ex) {
          ex.printStackTrace();
          Assert.fail();
        }
      }
      latch.countDown();
    }
  }
);
  latch.await(30,TimeUnit.SECONDS);
}
Program: 171968
Project: 171968
Buggy source:
@Override public void done(List<AVIMMessage> serverMessages,AVIMException e){
  if (e != null) {
    callback.internalDone(e);
  }
 else {
    if (serverMessages == null) {
      serverMessages=new ArrayList<AVIMMessage>();
    }
    continuousMessages.addAll(serverMessages);
    processContinuousMessages(continuousMessages);
    callback.internalDone(continuousMessages,null);
  }
}

Fixed version (ground truth):
@Override public void done(List<AVIMMessage> serverMessages,AVIMException e){
  if (e != null) {
    if (continuousMessages.size() > 0) {
      callback.internalDone(continuousMessages,null);
    }
 else {
      callback.internalDone(e);
    }
  }
 else {
    if (serverMessages == null) {
      serverMessages=new ArrayList<AVIMMessage>();
    }
    continuousMessages.addAll(serverMessages);
    processContinuousMessages(continuousMessages);
    callback.internalDone(continuousMessages,null);
  }
}
Program: 171971
Project: 171971
Buggy source:
@Before public void setup(){
  AVOSCloud.applicationContext=new Activity();
}

Fixed version (ground truth):
@Before public void setup(){
  AVOSCloud.setDebugLogEnabled(true);
  AVOSCloud.applicationContext=RuntimeEnvironment.application;
}
Program: 171972
Project: 171972
Buggy source:
@Test public void testDummy(){
  long currentThreadId=Thread.currentThread().getId();
  long mainThreadId=Looper.getMainLooper().getThread().getId();
  System.out.println("String_Node_Str" + mainThreadId + "String_Node_Str"+ currentThreadId);
  AVIMMessageStorage.DBHelper helper=new AVIMMessageStorage.DBHelper(AVOSCloud.applicationContext,defaultClient);
  Assert.assertNotNull(helper);
  helper.getReadableDatabase().execSQL("String_Node_Str");
  AVIMMessageStorage storage=AVIMMessageStorage.getInstance(defaultClient);
  Assert.assertNotNull(storage);
}

Fixed version (ground truth):
@Test public void testDummy(){
  long currentThreadId=Thread.currentThread().getId();
  long mainThreadId=Looper.getMainLooper().getThread().getId();
  System.out.println("String_Node_Str" + mainThreadId + "String_Node_Str"+ currentThreadId);
  AVIMMessageStorage storage=AVIMMessageStorage.getInstance(defaultClient);
  Assert.assertNotNull(storage);
}
Program: 171973
Project: 171973
Buggy source:
/** 
 * Creates a new file from java.io.File object.
 * @param name The file's name, ideally with extension.
 * @param file The file object.
 * @return
 * @throws FileNotFoundException
 * @throws IOException
 * @since 2.0.2
 */
public static AVFile withFile(String name,File file) throws FileNotFoundException {
  if (file == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!file.exists() || !file.isFile()) {
    throw new FileNotFoundException();
  }
  AVFile avFile=new AVFile();
  avFile.setLocalPath(file.getAbsolutePath());
  avFile.setName(name);
  avFile.dirty=true;
  avFile.name=name;
  long fileSize=file.length();
  String fileMD5="String_Node_Str";
  try {
    InputStream is=AVPersistenceUtils.getInputStreamFromFile(file);
    MessageDigest md=MessageDigest.getInstance("String_Node_Str");
    if (null != is) {
      byte buf[]=new byte[(int)MAX_FILE_BUF_SIZE];
      int readCnt=is.read(buf);
      while (readCnt > 0) {
        md.update(buf,0,readCnt);
      }
      byte[] md5bytes=md.digest();
      fileMD5=AVUtils.hexEncodeBytes(md5bytes);
      is.close();
    }
  }
 catch (  Exception ex) {
    fileMD5="String_Node_Str";
  }
  avFile.metaData.put("String_Node_Str",fileSize);
  avFile.metaData.put(FILE_SUM_KEY,fileMD5);
  AVUser currentUser=AVUser.getCurrentUser();
  avFile.metaData.put("String_Node_Str",currentUser != null ? currentUser.getObjectId() : "String_Node_Str");
  avFile.metaData.put(FILE_NAME_KEY,name);
  return avFile;
}

Fixed version (ground truth):
/** 
 * Creates a new file from java.io.File object.
 * @param name The file's name, ideally with extension.
 * @param file The file object.
 * @return
 * @throws FileNotFoundException
 * @throws IOException
 * @since 2.0.2
 */
public static AVFile withFile(String name,File file) throws FileNotFoundException {
  if (file == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!file.exists() || !file.isFile()) {
    throw new FileNotFoundException();
  }
  AVFile avFile=new AVFile();
  avFile.setLocalPath(file.getAbsolutePath());
  avFile.setName(name);
  avFile.dirty=true;
  avFile.name=name;
  long fileSize=file.length();
  String fileMD5="String_Node_Str";
  try {
    InputStream is=AVPersistenceUtils.getInputStreamFromFile(file);
    MessageDigest md=MessageDigest.getInstance("String_Node_Str");
    if (null != is) {
      byte buf[]=new byte[(int)MAX_FILE_BUF_SIZE];
      int len;
      while ((len=is.read(buf)) != -1) {
        md.update(buf,0,len);
      }
      byte[] md5bytes=md.digest();
      fileMD5=AVUtils.hexEncodeBytes(md5bytes);
      is.close();
    }
  }
 catch (  Exception ex) {
    fileMD5="String_Node_Str";
  }
  avFile.metaData.put("String_Node_Str",fileSize);
  avFile.metaData.put(FILE_SUM_KEY,fileMD5);
  AVUser currentUser=AVUser.getCurrentUser();
  avFile.metaData.put("String_Node_Str",currentUser != null ? currentUser.getObjectId() : "String_Node_Str");
  avFile.metaData.put(FILE_NAME_KEY,name);
  return avFile;
}
Program: 171976
Project: 171976
Buggy source:
private void setDisableButtons(boolean value){
  downloadButton.setDisable(value);
  verifyButton.setDisable(value);
  destinationButton.setDisable(value);
  modpackURL.setEditable(value);
  fileID.setEditable(value);
  destinationPath.setEditable(value);
}

Fixed version (ground truth):
private void setDisableButtons(boolean value){
  downloadButton.setDisable(value);
  verifyButton.setDisable(value);
  destinationButton.setDisable(value);
  modpackURL.setEditable(!value);
  fileID.setEditable(!value);
  destinationPath.setEditable(!value);
}
Program: 171977
Project: 171977
Buggy source:
@Override public void initialize(URL location,ResourceBundle resources){
  log(CMPDL.title());
  log("String_Node_Str" + System.getProperty("String_Node_Str"));
  destinationPath.setText(System.getProperty("String_Node_Str") + File.separator + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void initialize(URL location,ResourceBundle resources){
  log(CMPDL.title());
  log("String_Node_Str" + System.getProperty("String_Node_Str"));
  destinationPath.setText(System.getProperty("String_Node_Str") + File.separator + "String_Node_Str");
  TranslateTransition transition=new TranslateTransition(Duration.seconds(1),title);
  transition.setFromY(-10);
  transition.setToY(10);
  transition.setCycleCount(Animation.INDEFINITE);
  transition.setAutoReverse(true);
  transition.play();
}
Program: 171979
Project: 171979
Buggy source:
@Override protected BaseRecyclerAdapter<InputWrapper,? extends BaseRecyclerViewHolder> initAdapter(){
  adapter=new BaseRecyclerAdapter<InputWrapper,FragmentTxDetail.DetailOutputHolder>(getActivity()){
    SimpleDateFormat simpleDateFormat=new SimpleDateFormat();
    @Override protected FragmentTxDetail.DetailOutputHolder createHolder(    View itemView,    int type){
      return new FragmentTxDetail.DetailOutputHolder(itemView,type);
    }
    @Override protected int getCardViewResource(    int type){
      return R.layout.detail_output_row;
    }
    @Override protected void bindHolder(    final FragmentTxDetail.DetailOutputHolder holder,    final InputWrapper data,    int position){
      holder.txt_num.setText("String_Node_Str" + position);
      holder.txt_address.setText(data.getLabel());
      holder.txt_value.setText(data.getUnspent().getValue().toFriendlyString());
    }
  }
;
  return adapter;
}

Fixed version (ground truth):
@Override protected BaseRecyclerAdapter<InputWrapper,? extends BaseRecyclerViewHolder> initAdapter(){
  adapter=new BaseRecyclerAdapter<InputWrapper,FragmentTxDetail.DetailOutputHolder>(getActivity()){
    SimpleDateFormat simpleDateFormat=new SimpleDateFormat("String_Node_Str");
    @Override protected FragmentTxDetail.DetailOutputHolder createHolder(    View itemView,    int type){
      return new FragmentTxDetail.DetailOutputHolder(itemView,type);
    }
    @Override protected int getCardViewResource(    int type){
      return R.layout.detail_output_row;
    }
    @Override protected void bindHolder(    final FragmentTxDetail.DetailOutputHolder holder,    final InputWrapper data,    int position){
      holder.txt_num.setText("String_Node_Str" + position);
      holder.txt_address.setText(data.getLabel());
      holder.txt_value.setText(data.getUnspent().getValue().toFriendlyString());
    }
  }
;
  return adapter;
}
Program: 171980
Project: 171980
Buggy source:
public TransactionViewHolderBase(View itemView){
  super(itemView);
  context=itemView.getContext();
  itemView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      final Intent intent=new Intent(context,TransactionDetailActivity.class);
      context.startActivity(intent);
    }
  }
);
  cv=(CardView)itemView.findViewById(R.id.cardView);
  title=(TextView)itemView.findViewById(R.id.title);
  description=(TextView)itemView.findViewById(R.id.description);
  amount=(TextView)itemView.findViewById(R.id.amount);
  amountLocal=(TextView)itemView.findViewById(R.id.txt_local_currency);
  imageView=(ImageView)itemView.findViewById(R.id.imageView);
}

Fixed version (ground truth):
public TransactionViewHolderBase(View itemView){
  super(itemView);
  context=itemView.getContext();
  itemView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      final Intent intent=new Intent(context,TransactionDetailActivity.class);
      context.startActivity(intent);
    }
  }
);
  cv=(CardView)itemView.findViewById(R.id.cardView);
  title=(TextView)itemView.findViewById(R.id.title);
  description=(TextView)itemView.findViewById(R.id.description);
  amount=(TextView)itemView.findViewById(R.id.amount);
  txt_scale=(TextView)itemView.findViewById(R.id.txt_scale);
  amountLocal=(TextView)itemView.findViewById(R.id.txt_local_currency);
  imageView=(ImageView)itemView.findViewById(R.id.imageView);
}
Program: 171981
Project: 171981
Buggy source:
@Override protected void bindHolder(TransactionViewHolderBase holder,TransactionWrapper data,int position){
  holder.amount.setText(data.getAmount().toFriendlyString());
  String localCurrency=null;
  if (pivxRate != null) {
    localCurrency=pivxApplication.getCentralFormats().getNumberFormat().format(new BigDecimal(data.getAmount().getValue() * pivxRate.getValue().doubleValue()).movePointLeft(8)) + "String_Node_Str" + pivxRate.getCoin();
    holder.amountLocal.setText(localCurrency);
    holder.amountLocal.setVisibility(View.VISIBLE);
  }
 else {
    holder.amountLocal.setVisibility(View.INVISIBLE);
  }
  holder.description.setText(data.getTransaction().getMemo());
  if (data.isTxMine()) {
    holder.imageView.setImageResource(R.mipmap.ic_transaction_send);
  }
 else {
    holder.imageView.setImageResource(R.mipmap.ic_transaction_receive);
  }
  if (data.getContact() != null) {
    holder.title.setText(data.getContact().getName());
  }
 else {
    holder.title.setText(data.getAddress().toBase58());
  }
  String memo=data.getTransaction().getMemo();
  holder.description.setText(memo != null ? memo : "String_Node_Str");
}

Fixed version (ground truth):
@Override protected void bindHolder(TransactionViewHolderBase holder,TransactionWrapper data,int position){
  String amount=data.getAmount().toFriendlyString();
  if (amount.length() <= 10) {
    holder.txt_scale.setVisibility(View.GONE);
    holder.amount.setText(amount);
  }
 else {
    holder.txt_scale.setVisibility(View.VISIBLE);
    holder.amount.setText(parseToCoinWith4Decimals(amount).toFriendlyString());
  }
  String localCurrency=null;
  if (pivxRate != null) {
    localCurrency=pivxApplication.getCentralFormats().getNumberFormat().format(new BigDecimal(data.getAmount().getValue() * pivxRate.getValue().doubleValue()).movePointLeft(8)) + "String_Node_Str" + pivxRate.getCoin();
    holder.amountLocal.setText(localCurrency);
    holder.amountLocal.setVisibility(View.VISIBLE);
  }
 else {
    holder.amountLocal.setVisibility(View.INVISIBLE);
  }
  holder.description.setText(data.getTransaction().getMemo());
  if (data.isTxMine()) {
    holder.imageView.setImageResource(R.mipmap.ic_transaction_send);
  }
 else {
    holder.imageView.setImageResource(R.mipmap.ic_transaction_receive);
  }
  if (data.getContact() != null) {
    holder.title.setText(data.getContact().getName());
  }
 else {
    holder.title.setText(data.getAddress().toBase58());
  }
  String memo=data.getTransaction().getMemo();
  holder.description.setText(memo != null ? memo : "String_Node_Str");
}
Program: 171983
Project: 171983
Buggy source:
public void addAllTx(Set<String> txHashes){
  txHashes.addAll(txHashes);
}

Fixed version (ground truth):
public void addAllTx(Set<String> txHashes){
  if (txHashes == null) {
    txHashes=new HashSet<>();
  }
  txHashes.addAll(txHashes);
}
Program: 171984
Project: 171984
Buggy source:
@Override public void onClick(View v){
  actionCompleted=true;
  dismiss();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  actionCompleted=true;
  if (okBtnClickListener != null) {
    okBtnClickListener.onClick(v);
  }
  dismiss();
}
Program: 171985
Project: 171985
Buggy source:
@Nullable @Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  root=inflater.inflate(R.layout.simple_dialog,null);
  TextView txt_title=(TextView)root.findViewById(R.id.txt_title);
  TextView txt_body=(TextView)root.findViewById(R.id.txt_body);
  ImageView imgAlert=(ImageView)root.findViewById(R.id.img_alert);
  TextView btn_ok=(TextView)root.findViewById(R.id.btn_ok);
  initRoot();
  initTitle(txt_title);
  initBody(txt_body);
  initImgAlert(imgAlert);
  initOkBtn(btn_ok);
  btn_ok.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      actionCompleted=true;
      dismiss();
    }
  }
);
  return root;
}

Fixed version (ground truth):
@Nullable @Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  root=inflater.inflate(R.layout.simple_dialog,null);
  TextView txt_title=(TextView)root.findViewById(R.id.txt_title);
  TextView txt_body=(TextView)root.findViewById(R.id.txt_body);
  ImageView imgAlert=(ImageView)root.findViewById(R.id.img_alert);
  TextView btn_ok=(TextView)root.findViewById(R.id.btn_ok);
  initRoot();
  initTitle(txt_title);
  initBody(txt_body);
  initImgAlert(imgAlert);
  initOkBtn(btn_ok);
  btn_ok.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      actionCompleted=true;
      if (okBtnClickListener != null) {
        okBtnClickListener.onClick(v);
      }
      dismiss();
    }
  }
);
  return root;
}
Program: 171986
Project: 171986
Buggy source:
public void setRootBackgroundRes(int rootBackgroundRes){
  this.rootBackgroundRes=rootBackgroundRes;
}

Fixed version (ground truth):
public SimpleTextDialog setRootBackgroundRes(int rootBackgroundRes){
  this.rootBackgroundRes=rootBackgroundRes;
  return this;
}
Program: 171987
Project: 171987
Buggy source:
@Override public void onClick(DialogInterface dialog,int which){
  restore();
  dialog.dismiss();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  restore();
}
Program: 171988
Project: 171988
Buggy source:
private void restore(){
  try {
    String password=edit_password.getText().toString().trim();
    edit_password.setText(null);
    File file=(File)spinnerFiles.getSelectedItem();
    if (WalletUtils.BACKUP_FILE_FILTER.accept(file)) {
      pivxModule.restoreWallet(file);
      showRestoreSucced();
    }
 else     if (KEYS_FILE_FILTER.accept(file)) {
    }
 else     if (Crypto.OPENSSL_FILE_FILTER.accept(file)) {
      try {
        pivxModule.restoreWalletFromEncrypted(file,password);
        showRestoreSucced();
      }
 catch (      CantRestoreEncryptedWallet x) {
        final DialogBuilder warnDialog=DialogBuilder.warn(this,R.string.import_export_keys_dialog_failure_title);
        warnDialog.setMessage(getString(R.string.import_keys_dialog_failure,x.getMessage()));
        warnDialog.setPositiveButton(R.string.button_dismiss,null);
        warnDialog.setNegativeButton(R.string.button_retry,new DialogInterface.OnClickListener(){
          @Override public void onClick(          DialogInterface dialog,          int which){
            restore();
            dialog.dismiss();
          }
        }
);
        warnDialog.show();
      }
catch (      Exception e) {
        e.printStackTrace();
        Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void restore(){
  try {
    String password=edit_password.getText().toString().trim();
    edit_password.setText(null);
    File file=(File)spinnerFiles.getSelectedItem();
    if (WalletUtils.BACKUP_FILE_FILTER.accept(file)) {
      pivxModule.restoreWallet(file);
      showRestoreSucced();
    }
 else     if (KEYS_FILE_FILTER.accept(file)) {
    }
 else     if (Crypto.OPENSSL_FILE_FILTER.accept(file)) {
      try {
        pivxModule.restoreWalletFromEncrypted(file,password);
        showRestoreSucced();
      }
 catch (      CantRestoreEncryptedWallet x) {
        DialogsUtil.buildSimpleErrorTextDialog(this,getString(R.string.import_export_keys_dialog_failure_title),getString(R.string.import_keys_dialog_failure,x.getMessage())).setOkBtnClickListener(new View.OnClickListener(){
          @Override public void onClick(          View v){
            restore();
          }
        }
).show(getFragmentManager(),getString(R.string.restore_dialog_error));
      }
catch (      Exception e) {
        e.printStackTrace();
        Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 171989
Project: 171989
Buggy source:
public void setHeaderView(IHeaderWrapper header,int height){
  this.mHeaderView=header;
  this.childHeaderHeight=height;
  addView((View)mHeaderView);
}

Fixed version (ground truth):
public void setHeaderView(IHeaderWrapper header,int height){
  if (header == null)   return;
  this.mHeaderWrapper=header;
  this.mHeaderView=header.getHeaderView();
  this.childHeaderHeight=height;
  addView(mHeaderWrapper.getHeaderView());
}
Program: 171991
Project: 171991
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  boolean intercept=false;
  float y=ev.getY();
  direction=ev.getAction() == MotionEvent.ACTION_UP || y == mLastY ? SCROLL_NONE : y > mLastY ? SCROLL_UP : SCROLL_DOWN;
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
    intercept=false;
  break;
case MotionEvent.ACTION_MOVE:
if (mTarget != null && !ViewCompat.isNestedScrollingEnabled(mTarget)) {
  if (y > mLastY) {
    intercept=!canChildScrollUp();
  }
 else   if (y < mLastY) {
    intercept=!canChildScrollDown();
  }
}
break;
case MotionEvent.ACTION_UP:
intercept=false;
direction=SCROLL_NONE;
break;
}
mLastY=y;
return intercept;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  boolean intercept=false;
  float y=ev.getY();
  float x=ev.getX();
  direction=ev.getAction() == MotionEvent.ACTION_UP || y == mLastY ? SCROLL_NONE : y > mLastY ? SCROLL_UP : SCROLL_DOWN;
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
    intercept=false;
  break;
case MotionEvent.ACTION_MOVE:
if (mTarget != null && !ViewCompat.isNestedScrollingEnabled(mTarget)) {
  if (y > mLastY) {
    intercept=!canChildScrollUp();
  }
 else   if (y < mLastY) {
    intercept=!canChildScrollDown();
  }
}
break;
case MotionEvent.ACTION_UP:
intercept=false;
direction=SCROLL_NONE;
break;
}
boolean vertical=Math.abs(y - mLastY) - Math.abs(x - mLastX) > 0;
mLastY=y;
mLastX=x;
return intercept && vertical;
}
Program: 171992
Project: 171992
Buggy source:
public void showNoMore(boolean noMore){
  this.showBottom=noMore;
  if (showBottom && ((currentState != State.PULL_DOWN_FINISH && currentState != State.PULL_UP_FINISH) || getScrollY() != 0)) {
    mHandler.sendEmptyMessageDelayed(MSG_NO_MORE,5);
    return;
  }
  if (mBottomView != null)   ((View)mBottomView).setVisibility(showBottom ? VISIBLE : GONE);
  if (mFooterView != null)   ((View)mFooterView).setVisibility(showBottom ? GONE : VISIBLE);
}

Fixed version (ground truth):
public void showNoMore(boolean noMore){
  this.showBottom=noMore;
  if (showBottom && ((currentState != State.PULL_DOWN_FINISH && currentState != State.PULL_UP_FINISH) || getScrollY() != 0)) {
    mHandler.sendEmptyMessageDelayed(MSG_NO_MORE,5);
    return;
  }
  if (mBottomView != null)   mBottomView.setVisibility(showBottom ? VISIBLE : GONE);
  if (mFooterView != null)   mFooterView.setVisibility(showBottom ? GONE : VISIBLE);
}
Program: 171993
Project: 171993
Buggy source:
public void setBottomView(IBottomWrapper bottom,int height){
  this.mBottomView=bottom;
  this.childBottomHeight=height;
  addView((View)mBottomView);
}

Fixed version (ground truth):
public void setBottomView(IBottomWrapper bottom,int height){
  if (bottom == null)   return;
  this.mBottomWrapper=bottom;
  this.mBottomView=bottom.getBottomView();
  this.childBottomHeight=height;
  addView(mBottomView);
}
Program: 171994
Project: 171994
Buggy source:
public void setFooterView(IFooterWrapper footer,int height){
  this.mFooterView=footer;
  this.childFooterHeight=height;
  addView((View)mFooterView);
}

Fixed version (ground truth):
public void setFooterView(IFooterWrapper footer,int height){
  if (footer == null)   return;
  this.mFooterWrapper=footer;
  this.mFooterView=footer.getFooterView();
  this.childFooterHeight=height;
  addView(mFooterView);
}
Program: 171995
Project: 171995
Buggy source:
private void updateStatus(int state){
switch (state) {
case State.PULL_NORMAL:
    pullDownReset();
  break;
case State.PULL_DOWN:
if (mHeaderView != null) {
  mHeaderView.pullDown();
}
break;
case State.PULL_DOWN_RELEASABLE:
if (mHeaderView != null) {
mHeaderView.pullDownReleasable();
}
break;
case State.PULL_DOWN_RELEASE:
if (mHeaderView != null) {
mHeaderView.pullDownRelease();
}
if (mRefreshListener != null) {
mRefreshListener.onRefresh();
}
showNoMore(false);
setEnable(false);
break;
case State.PULL_DOWN_RESET:
pullDownReset();
break;
case State.PULL_UP_RESET:
pullUpReset();
break;
case State.PULL_UP:
if (mFooterView != null) {
mFooterView.pullUp();
}
break;
case State.PULL_UP_RELEASABLE:
if (mFooterView != null) {
mFooterView.pullUpReleasable();
}
break;
case State.PULL_UP_RELEASE:
if (mFooterView != null) {
mFooterView.pullUpRelease();
}
if (mRefreshListener != null) {
mRefreshListener.onLoadMore();
}
setEnable(false);
break;
case State.PULL_UP_FINISH:
if (mFooterView != null) {
mFooterView.pullUpFinish();
}
break;
case State.BOTTOM:
if (mBottomView != null) {
mBottomView.showBottom();
}
break;
}
currentState=state;
}

Fixed version (ground truth):
private void updateStatus(int state){
switch (state) {
case State.PULL_NORMAL:
    pullDownReset();
  break;
case State.PULL_DOWN:
if (mHeaderWrapper != null) {
  mHeaderWrapper.pullDown();
}
break;
case State.PULL_DOWN_RELEASABLE:
if (mHeaderWrapper != null) {
mHeaderWrapper.pullDownReleasable();
}
break;
case State.PULL_DOWN_RELEASE:
if (mHeaderWrapper != null) {
mHeaderWrapper.pullDownRelease();
}
if (mRefreshListener != null) {
mRefreshListener.onRefresh();
}
showNoMore(false);
setEnable(false);
break;
case State.PULL_DOWN_RESET:
pullDownReset();
break;
case State.PULL_UP_RESET:
pullUpReset();
break;
case State.PULL_UP:
if (mFooterWrapper != null) {
mFooterWrapper.pullUp();
}
break;
case State.PULL_UP_RELEASABLE:
if (mFooterWrapper != null) {
mFooterWrapper.pullUpReleasable();
}
break;
case State.PULL_UP_RELEASE:
if (mFooterWrapper != null) {
mFooterWrapper.pullUpRelease();
}
if (mRefreshListener != null) {
mRefreshListener.onLoadMore();
}
setEnable(false);
break;
case State.PULL_UP_FINISH:
if (mFooterWrapper != null) {
mFooterWrapper.pullUpFinish();
}
break;
case State.BOTTOM:
if (mBottomWrapper != null) {
mBottomWrapper.showBottom();
}
break;
}
currentState=state;
}
Program: 171996
Project: 171996
Buggy source:
public void down(GossipMember member){
  rwlock.writeLock().lock();
  try {
    member.setState(GossipState.DOWN);
    liveMembers.remove(member);
    if (!deadMembers.contains(member)) {
      deadMembers.add(member);
    }
    fireGossipEvent(member,GossipState.DOWN);
  }
  finally {
    rwlock.writeLock().unlock();
  }
}

Fixed version (ground truth):
public void down(GossipMember member){
  LOGGER.info("String_Node_Str");
  rwlock.writeLock().lock();
  try {
    member.setState(GossipState.DOWN);
    liveMembers.remove(member);
    if (!deadMembers.contains(member)) {
      deadMembers.add(member);
    }
    fireGossipEvent(member,GossipState.DOWN);
  }
  finally {
    rwlock.writeLock().unlock();
  }
}