nus-yam/ex-repair huggingface dataset:
Program: 31944
Project: 31944
Buggy source:
/** 
 * Build a filename from an url
 * @param Url      the media url
 * @param mimeType the mime type;
 * @return the cache filename
 */
static String buildFileName(String Url,String mimeType){
  String name="String_Node_Str" + MXMediaDownloadWorkerTask.uniqueId(Url);
  if (!TextUtils.isEmpty(mimeType)) {
    String fileExtension=MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType);
    if ("String_Node_Str".equals(fileExtension)) {
      fileExtension="String_Node_Str";
    }
    if (null != fileExtension) {
      name+="String_Node_Str" + fileExtension;
    }
  }
  return name;
}

Fixed version (ground truth):
/** 
 * Build a filename from a download Id
 * @param downloadId the media url
 * @param mimeType   the mime type;
 * @return the cache filename
 */
static String buildFileName(String downloadId,String mimeType){
  String name="String_Node_Str" + MXMediaDownloadWorkerTask.uniqueId(downloadId);
  if (!TextUtils.isEmpty(mimeType)) {
    String fileExtension=MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType);
    if ("String_Node_Str".equals(fileExtension)) {
      fileExtension="String_Node_Str";
    }
    if (null != fileExtension) {
      name+="String_Node_Str" + fileExtension;
    }
  }
  return name;
}
Program: 31945
Project: 31945
Buggy source:
/** 
 * Dispatch stats update to the callbacks.
 * @param stats the new stats value
 */
private void dispatchOnDownloadProgress(IMXMediaDownloadListener.DownloadStats stats){
  for (  IMXMediaDownloadListener callback : mDownloadListeners) {
    try {
      callback.onDownloadProgress(mUrl,stats);
    }
 catch (    Exception e) {
      Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
    }
  }
}

Fixed version (ground truth):
/** 
 * Dispatch stats update to the callbacks.
 * @param stats the new stats value
 */
private void dispatchOnDownloadProgress(IMXMediaDownloadListener.DownloadStats stats){
  for (  IMXMediaDownloadListener callback : mDownloadListeners) {
    try {
      callback.onDownloadProgress(mDownloadId,stats);
    }
 catch (    Exception e) {
      Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
    }
  }
}
Program: 31948
Project: 31948
Buggy source:
/** 
 * Set the bitmap in a referenced imageview
 * @param bitmap the bitmap
 */
private void setBitmap(Bitmap bitmap){
  if (bitmap != null) {
    for (    WeakReference<ImageView> weakRef : mImageViewReferences) {
      final ImageView imageView=weakRef.get();
      if (imageView != null && TextUtils.equals(mUrl,(String)imageView.getTag())) {
        imageView.setImageBitmap(bitmap);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Set the bitmap in a referenced imageview
 * @param bitmap the bitmap
 */
private void setBitmap(Bitmap bitmap){
  if (bitmap != null) {
    for (    WeakReference<ImageView> weakRef : mImageViewReferences) {
      final ImageView imageView=weakRef.get();
      if (imageView != null && TextUtils.equals(mDownloadId,(String)imageView.getTag())) {
        imageView.setImageBitmap(bitmap);
      }
    }
  }
}
Program: 31950
Project: 31950
Buggy source:
@Override public void onSuccess(Bitmap bitmap){
  if (null != imageView) {
    if (TextUtils.equals(fDownloadableUrl,(String)imageView.getTag())) {
      imageView.setImageBitmap((null != bitmap) ? bitmap : defaultBitmap);
    }
  }
}

Fixed version (ground truth):
@Override public void onSuccess(Bitmap bitmap){
  if (null != imageView) {
    if (TextUtils.equals(fDownloadId,(String)imageView.getTag())) {
      imageView.setImageBitmap((null != bitmap) ? bitmap : defaultBitmap);
    }
  }
}
Program: 31953
Project: 31953
Buggy source:
/** 
 * Convert matrix url into http one.
 * @param url    the matrix url
 * @param width  the expected image width
 * @param height the expected image height
 * @return the URL to access the described resource.
 */
private String downloadableUrl(String url,int width,int height){
  if ((null != url) && url.startsWith(ContentManager.MATRIX_CONTENT_URI_SCHEME)) {
    if ((width > 0) && (height > 0)) {
      return mContentManager.getDownloadableThumbnailUrl(url,width,height,ContentManager.METHOD_SCALE);
    }
 else {
      return mContentManager.getDownloadableUrl(url);
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Resolve a Matrix media content URI (in the form of "mxc://...") into an HTTP URL.
 * @param url    the matrix url, must not be null.
 * @param width  the expected image width
 * @param height the expected image height
 * @return the URL to access the described resource, or null if the url is invalid.
 */
@Nullable private String downloadableUrl(String url,int width,int height){
  if ((width > 0) && (height > 0)) {
    return mContentManager.getDownloadableThumbnailUrl(url,width,height,ContentManager.METHOD_SCALE);
  }
 else {
    return mContentManager.getDownloadableUrl(url);
  }
}
Program: 31954
Project: 31954
Buggy source:
/** 
 * Return the cache file name for a media defined by its URL and its mimetype.
 * @param url      the media URL
 * @param width    the media width
 * @param height   the media height
 * @param mimeType the media mime type
 * @return the media file it is found
 */
private File mediaCacheFile(String url,int width,int height,String mimeType){
  if (null == url) {
    return null;
  }
  String filename;
  if (url.startsWith("String_Node_Str")) {
    filename=url;
  }
 else {
    String downloadableUrl=downloadableUrl(url,width,height);
    if (null != downloadableUrl) {
      filename=MXMediaDownloadWorkerTask.buildFileName(downloadableUrl,mimeType);
    }
 else {
      return null;
    }
  }
  try {
    if (filename.startsWith("String_Node_Str")) {
      Uri uri=Uri.parse(filename);
      filename=uri.getLastPathSegment();
    }
    File file=new File(getFolderFile(mimeType),filename);
    if (file.exists()) {
      return file;
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return the cache file name for a media defined by its URL and its mimetype.
 * @param url      the media URL
 * @param width    the media width
 * @param height   the media height
 * @param mimeType the media mime type
 * @return the media file it is found
 */
@Nullable private File mediaCacheFile(String url,int width,int height,String mimeType){
  if (null == url) {
    return null;
  }
  String filename;
  if (url.startsWith("String_Node_Str")) {
    filename=url;
  }
 else {
    String downloadableUrl=downloadableUrl(url,width,height);
    if (null != downloadableUrl) {
      filename=MXMediaDownloadWorkerTask.buildFileName(downloadableUrl,mimeType);
    }
 else {
      return null;
    }
  }
  try {
    if (filename.startsWith("String_Node_Str")) {
      Uri uri=Uri.parse(filename);
      filename=uri.getLastPathSegment();
    }
    File file=new File(getFolderFile(mimeType),filename);
    if (file.exists()) {
      return file;
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
  return null;
}
Program: 31955
Project: 31955
Buggy source:
/** 
 * Copy or Replace a media cache by a file content. MediaUrl is the same model as the one used in loadBitmap.
 * @param mediaUrl   the mediaUrl
 * @param fileUrl    the file which replaces the cached media.
 * @param width      the expected image width
 * @param height     the expected image height
 * @param mimeType   the mimeType.
 * @param keepSource keep the source file
 */
public void saveFileMediaForUrl(String mediaUrl,String fileUrl,int width,int height,String mimeType,boolean keepSource){
  String downloadableUrl=downloadableUrl(mediaUrl,width,height);
  String filename=MXMediaDownloadWorkerTask.buildFileName(downloadableUrl,mimeType);
  try {
    File destFile=new File(getFolderFile(mimeType),filename);
    if (destFile.exists()) {
      try {
        destFile.delete();
      }
 catch (      Exception e) {
        Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
      }
    }
    Uri uri=Uri.parse(fileUrl);
    File srcFile=new File(uri.getPath());
    if (keepSource) {
      InputStream in=new FileInputStream(srcFile);
      OutputStream out=new FileOutputStream(destFile);
      byte[] buf=new byte[1024];
      int len;
      while ((len=in.read(buf)) > 0) {
        out.write(buf,0,len);
      }
      in.close();
      out.close();
    }
 else {
      srcFile.renameTo(destFile);
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Copy or Replace a media cache by a file content. MediaUrl is the same model as the one used in loadBitmap.
 * @param mediaUrl   the mediaUrl
 * @param fileUrl    the file which replaces the cached media.
 * @param width      the expected image width
 * @param height     the expected image height
 * @param mimeType   the mimeType.
 * @param keepSource keep the source file
 */
public void saveFileMediaForUrl(String mediaUrl,String fileUrl,int width,int height,String mimeType,boolean keepSource){
  String downloadableUrl=downloadableUrl(mediaUrl,width,height);
  if (null != downloadableUrl) {
    String filename=MXMediaDownloadWorkerTask.buildFileName(downloadableUrl,mimeType);
    try {
      File destFile=new File(getFolderFile(mimeType),filename);
      if (destFile.exists()) {
        try {
          destFile.delete();
        }
 catch (        Exception e) {
          Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
        }
      }
      Uri uri=Uri.parse(fileUrl);
      File srcFile=new File(uri.getPath());
      if (keepSource) {
        InputStream in=new FileInputStream(srcFile);
        OutputStream out=new FileOutputStream(destFile);
        byte[] buf=new byte[1024];
        int len;
        while ((len=in.read(buf)) > 0) {
          out.write(buf,0,len);
        }
        in.close();
        out.close();
      }
 else {
        srcFile.renameTo(destFile);
      }
    }
 catch (    Exception e) {
      Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
    }
  }
}
Program: 31956
Project: 31956
Buggy source:
/** 
 * Tells if the avatar is cached
 * @param url  the avatar url to test
 * @param side the thumbnail side
 * @return true if the avatar bitmap is cached.
 */
public boolean isAvatarThumbnailCached(String url,int side){
  boolean isCached=false;
  if (null != url) {
    String thumbnailUrl=downloadableUrl(url,side,side);
    isCached=MXMediaDownloadWorkerTask.isUrlCached(thumbnailUrl);
    if (!isCached) {
      try {
        isCached=(new File(getThumbnailsFolderFile(),MXMediaDownloadWorkerTask.buildFileName(thumbnailUrl,"String_Node_Str"))).exists();
      }
 catch (      Throwable t) {
        Log.e(LOG_TAG,"String_Node_Str" + t.getMessage());
      }
    }
  }
  return isCached;
}

Fixed version (ground truth):
/** 
 * Tells if the avatar is cached
 * @param url  the avatar url to test
 * @param side the thumbnail side
 * @return true if the avatar bitmap is cached.
 */
public boolean isAvatarThumbnailCached(String url,int side){
  boolean isCached=false;
  String thumbnailUrl=downloadableUrl(url,side,side);
  if (null != thumbnailUrl) {
    isCached=MXMediaDownloadWorkerTask.isUrlCached(thumbnailUrl);
    if (!isCached) {
      try {
        isCached=(new File(getThumbnailsFolderFile(),MXMediaDownloadWorkerTask.buildFileName(thumbnailUrl,"String_Node_Str"))).exists();
      }
 catch (      Throwable t) {
        Log.e(LOG_TAG,"String_Node_Str" + t.getMessage());
      }
    }
  }
  return isCached;
}
Program: 31958
Project: 31958
Buggy source:
/** 
 * Returns the download ID from the media URL.
 * @param url the media url
 * @return the download ID if there is a pending download or null
 */
public String downloadIdFromUrl(String url){
  String downloadId=downloadableUrl(url,-1,-1);
  if (null != MXMediaDownloadWorkerTask.getMediaDownloadWorkerTask(downloadId)) {
    return downloadId;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the download ID from the media URL.
 * @param url the media url
 * @return the download ID if there is a pending download or null
 */
@Nullable public String downloadIdFromUrl(String url){
  String downloadId=downloadableUrl(url,-1,-1);
  if (null != downloadId && null != MXMediaDownloadWorkerTask.getMediaDownloadWorkerTask(downloadId)) {
    return downloadId;
  }
  return null;
}
Program: 31960
Project: 31960
Buggy source:
/** 
 * Provide the thumbnail file.
 * @param url  the thumbnail url/
 * @param size the thumbnail size.
 * @return the File if it exits.
 */
public File thumbnailCacheFile(String url,int size){
  if (null == url) {
    return null;
  }
  String filename=MXMediaDownloadWorkerTask.buildFileName(downloadableUrl(url,size,size),"String_Node_Str");
  try {
    File file=new File(getThumbnailsFolderFile(),filename);
    if (file.exists()) {
      return file;
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Provide the thumbnail file.
 * @param url  the thumbnail url/
 * @param size the thumbnail size.
 * @return the File if it exits.
 */
@Nullable public File thumbnailCacheFile(String url,int size){
  String downloadableUrl=downloadableUrl(url,size,size);
  if (null != downloadableUrl) {
    String filename=MXMediaDownloadWorkerTask.buildFileName(downloadableUrl,"String_Node_Str");
    try {
      File file=new File(getThumbnailsFolderFile(),filename);
      if (file.exists()) {
        return file;
      }
    }
 catch (    Exception e) {
      Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
    }
  }
  return null;
}
Program: 31961
Project: 31961
Buggy source:
/** 
 * Compute the identificon URL for an userId.
 * @param userId the user id.
 * @return the url
 */
public static String getIdenticonURL(String userId){
  if (null != userId) {
    String urlEncodedUser=null;
    try {
      urlEncodedUser=java.net.URLEncoder.encode(userId,"String_Node_Str");
    }
 catch (    Exception e) {
      Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
    }
    return ContentManager.MATRIX_CONTENT_URI_SCHEME + "String_Node_Str" + urlEncodedUser;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Compute the identicon URL for an userId.
 * @param userId the user id.
 * @return the url
 */
public static String getIdenticonURL(String userId){
  if (null != userId) {
    String urlEncodedUser=null;
    try {
      urlEncodedUser=java.net.URLEncoder.encode(userId,"String_Node_Str");
    }
 catch (    Exception e) {
      Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
    }
    return ContentManager.MATRIX_CONTENT_URI_SCHEME + "String_Node_Str" + urlEncodedUser;
  }
  return null;
}
Program: 31962
Project: 31962
Buggy source:
/** 
 * Get an actual URL for accessing the thumbnail image of the given content URI.
 * @param contentUrl the mxc:// content URI
 * @param width      the desired width
 * @param height     the desired height
 * @param method     the desired scale method (METHOD_CROP or METHOD_SCALE)
 * @return the URL to access the described resource
 */
public String getDownloadableThumbnailUrl(String contentUrl,int width,int height,String method){
  if (contentUrl == null)   return null;
  if (contentUrl.startsWith(MATRIX_CONTENT_URI_SCHEME)) {
    String mediaServerAndId=contentUrl.substring(MATRIX_CONTENT_URI_SCHEME.length());
    if (mediaServerAndId.endsWith("String_Node_Str")) {
      mediaServerAndId=mediaServerAndId.substring(0,mediaServerAndId.length() - "String_Node_Str".length());
    }
    String url=mHsConfig.getHomeserverUri().toString() + URI_PREFIX_CONTENT_API;
    if (mediaServerAndId.indexOf("String_Node_Str") < 0) {
      url+="String_Node_Str";
    }
    url+=mediaServerAndId;
    url+="String_Node_Str" + width;
    url+="String_Node_Str" + height;
    url+="String_Node_Str" + method;
    return url;
  }
 else {
    return contentUrl;
  }
}

Fixed version (ground truth):
/** 
 * Get the actual URL for accessing the thumbnail image of a given Matrix media content URI.
 * @param contentUrl the Matrix media content URI (in the form of "mxc://...").
 * @param width      the desired width
 * @param height     the desired height
 * @param method     the desired scale method (METHOD_CROP or METHOD_SCALE)
 * @return the URL to access the described resource, or null if the url is invalid.
 */
@Nullable public String getDownloadableThumbnailUrl(String contentUrl,int width,int height,String method){
  if (isValidMatrixContentUrl(contentUrl)) {
    String mediaServerAndId=contentUrl.substring(MATRIX_CONTENT_URI_SCHEME.length());
    if (mediaServerAndId.endsWith("String_Node_Str")) {
      mediaServerAndId=mediaServerAndId.substring(0,mediaServerAndId.length() - "String_Node_Str".length());
    }
    String url=mHsConfig.getHomeserverUri().toString() + URI_PREFIX_CONTENT_API;
    if (mediaServerAndId.indexOf("String_Node_Str") < 0) {
      url+="String_Node_Str";
    }
    url+=mediaServerAndId;
    url+="String_Node_Str" + width;
    url+="String_Node_Str" + height;
    url+="String_Node_Str" + method;
    return url;
  }
 else {
    return null;
  }
}
Program: 31963
Project: 31963
Buggy source:
/** 
 * Get an actual URL for accessing the full-size image of the given content URI.
 * @param contentUrl the mxc:// content URI
 * @return the URL to access the described resource
 */
public String getDownloadableUrl(String contentUrl){
  if (contentUrl == null)   return null;
  if (contentUrl.startsWith(MATRIX_CONTENT_URI_SCHEME)) {
    String mediaServerAndId=contentUrl.substring(MATRIX_CONTENT_URI_SCHEME.length());
    return mHsConfig.getHomeserverUri().toString() + URI_PREFIX_CONTENT_API + "String_Node_Str"+ mediaServerAndId;
  }
 else {
    return contentUrl;
  }
}

Fixed version (ground truth):
/** 
 * Get the actual URL for accessing the full-size image of a Matrix media content URI.
 * @param contentUrl the Matrix media content URI (in the form of "mxc://...").
 * @return the URL to access the described resource, or null if the url is invalid.
 */
@Nullable public String getDownloadableUrl(String contentUrl){
  if (isValidMatrixContentUrl(contentUrl)) {
    String mediaServerAndId=contentUrl.substring(MATRIX_CONTENT_URI_SCHEME.length());
    return mHsConfig.getHomeserverUri().toString() + URI_PREFIX_CONTENT_API + "String_Node_Str"+ mediaServerAndId;
  }
 else {
    return null;
  }
}
Program: 31964
Project: 31964
Buggy source:
/** 
 * Convert matrix url into http one.
 * @param url    the matrix url
 * @param width  the expected image width
 * @param height the expected image height
 * @return the URL to access the described resource.
 */
private String downloadableUrl(String url,int width,int height){
  if ((null != url) && url.startsWith(ContentManager.MATRIX_CONTENT_URI_SCHEME)) {
    if ((width > 0) && (height > 0)) {
      return mContentManager.getDownloadableThumbnailUrl(url,width,height,ContentManager.METHOD_SCALE);
    }
 else {
      return mContentManager.getDownloadableUrl(url);
    }
  }
 else {
    return url;
  }
}

Fixed version (ground truth):
/** 
 * Convert matrix url into http one.
 * @param url    the matrix url
 * @param width  the expected image width
 * @param height the expected image height
 * @return the URL to access the described resource.
 */
private String downloadableUrl(String url,int width,int height){
  if ((null != url) && url.startsWith(ContentManager.MATRIX_CONTENT_URI_SCHEME)) {
    if ((width > 0) && (height > 0)) {
      return mContentManager.getDownloadableThumbnailUrl(url,width,height,ContentManager.METHOD_SCALE);
    }
 else {
      return mContentManager.getDownloadableUrl(url);
    }
  }
 else {
    return null;
  }
}
Program: 31965
Project: 31965
Buggy source:
/** 
 * Return the cache file name for a media defined by its URL and its mimetype.
 * @param url      the media URL
 * @param width    the media width
 * @param height   the media height
 * @param mimeType the media mime type
 * @return the media file it is found
 */
private File mediaCacheFile(String url,int width,int height,String mimeType){
  if (null == url) {
    return null;
  }
  String filename=(url.startsWith("String_Node_Str")) ? url : MXMediaDownloadWorkerTask.buildFileName(downloadableUrl(url,width,height),mimeType);
  try {
    if (filename.startsWith("String_Node_Str")) {
      Uri uri=Uri.parse(filename);
      filename=uri.getLastPathSegment();
    }
    File file=new File(getFolderFile(mimeType),filename);
    if (file.exists()) {
      return file;
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return the cache file name for a media defined by its URL and its mimetype.
 * @param url      the media URL
 * @param width    the media width
 * @param height   the media height
 * @param mimeType the media mime type
 * @return the media file it is found
 */
private File mediaCacheFile(String url,int width,int height,String mimeType){
  if (null == url) {
    return null;
  }
  String filename;
  if (url.startsWith("String_Node_Str")) {
    filename=url;
  }
 else {
    String downloadableUrl=downloadableUrl(url,width,height);
    if (null != downloadableUrl) {
      filename=MXMediaDownloadWorkerTask.buildFileName(downloadableUrl,mimeType);
    }
 else {
      return null;
    }
  }
  try {
    if (filename.startsWith("String_Node_Str")) {
      Uri uri=Uri.parse(filename);
      filename=uri.getLastPathSegment();
    }
    File file=new File(getFolderFile(mimeType),filename);
    if (file.exists()) {
      return file;
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
  return null;
}
Program: 31967
Project: 31967
Buggy source:
public void success(T t,Response<T> response){
  if (null != mEventDescription) {
    Log.d(LOG_TAG,"String_Node_Str" + mEventDescription + "String_Node_Str");
  }
  try {
    onEventSent();
    if (null != mApiCallback) {
      try {
        mApiCallback.onSuccess(t);
      }
 catch (      Exception e) {
        Log.d(LOG_TAG,"String_Node_Str" + e.getMessage());
      }
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
public void success(T t,Response<T> response){
  if (null != mEventDescription) {
    Log.d(LOG_TAG,"String_Node_Str" + mEventDescription + "String_Node_Str");
  }
  try {
    onEventSent();
    if (null != mApiCallback) {
      try {
        mApiCallback.onSuccess(t);
      }
 catch (      Exception e) {
        Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
        mApiCallback.onUnexpectedError(e);
      }
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
}
Program: 31969
Project: 31969
Buggy source:
/** 
 * @return the users list
 */
public List<GroupUser> getUsers(){
  if (null == chunk) {
    chunk=new ArrayList<>();
  }
  return chunk;
}

Fixed version (ground truth):
/** 
 * @return the users list
 */
public List<GroupUser> getUsers(){
  if (null == chunk) {
    mFilteredUsers=chunk=new ArrayList<>();
  }
 else   if (null == mFilteredUsers) {
    mFilteredUsers=new ArrayList<>();
    HashMap<String,GroupUser> map=new HashMap<>();
    for (    GroupUser user : chunk) {
      if (null != user.userId) {
        map.put(user.userId,user);
      }
 else {
        mFilteredUsers.add(user);
      }
    }
    mFilteredUsers.addAll(map.values());
  }
  return mFilteredUsers;
}
Program: 31970
Project: 31970
Buggy source:
/** 
 * @return The additional keys the sender of this encrypted event claims to possess.
 */
public Map<String,String> getKeysClaimed(){
  Map<String,String> res=new HashMap<>();
  if (null != mClaimedEd25519Key) {
    res.put("String_Node_Str",mClaimedEd25519Key);
  }
  return res;
}

Fixed version (ground truth):
/** 
 * @return The additional keys the sender of this encrypted event claims to possess.
 */
public Map<String,String> getKeysClaimed(){
  Map<String,String> res=new HashMap<>();
  String claimedEd25519Key=(null != getClearEvent()) ? getClearEvent().mClaimedEd25519Key : mClaimedEd25519Key;
  if (null != claimedEd25519Key) {
    res.put("String_Node_Str",claimedEd25519Key);
  }
  return res;
}
Program: 31971
Project: 31971
Buggy source:
/** 
 * Starts rendering   {@link #videoTrack} if rendering is not in progress andall preconditions for the start of rendering are met.
 */
private void tryAddRendererToVideoTrack(){
  if (videoRenderer == null && videoTrack != null && ViewCompat.isAttachedToWindow(this)) {
    EglBase.Context sharedContext=EglUtils.getRootEglBaseContext();
    if (sharedContext == null) {
      Log.e(TAG,"String_Node_Str");
      return;
    }
    SurfaceViewRenderer surfaceViewRenderer=getSurfaceViewRenderer();
    surfaceViewRenderer.init(sharedContext,rendererEvents);
    videoRenderer=new VideoRenderer(surfaceViewRenderer);
    videoTrack.addRenderer(videoRenderer);
  }
}

Fixed version (ground truth):
/** 
 * Starts rendering   {@link #videoTrack} if rendering is not in progress andall preconditions for the start of rendering are met.
 */
private void tryAddRendererToVideoTrack(){
  if (videoRenderer == null && videoTrack != null && ViewCompat.isAttachedToWindow(this)) {
    EglBase.Context sharedContext=EglUtils.getRootEglBaseContext();
    if (sharedContext == null) {
      Log.e(LOG_TAG,"String_Node_Str");
      return;
    }
    SurfaceViewRenderer surfaceViewRenderer=getSurfaceViewRenderer();
    surfaceViewRenderer.init(sharedContext,rendererEvents);
    videoRenderer=new VideoRenderer(surfaceViewRenderer);
    videoTrack.addRenderer(videoRenderer);
  }
}
Program: 31974
Project: 31974
Buggy source:
@Override public void onMatrixError(MatrixError e){
  Log.e(LOG_TAG,"String_Node_Str" + userId + "String_Node_Str"+ deviceId+ "String_Node_Str"+ e.getMessage());
}

Fixed version (ground truth):
@Override public void onMatrixError(MatrixError e){
  Log.e(LOG_TAG,"String_Node_Str" + userId + "String_Node_Str"+ e.getMessage());
}
Program: 31975
Project: 31975
Buggy source:
@Override public void onUnexpectedError(Exception e){
  Log.e(LOG_TAG,"String_Node_Str" + userId + "String_Node_Str"+ deviceId+ "String_Node_Str"+ e.getMessage());
}

Fixed version (ground truth):
@Override public void onUnexpectedError(Exception e){
  Log.e(LOG_TAG,"String_Node_Str" + userId + "String_Node_Str"+ e.getMessage());
}
Program: 31976
Project: 31976
Buggy source:
@Override public void onNetworkError(Exception e){
  Log.e(LOG_TAG,"String_Node_Str" + userId + "String_Node_Str"+ deviceId+ "String_Node_Str"+ e.getMessage());
}

Fixed version (ground truth):
@Override public void onNetworkError(Exception e){
  Log.e(LOG_TAG,"String_Node_Str" + userId + "String_Node_Str"+ e.getMessage());
}
Program: 31980
Project: 31980
Buggy source:
/** 
 * @return the filename
 */
public String getFileName(Context context){
  if ((null == mFileName) && (null != getUri())) {
    Uri mediaUri=getUri();
    if (null != mediaUri) {
      if (mediaUri.toString().startsWith("String_Node_Str")) {
        Cursor cursor=null;
        try {
          cursor=context.getContentResolver().query(mediaUri,null,null,null,null);
          if (cursor != null && cursor.moveToFirst()) {
            mFileName=cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
          }
        }
 catch (        Exception e) {
          Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
        }
 finally {
          if (null != cursor) {
            cursor.close();
          }
        }
        if (TextUtils.isEmpty(mFileName)) {
          List uriPath=mediaUri.getPathSegments();
          mFileName=(String)uriPath.get(uriPath.size() - 1);
        }
      }
 else       if (mediaUri.toString().startsWith("String_Node_Str")) {
        try {
          mFileName=mediaUri.getLastPathSegment();
        }
 catch (        Exception e) {
          Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
        }
        if (TextUtils.isEmpty(mFileName)) {
          mFileName=null;
        }
      }
    }
  }
  return mFileName;
}

Fixed version (ground truth):
/** 
 * @return the filename
 */
public String getFileName(Context context){
  if ((null == mFileName) && (null != getUri())) {
    Uri mediaUri=getUri();
    if (null != mediaUri) {
      try {
        if (mediaUri.toString().startsWith("String_Node_Str")) {
          Cursor cursor=null;
          try {
            cursor=context.getContentResolver().query(mediaUri,null,null,null,null);
            if (cursor != null && cursor.moveToFirst()) {
              mFileName=cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
            }
          }
 catch (          Exception e) {
            Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
          }
 finally {
            if (null != cursor) {
              cursor.close();
            }
          }
          if (TextUtils.isEmpty(mFileName)) {
            List uriPath=mediaUri.getPathSegments();
            mFileName=(String)uriPath.get(uriPath.size() - 1);
          }
        }
 else         if (mediaUri.toString().startsWith("String_Node_Str")) {
          mFileName=mediaUri.getLastPathSegment();
        }
      }
 catch (      Exception e) {
        mFileName=null;
      }
    }
  }
  return mFileName;
}
Program: 31981
Project: 31981
Buggy source:
/** 
 * Gets the image thumbnail.
 * @param context the context.
 * @param kind    the thumbnail kind.
 * @return the thumbnail.
 */
private Bitmap getImageThumbnail(Context context,int kind){
  if ((null == getMimeType(context)) || !getMimeType(context).startsWith("String_Node_Str")) {
    return null;
  }
  Bitmap thumbnailBitmap=null;
  try {
    ContentResolver resolver=context.getContentResolver();
    List uriPath=getUri().getPathSegments();
    long imageId;
    String lastSegment=(String)uriPath.get(uriPath.size() - 1);
    if (lastSegment.startsWith("String_Node_Str")) {
      lastSegment=lastSegment.substring("String_Node_Str".length());
    }
    imageId=Long.parseLong(lastSegment);
    thumbnailBitmap=MediaStore.Images.Thumbnails.getThumbnail(resolver,imageId,kind,null);
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
  return thumbnailBitmap;
}

Fixed version (ground truth):
/** 
 * Gets the image thumbnail.
 * @param context the context.
 * @param kind    the thumbnail kind.
 * @return the thumbnail.
 */
private Bitmap getImageThumbnail(Context context,int kind){
  if ((null == getMimeType(context)) || !getMimeType(context).startsWith("String_Node_Str")) {
    return null;
  }
  Bitmap thumbnailBitmap=null;
  try {
    ContentResolver resolver=context.getContentResolver();
    List uriPath=getUri().getPathSegments();
    Long imageId;
    String lastSegment=(String)uriPath.get(uriPath.size() - 1);
    if (lastSegment.startsWith("String_Node_Str")) {
      lastSegment=lastSegment.substring("String_Node_Str".length());
    }
    try {
      imageId=Long.parseLong(lastSegment);
    }
 catch (    Exception e) {
      imageId=null;
    }
    if (null != imageId) {
      thumbnailBitmap=MediaStore.Images.Thumbnails.getThumbnail(resolver,imageId,kind,null);
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
  return thumbnailBitmap;
}
Program: 31982
Project: 31982
Buggy source:
/** 
 * Check if the crypto engine is properly initialized. Launch it it is was not yet done.
 */
public void checkCrypto(){
  MXFileCryptoStore fileCryptoStore=new MXFileCryptoStore();
  fileCryptoStore.initWithCredentials(mAppContent,mCredentials);
  if (fileCryptoStore.hasData() && (null == mCrypto)) {
    Log.e(LOG_TAG,"String_Node_Str");
    enableCrypto(true,new ApiCallback<Void>(){
      @Override public void onSuccess(      Void info){
        Log.e(LOG_TAG,"String_Node_Str");
        mDataHandler.setCrypto(mCrypto);
        decryptRoomSummaries();
      }
      @Override public void onNetworkError(      Exception e){
        Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
      }
      @Override public void onMatrixError(      MatrixError e){
        Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
      }
      @Override public void onUnexpectedError(      Exception e){
        Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
      }
    }
);
  }
 else   if (mDataHandler.getCrypto() != mCrypto) {
    Log.e(LOG_TAG,"String_Node_Str");
    mDataHandler.setCrypto(mCrypto);
  }
}

Fixed version (ground truth):
/** 
 * Check if the crypto engine is properly initialized. Launch it it is was not yet done.
 */
public void checkCrypto(){
  MXFileCryptoStore fileCryptoStore=new MXFileCryptoStore();
  fileCryptoStore.initWithCredentials(mAppContent,mCredentials);
  if ((fileCryptoStore.hasData() || mEnableCryptoWhenStartingMXSession) && (null == mCrypto)) {
    boolean isStoreLoaded=false;
    try {
      fileCryptoStore.open();
      isStoreLoaded=true;
    }
 catch (    UnsatisfiedLinkError e) {
      Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
    }
    if (!isStoreLoaded) {
      mOlmManager=new OlmManager();
      try {
        fileCryptoStore.open();
        isStoreLoaded=true;
      }
 catch (      UnsatisfiedLinkError e) {
        Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
      }
    }
    if (!isStoreLoaded) {
      Log.e(LOG_TAG,"String_Node_Str");
      return;
    }
    mDataHandler.setCrypto(mCrypto);
    decryptRoomSummaries();
    Log.d(LOG_TAG,"String_Node_Str");
  }
 else   if (mDataHandler.getCrypto() != mCrypto) {
    Log.e(LOG_TAG,"String_Node_Str");
    mDataHandler.setCrypto(mCrypto);
  }
}
Program: 31983
Project: 31983
Buggy source:
@Override public void postProcess(String accountId){
  if (null == mCrypto) {
    MXFileCryptoStore store=new MXFileCryptoStore();
    store.initWithCredentials(mAppContent,mCredentials);
    if (store.hasData() || mEnableCryptoWhenStartingMXSession) {
      Log.d(LOG_TAG,"String_Node_Str" + this);
      store.open();
      mCrypto=new MXCrypto(MXSession.this,store);
      mDataHandler.setCrypto(mCrypto);
      decryptRoomSummaries();
    }
 else {
      Log.e(LOG_TAG,"String_Node_Str");
    }
  }
 else {
    Log.e(LOG_TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void postProcess(String accountId){
  if (null == mCrypto) {
    MXFileCryptoStore store=new MXFileCryptoStore();
    store.initWithCredentials(mAppContent,mCredentials);
    if (store.hasData() || mEnableCryptoWhenStartingMXSession) {
      Log.d(LOG_TAG,"String_Node_Str" + this);
      checkCrypto();
    }
 else {
      Log.e(LOG_TAG,"String_Node_Str");
    }
  }
 else {
    Log.e(LOG_TAG,"String_Node_Str");
  }
}
Program: 31985
Project: 31985
Buggy source:
/** 
 * Export the crypto keys
 * @param password the password
 * @param callback the exported keys
 */
public void exportRoomKeys(final String password,final ApiCallback<byte[]> callback){
  getDecryptingThreadHandler().post(new Runnable(){
    @Override public void run(){
      ArrayList<Map<String,Object>> exportedSessions=new ArrayList<>();
      List<MXOlmInboundGroupSession2> inboundGroupSessions=mCryptoStore.getInboundGroupSessions();
      for (      MXOlmInboundGroupSession2 session : inboundGroupSessions) {
        Map<String,Object> map=session.exportKeys();
        if (null != map) {
          exportedSessions.add(map);
        }
      }
      final byte[] encryptedRoomKeys;
      try {
        String allo=JsonUtils.getGson(false).toJsonTree(exportedSessions).toString();
        encryptedRoomKeys=MXMegolmExportEncryption.encryptMegolmKeyFile(allo,password);
      }
 catch (      Exception e) {
        callback.onUnexpectedError(e);
        return;
      }
      getUIHandler().post(new Runnable(){
        @Override public void run(){
          callback.onSuccess(encryptedRoomKeys);
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Export the crypto keys
 * @param password the password
 * @param callback the exported keys
 */
public void exportRoomKeys(final String password,final ApiCallback<byte[]> callback){
  getDecryptingThreadHandler().post(new Runnable(){
    @Override public void run(){
      if (null == mCryptoStore) {
        getUIHandler().post(new Runnable(){
          @Override public void run(){
            callback.onSuccess(new byte[0]);
          }
        }
);
        return;
      }
      ArrayList<Map<String,Object>> exportedSessions=new ArrayList<>();
      List<MXOlmInboundGroupSession2> inboundGroupSessions=mCryptoStore.getInboundGroupSessions();
      for (      MXOlmInboundGroupSession2 session : inboundGroupSessions) {
        Map<String,Object> map=session.exportKeys();
        if (null != map) {
          exportedSessions.add(map);
        }
      }
      final byte[] encryptedRoomKeys;
      try {
        String allo=JsonUtils.getGson(false).toJsonTree(exportedSessions).toString();
        encryptedRoomKeys=MXMegolmExportEncryption.encryptMegolmKeyFile(allo,password);
      }
 catch (      Exception e) {
        callback.onUnexpectedError(e);
        return;
      }
      getUIHandler().post(new Runnable(){
        @Override public void run(){
          callback.onSuccess(encryptedRoomKeys);
        }
      }
);
    }
  }
);
}
Program: 31986
Project: 31986
Buggy source:
@Override protected Long doInBackground(Void... params){
  getMediasCache().removeMediasBefore(timestamp,filesToKeep);
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Void... params){
  getMediasCache().removeMediasBefore(timestamp,filesToKeep);
  return null;
}
Program: 31989
Project: 31989
Buggy source:
private void restartAfter(int msDelay){
  if (null != mTurnServerTimer) {
    mTurnServerTimer.cancel();
  }
  mTurnServerTimer=new Timer();
  mTurnServerTimer.schedule(new TimerTask(){
    @Override public void run(){
      if (mTurnServerTimer != null) {
        mTurnServerTimer.cancel();
        mTurnServerTimer=null;
      }
      refreshTurnServer();
    }
  }
,msDelay);
}

Fixed version (ground truth):
private void restartAfter(int msDelay){
  if (msDelay <= 0) {
    Log.e(LOG_TAG,"String_Node_Str" + msDelay);
  }
 else {
    if (null != mTurnServerTimer) {
      mTurnServerTimer.cancel();
    }
    mTurnServerTimer=new Timer();
    mTurnServerTimer.schedule(new TimerTask(){
      @Override public void run(){
        if (mTurnServerTimer != null) {
          mTurnServerTimer.cancel();
          mTurnServerTimer=null;
        }
        refreshTurnServer();
      }
    }
,msDelay);
  }
}
Program: 31990
Project: 31990
Buggy source:
@Override public boolean switchRearFrontCamera(){
  if ((null != mVideoCapturer) && (isSwitchCameraSupported())) {
    VideoCapturerAndroid videoCapturerAndroid=(VideoCapturerAndroid)mVideoCapturer;
    if (videoCapturerAndroid.switchCamera(null)) {
      if (CAMERA_TYPE_FRONT == mCameraInUse) {
        mCameraInUse=CAMERA_TYPE_REAR;
      }
 else {
        mCameraInUse=CAMERA_TYPE_FRONT;
      }
      mIsCameraSwitched=!mIsCameraSwitched;
      mUIThreadHandler.postDelayed(new Runnable(){
        @Override public void run(){
          listenPreviewUpdate();
        }
      }
,500);
      return true;
    }
 else {
      Log.w(LOG_TAG,"String_Node_Str");
    }
  }
 else {
    Log.w(LOG_TAG,"String_Node_Str");
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean switchRearFrontCamera(){
  if ((null != mVideoCapturer) && (isSwitchCameraSupported())) {
    VideoCapturerAndroid videoCapturerAndroid=(VideoCapturerAndroid)mVideoCapturer;
    try {
      if ((null != videoCapturerAndroid) && videoCapturerAndroid.switchCamera(null)) {
        if (CAMERA_TYPE_FRONT == mCameraInUse) {
          mCameraInUse=CAMERA_TYPE_REAR;
        }
 else {
          mCameraInUse=CAMERA_TYPE_FRONT;
        }
        mIsCameraSwitched=!mIsCameraSwitched;
        mUIThreadHandler.postDelayed(new Runnable(){
          @Override public void run(){
            listenPreviewUpdate();
          }
        }
,500);
        return true;
      }
 else {
        Log.w(LOG_TAG,"String_Node_Str");
      }
    }
 catch (    Exception e) {
      Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
    }
  }
 else {
    Log.w(LOG_TAG,"String_Node_Str");
  }
  return false;
}
Program: 31992
Project: 31992
Buggy source:
/** 
 * Set a delay between two sync requests.
 * @param ms the delay in ms
 */
public void setSyncDelay(int ms){
  mRequestDelayMs=Math.max(0,ms);
  Log.d(LOG_TAG,"String_Node_Str" + mRequestDelayMs + "String_Node_Str"+ getState());
  if (State.WAITING == getState() && !mPaused) {
    Log.d(LOG_TAG,"String_Node_Str");
synchronized (mSyncObject) {
      mSyncObject.notify();
    }
  }
}

Fixed version (ground truth):
/** 
 * Set a delay between two sync requests.
 * @param ms the delay in ms
 */
public void setSyncDelay(int ms){
  mRequestDelayMs=Math.max(0,ms);
  Log.d(LOG_TAG,"String_Node_Str" + mRequestDelayMs + "String_Node_Str"+ getState());
  if (State.WAITING == getState() && (!mPaused || (0 == mRequestDelayMs) && mIsCatchingUp)) {
    if (!mPaused) {
      Log.d(LOG_TAG,"String_Node_Str");
    }
    if ((0 == mRequestDelayMs) && mIsCatchingUp) {
      Log.d(LOG_TAG,"String_Node_Str");
      mIsCatchingUp=false;
    }
synchronized (mSyncObject) {
      mSyncObject.notify();
    }
  }
}
Program: 31998
Project: 31998
Buggy source:
/** 
 * Set a delay between two sync requests.
 * @param ms the delay in ms
 */
public void setSyncDelay(int ms){
  mRequestDelayMs=Math.max(0,ms);
  Log.d(LOG_TAG,"String_Node_Str" + mRequestDelayMs + "String_Node_Str"+ getState());
  if (State.WAITING == getState()) {
    Log.d(LOG_TAG,"String_Node_Str");
synchronized (mSyncObject) {
      mSyncObject.notify();
    }
  }
}

Fixed version (ground truth):
/** 
 * Set a delay between two sync requests.
 * @param ms the delay in ms
 */
public void setSyncDelay(int ms){
  mRequestDelayMs=Math.max(0,ms);
  Log.d(LOG_TAG,"String_Node_Str" + mRequestDelayMs + "String_Node_Str"+ getState());
  if (State.WAITING == getState()) {
    Log.d(LOG_TAG,"String_Node_Str");
    if (0 == mRequestDelayMs) {
      mPaused=false;
    }
synchronized (mSyncObject) {
      mSyncObject.notify();
    }
  }
}
Program: 32002
Project: 32002
Buggy source:
/** 
 * Set a delay between two sync requests.
 * @param ms the delay in ms
 */
public void setSyncDelay(int ms){
  mRequestDelayMs=Math.max(0,ms);
  Log.d(LOG_TAG,"String_Node_Str" + mRequestDelayMs);
  Handler handler=null;
  try {
    handler=new Handler();
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
  if (null == handler) {
    handler=new Handler(Looper.getMainLooper());
  }
  handler.post(new Runnable(){
    @Override public void run(){
      if (null != mSyncDelayTimer) {
        Log.d(LOG_TAG,"String_Node_Str");
        mSyncDelayTimer.cancel();
synchronized (mSyncObject) {
          mSyncObject.notify();
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Set a delay between two sync requests.
 * @param ms the delay in ms
 */
public void setSyncDelay(int ms){
  mRequestDelayMs=Math.max(0,ms);
  Log.d(LOG_TAG,"String_Node_Str" + mRequestDelayMs);
  Handler handler=(null != mThreadHandler) ? mThreadHandler : new Handler(Looper.getMainLooper());
  handler.post(new Runnable(){
    @Override public void run(){
      if (null != mSyncDelayTimer) {
        Log.d(LOG_TAG,"String_Node_Str");
        mSyncDelayTimer.cancel();
synchronized (mSyncObject) {
          mSyncObject.notify();
        }
      }
    }
  }
);
}
Program: 32003
Project: 32003
Buggy source:
/** 
 * Load event receipts from the file system.
 * @return true if the operation succeeds.
 */
private boolean loadReceipts(){
  boolean succeed=true;
  try {
    int count=mRoomReceiptsToLoad.size();
    long start=System.currentTimeMillis();
    while (mRoomReceiptsToLoad.size() > 0) {
      String roomId;
synchronized (mRoomReceiptsToLoad) {
        roomId=mRoomReceiptsToLoad.get(0);
      }
      loadReceipts(roomId);
synchronized (mRoomReceiptsToLoad) {
        mRoomReceiptsToLoad.remove(0);
      }
    }
    saveReceipts();
    long delta=(System.currentTimeMillis() - start);
    Log.d(LOG_TAG,"String_Node_Str" + count + "String_Node_Str"+ delta+ "String_Node_Str");
    mStoreStats.put("String_Node_Str",delta);
synchronized (this) {
      mAreReceiptsReady=true;
    }
  }
 catch (  Exception e) {
    succeed=false;
    Log.e(LOG_TAG,"String_Node_Str" + e.getLocalizedMessage());
  }
  return succeed;
}

Fixed version (ground truth):
/** 
 * Load event receipts from the file system.
 * @return true if the operation succeeds.
 */
private boolean loadReceipts(){
  boolean succeed=true;
  try {
    int count=mRoomReceiptsToLoad.size();
    long start=System.currentTimeMillis();
    while (mRoomReceiptsToLoad.size() > 0) {
      String roomId;
synchronized (mRoomReceiptsToLoad) {
        roomId=mRoomReceiptsToLoad.get(0);
      }
      loadReceipts(roomId);
synchronized (mRoomReceiptsToLoad) {
        mRoomReceiptsToLoad.remove(0);
      }
    }
    saveReceipts();
    long delta=(System.currentTimeMillis() - start);
    Log.d(LOG_TAG,"String_Node_Str" + count + "String_Node_Str"+ delta+ "String_Node_Str");
    mStoreStats.put("String_Node_Str",delta);
  }
 catch (  Exception e) {
    succeed=false;
    Log.e(LOG_TAG,"String_Node_Str" + e.getLocalizedMessage());
  }
synchronized (this) {
    mAreReceiptsReady=true;
  }
  return succeed;
}
Program: 32004
Project: 32004
Buggy source:
/** 
 * flush the metadata info from the file system.
 */
private void saveMetaData(){
  if ((mMetaDataHasChanged) && (null != mFileStoreHandler) && (null != mMetadata)) {
    mMetaDataHasChanged=false;
    final MXFileStoreMetaData fMetadata=mMetadata.deepCopy();
    Runnable r=new Runnable(){
      @Override public void run(){
        mFileStoreHandler.post(new Runnable(){
          public void run(){
            if (!mIsKilled) {
              long start=System.currentTimeMillis();
              writeObject("String_Node_Str",new File(mStoreFolderFile,MXFILE_STORE_METADATA_FILE_NAME),fMetadata);
              Log.d(LOG_TAG,"String_Node_Str" + (System.currentTimeMillis() - start) + "String_Node_Str");
            }
          }
        }
);
      }
    }
;
    Thread t=new Thread(r);
    t.start();
  }
}

Fixed version (ground truth):
/** 
 * flush the metadata info from the file system.
 */
private void saveMetaData(){
  if ((mMetaDataHasChanged) && (null != mFileStoreHandler) && (null != mMetadata)) {
    mMetaDataHasChanged=false;
    final MXFileStoreMetaData fMetadata=mMetadata.deepCopy();
    Runnable r=new Runnable(){
      @Override public void run(){
        mFileStoreHandler.post(new Runnable(){
          public void run(){
            if (!mIsKilled) {
              if (null != mMetadata.mEventStreamToken) {
                long start=System.currentTimeMillis();
                writeObject("String_Node_Str",new File(mStoreFolderFile,MXFILE_STORE_METADATA_FILE_NAME),fMetadata);
                Log.d(LOG_TAG,"String_Node_Str" + (System.currentTimeMillis() - start) + "String_Node_Str");
              }
 else {
                Log.e(LOG_TAG,"String_Node_Str");
              }
            }
          }
        }
);
      }
    }
;
    Thread t=new Thread(r);
    t.start();
  }
}
Program: 32005
Project: 32005
Buggy source:
/** 
 * Init the room fields.
 * @param store the store.
 * @param roomId the room id
 * @param dataHandler the data handler
 */
public void init(IMXStore store,String roomId,MXDataHandler dataHandler){
  mLiveTimeline.setRoomId(roomId);
  mDataHandler=dataHandler;
  mStore=store;
  if (null != mDataHandler) {
    mMyUserId=mDataHandler.getUserId();
    mLiveTimeline.setDataHandler(mStore,dataHandler);
  }
}

Fixed version (ground truth):
/** 
 * Init the room fields.
 * @param store       the store.
 * @param roomId      the room id
 * @param dataHandler the data handler
 */
public void init(IMXStore store,String roomId,MXDataHandler dataHandler){
  mLiveTimeline.setRoomId(roomId);
  mDataHandler=dataHandler;
  mStore=store;
  if (null != mDataHandler) {
    mMyUserId=mDataHandler.getUserId();
    mLiveTimeline.setDataHandler(mStore,dataHandler);
  }
}