nus-yam/ex-repair huggingface dataset:
Program: 15354
Project: 15354
Buggy source:
public static UserCommentListingURL parse(Uri uri){
  final String[] pathSegments;
{
    final List<String> pathSegmentsList=uri.getPathSegments();
    final ArrayList<String> pathSegmentsFiltered=new ArrayList<>(pathSegmentsList.size());
    for (    String segment : pathSegmentsList) {
      while (segment.toLowerCase().endsWith("String_Node_Str") || segment.toLowerCase().endsWith("String_Node_Str")) {
        segment=segment.substring(0,segment.lastIndexOf('.'));
      }
      if (segment.length() > 0) {
        pathSegmentsFiltered.add(segment);
      }
    }
    pathSegments=pathSegmentsFiltered.toArray(new String[pathSegmentsFiltered.size()]);
  }
  if (pathSegments.length < 3) {
    return null;
  }
  if (!pathSegments[0].equalsIgnoreCase("String_Node_Str") && !pathSegments[0].equalsIgnoreCase("String_Node_Str")) {
    return null;
  }
  final String username=pathSegments[1];
  final String typeName=pathSegments[2];
  if (!typeName.equalsIgnoreCase("String_Node_Str")) {
    return null;
  }
  Integer limit=null;
  String after=null;
  for (  final String parameterKey : General.getUriQueryParameterNames(uri)) {
    if (parameterKey.equalsIgnoreCase("String_Node_Str")) {
      after=uri.getQueryParameter(parameterKey);
    }
 else     if (parameterKey.equalsIgnoreCase("String_Node_Str")) {
      try {
        limit=Integer.parseInt(uri.getQueryParameter(parameterKey));
      }
 catch (      Throwable ignored) {
      }
    }
  }
  return new UserCommentListingURL(username,limit,after);
}

Fixed version (ground truth):
public static UserCommentListingURL parse(Uri uri){
  final String[] pathSegments;
{
    final List<String> pathSegmentsList=uri.getPathSegments();
    final ArrayList<String> pathSegmentsFiltered=new ArrayList<>(pathSegmentsList.size());
    for (    String segment : pathSegmentsList) {
      while (General.asciiLowercase(segment).endsWith("String_Node_Str") || General.asciiLowercase(segment).endsWith("String_Node_Str")) {
        segment=segment.substring(0,segment.lastIndexOf('.'));
      }
      if (segment.length() > 0) {
        pathSegmentsFiltered.add(segment);
      }
    }
    pathSegments=pathSegmentsFiltered.toArray(new String[pathSegmentsFiltered.size()]);
  }
  if (pathSegments.length < 3) {
    return null;
  }
  if (!pathSegments[0].equalsIgnoreCase("String_Node_Str") && !pathSegments[0].equalsIgnoreCase("String_Node_Str")) {
    return null;
  }
  final String username=pathSegments[1];
  final String typeName=pathSegments[2];
  if (!typeName.equalsIgnoreCase("String_Node_Str")) {
    return null;
  }
  Integer limit=null;
  String after=null;
  for (  final String parameterKey : General.getUriQueryParameterNames(uri)) {
    if (parameterKey.equalsIgnoreCase("String_Node_Str")) {
      after=uri.getQueryParameter(parameterKey);
    }
 else     if (parameterKey.equalsIgnoreCase("String_Node_Str")) {
      try {
        limit=Integer.parseInt(uri.getQueryParameter(parameterKey));
      }
 catch (      Throwable ignored) {
      }
    }
  }
  return new UserCommentListingURL(username,limit,after);
}
Program: 15355
Project: 15355
Buggy source:
@Override public Uri generateJsonUri(){
  Uri.Builder builder=new Uri.Builder();
  builder.scheme(Constants.Reddit.getScheme()).authority(Constants.Reddit.getDomain());
  builder.appendEncodedPath("String_Node_Str");
  builder.appendPath(user);
  builder.appendEncodedPath(type.name().toLowerCase());
  if (before != null) {
    builder.appendQueryParameter("String_Node_Str",before);
  }
  if (after != null) {
    builder.appendQueryParameter("String_Node_Str",after);
  }
  if (limit != null) {
    builder.appendQueryParameter("String_Node_Str",String.valueOf(limit));
  }
  builder.appendEncodedPath("String_Node_Str");
  return builder.build();
}

Fixed version (ground truth):
@Override public Uri generateJsonUri(){
  Uri.Builder builder=new Uri.Builder();
  builder.scheme(Constants.Reddit.getScheme()).authority(Constants.Reddit.getDomain());
  builder.appendEncodedPath("String_Node_Str");
  builder.appendPath(user);
  builder.appendEncodedPath(General.asciiLowercase(type.name()));
  if (before != null) {
    builder.appendQueryParameter("String_Node_Str",before);
  }
  if (after != null) {
    builder.appendQueryParameter("String_Node_Str",after);
  }
  if (limit != null) {
    builder.appendQueryParameter("String_Node_Str",String.valueOf(limit));
  }
  builder.appendEncodedPath("String_Node_Str");
  return builder.build();
}
Program: 15357
Project: 15357
Buggy source:
public static UserProfileURL parse(Uri uri){
  final String[] pathSegments;
{
    final List<String> pathSegmentsList=uri.getPathSegments();
    final ArrayList<String> pathSegmentsFiltered=new ArrayList<>(pathSegmentsList.size());
    for (    String segment : pathSegmentsList) {
      while (segment.toLowerCase().endsWith("String_Node_Str") || segment.toLowerCase().endsWith("String_Node_Str")) {
        segment=segment.substring(0,segment.lastIndexOf('.'));
      }
      if (segment.length() > 0) {
        pathSegmentsFiltered.add(segment);
      }
    }
    pathSegments=pathSegmentsFiltered.toArray(new String[pathSegmentsFiltered.size()]);
  }
  if (pathSegments.length != 2) {
    return null;
  }
  if (!pathSegments[0].equalsIgnoreCase("String_Node_Str") && !pathSegments[0].equalsIgnoreCase("String_Node_Str")) {
    return null;
  }
  final String username=pathSegments[1];
  return new UserProfileURL(username);
}

Fixed version (ground truth):
public static UserProfileURL parse(Uri uri){
  final String[] pathSegments;
{
    final List<String> pathSegmentsList=uri.getPathSegments();
    final ArrayList<String> pathSegmentsFiltered=new ArrayList<>(pathSegmentsList.size());
    for (    String segment : pathSegmentsList) {
      while (General.asciiLowercase(segment).endsWith("String_Node_Str") || General.asciiLowercase(segment).endsWith("String_Node_Str")) {
        segment=segment.substring(0,segment.lastIndexOf('.'));
      }
      if (segment.length() > 0) {
        pathSegmentsFiltered.add(segment);
      }
    }
    pathSegments=pathSegmentsFiltered.toArray(new String[pathSegmentsFiltered.size()]);
  }
  if (pathSegments.length != 2) {
    return null;
  }
  if (!pathSegments[0].equalsIgnoreCase("String_Node_Str") && !pathSegments[0].equalsIgnoreCase("String_Node_Str")) {
    return null;
  }
  final String username=pathSegments[1];
  return new UserProfileURL(username);
}
Program: 15358
Project: 15358
Buggy source:
@Override public void onPageStarted(WebView view,String url,Bitmap favicon){
  super.onPageStarted(view,url,favicon);
  final AppCompatActivity activity=mActivity;
  if (activity != null) {
    activity.setTitle(url);
  }
}

Fixed version (ground truth):
@Override public void onPageStarted(WebView view,String url,Bitmap favicon){
  super.onPageStarted(view,url,favicon);
  if (mUrl != null && url != null) {
    final AppCompatActivity activity=mActivity;
    if (activity != null) {
      activity.setTitle(url);
    }
  }
}
Program: 15359
Project: 15359
Buggy source:
@Override public void onCreate(final Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  url=getArguments().getString("String_Node_Str");
  html=getArguments().getString("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onCreate(final Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mUrl=getArguments().getString("String_Node_Str");
  html=getArguments().getString("String_Node_Str");
}
Program: 15360
Project: 15360
Buggy source:
public String getCurrentUrl(){
  return (currentUrl != null) ? currentUrl : url;
}

Fixed version (ground truth):
public String getCurrentUrl(){
  return (currentUrl != null) ? currentUrl : mUrl;
}
Program: 15362
Project: 15362
Buggy source:
private Collection<GroupedRecyclerViewAdapter.Item> filter(Collection<RedditCommentListItem> comments){
  Collection<RedditCommentListItem> searchComments;
  if (mSearchString == null) {
    searchComments=comments;
  }
 else {
    searchComments=new ArrayList<>();
    for (    RedditCommentListItem comment : comments) {
      if (!comment.isComment())       continue;
      String commentStr=comment.asComment().getParsedComment().getRawComment().body;
      if (commentStr != null && commentStr.contains(mSearchString)) {
        searchComments.add(comment);
      }
    }
  }
  return Collections.<GroupedRecyclerViewAdapter.Item>unmodifiableCollection(searchComments);
}

Fixed version (ground truth):
private Collection<GroupedRecyclerViewAdapter.Item> filter(Collection<RedditCommentListItem> comments){
  Collection<RedditCommentListItem> searchComments;
  if (mSearchString == null) {
    searchComments=comments;
  }
 else {
    searchComments=new ArrayList<>();
    for (    RedditCommentListItem comment : comments) {
      if (!comment.isComment())       continue;
      String commentStr=comment.asComment().getParsedComment().getRawComment().body;
      if (commentStr != null) {
        commentStr=commentStr.toLowerCase();
        if (commentStr.contains(mSearchString)) {
          searchComments.add(comment);
        }
      }
    }
  }
  return Collections.<GroupedRecyclerViewAdapter.Item>unmodifiableCollection(searchComments);
}
Program: 15363
Project: 15363
Buggy source:
public void add(final K key,final V value){
  WeakReferenceListManager<V> list=mData.get(key);
  if (list == null) {
    list=new WeakReferenceListManager<>();
    mData.put(key,list);
  }
  list.add(value);
  if (++mCleanupCounter == 0) {
    clean();
  }
}

Fixed version (ground truth):
public synchronized void add(final K key,final V value){
  WeakReferenceListManager<V> list=mData.get(key);
  if (list == null) {
    list=new WeakReferenceListManager<>();
    mData.put(key,list);
  }
  list.add(value);
  if (++mCleanupCounter == 0) {
    clean();
  }
}
Program: 15364
Project: 15364
Buggy source:
public void clean(){
  final Iterator<Map.Entry<K,WeakReferenceListManager<V>>> iterator=mData.entrySet().iterator();
  while (iterator.hasNext()) {
    final Map.Entry<K,WeakReferenceListManager<V>> entry=iterator.next();
    final WeakReferenceListManager<V> list=entry.getValue();
    list.clean();
    if (list.isEmpty()) {
      iterator.remove();
    }
  }
}

Fixed version (ground truth):
public synchronized void clean(){
  final Iterator<Map.Entry<K,WeakReferenceListManager<V>>> iterator=mData.entrySet().iterator();
  while (iterator.hasNext()) {
    final Map.Entry<K,WeakReferenceListManager<V>> entry=iterator.next();
    final WeakReferenceListManager<V> list=entry.getValue();
    list.clean();
    if (list.isEmpty()) {
      iterator.remove();
    }
  }
}
Program: 15365
Project: 15365
Buggy source:
public <A>void map(final K key,final WeakReferenceListManager.ArgOperator<V,A> operator,final A arg){
  WeakReferenceListManager<V> list=mData.get(key);
  if (list != null) {
    list.map(operator,arg);
  }
}

Fixed version (ground truth):
public synchronized <A>void map(final K key,final WeakReferenceListManager.ArgOperator<V,A> operator,final A arg){
  WeakReferenceListManager<V> list=mData.get(key);
  if (list != null) {
    list.map(operator,arg);
  }
}
Program: 15366
Project: 15366
Buggy source:
public void remove(final K key,final V value){
  WeakReferenceListManager<V> list=mData.get(key);
  if (list != null) {
    list.remove(value);
  }
}

Fixed version (ground truth):
public synchronized void remove(final K key,final V value){
  WeakReferenceListManager<V> list=mData.get(key);
  if (list != null) {
    list.remove(value);
  }
}
Program: 15367
Project: 15367
Buggy source:
@Override public void onRedditDataChange(final String thingIdAndType){
  mListener.onCommentChanged(this);
}

Fixed version (ground truth):
@Override public void onRedditDataChange(final String thingIdAndType){
  HANDLER.dispatchMessage(Message.obtain(HANDLER,HANDLER_REQUEST_COMMENT_CHANGED,this));
}
Program: 15368
Project: 15368
Buggy source:
@Override protected void onFailure(final RequestFailureType type,Throwable t,StatusLine status,final String readableMessage){
  final RRError error=General.getGeneralErrorForFailure(context,type,t,status,url.toString());
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      mRequest=null;
      setMainView(new ErrorView(ImageViewActivity.this,error));
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onFailure(final RequestFailureType type,Throwable t,StatusLine status,final String readableMessage){
  final RRError error=General.getGeneralErrorForFailure(context,type,t,status,url.toString());
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      mRequest=null;
      final LinearLayout layout=new LinearLayout(context);
      layout.addView(new ErrorView(ImageViewActivity.this,error));
      setMainView(layout);
    }
  }
);
}
Program: 15373
Project: 15373
Buggy source:
@Override protected void onFailure(final APIFailureType type){
  final RRError error=General.getGeneralErrorForFailure(context,type);
  General.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      General.showResultDialog(CommentEditActivity.this,error);
      if (progressDialog.isShowing())       progressDialog.dismiss();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onFailure(final APIFailureType type){
  final RRError error=General.getGeneralErrorForFailure(context,type);
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      General.showResultDialog(CommentEditActivity.this,error);
      if (progressDialog.isShowing())       progressDialog.dismiss();
    }
  }
);
}
Program: 15375
Project: 15375
Buggy source:
@Override protected void onSuccess(){
  General.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      if (progressDialog.isShowing())       progressDialog.dismiss();
      General.quickToast(CommentEditActivity.this,R.string.comment_edit_done);
      finish();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onSuccess(){
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      if (progressDialog.isShowing())       progressDialog.dismiss();
      General.quickToast(CommentEditActivity.this,R.string.comment_edit_done);
      finish();
    }
  }
);
}
Program: 15376
Project: 15376
Buggy source:
@Override protected void onFailure(final APIFailureType type){
  final RRError error=General.getGeneralErrorForFailure(context,type);
  General.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      General.showResultDialog(CommentReplyActivity.this,error);
      if (progressDialog.isShowing())       progressDialog.dismiss();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onFailure(final APIFailureType type){
  final RRError error=General.getGeneralErrorForFailure(context,type);
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      General.showResultDialog(CommentReplyActivity.this,error);
      if (progressDialog.isShowing())       progressDialog.dismiss();
    }
  }
);
}
Program: 15378
Project: 15378
Buggy source:
@Override protected void onSuccess(){
  General.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      if (progressDialog.isShowing())       progressDialog.dismiss();
      General.quickToast(CommentReplyActivity.this,getString(R.string.comment_reply_done));
      finish();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onSuccess(){
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      if (progressDialog.isShowing())       progressDialog.dismiss();
      General.quickToast(CommentReplyActivity.this,getString(R.string.comment_reply_done));
      finish();
    }
  }
);
}
Program: 15379
Project: 15379
Buggy source:
@Override protected void onProgress(final boolean authorizationInProgress,final long bytesRead,final long totalBytes){
  General.UI_THREAD_HANDLER.post(new Runnable(){
    @Override public void run(){
      progressBar.setVisibility(View.VISIBLE);
      progressBar.setIndeterminate(authorizationInProgress);
      progressBar.setProgress((int)((100 * bytesRead) / totalBytes));
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onProgress(final boolean authorizationInProgress,final long bytesRead,final long totalBytes){
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    @Override public void run(){
      progressBar.setVisibility(View.VISIBLE);
      progressBar.setIndeterminate(authorizationInProgress);
      progressBar.setProgress((int)((100 * bytesRead) / totalBytes));
    }
  }
);
}
Program: 15380
Project: 15380
Buggy source:
@Override protected void onFailure(final RequestFailureType type,Throwable t,StatusLine status,final String readableMessage){
  final RRError error=General.getGeneralErrorForFailure(context,type,t,status,url.toString());
  General.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      mRequest=null;
      progressBar.setVisibility(View.GONE);
      layout.addView(new ErrorView(ImageViewActivity.this,error));
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onFailure(final RequestFailureType type,Throwable t,StatusLine status,final String readableMessage){
  final RRError error=General.getGeneralErrorForFailure(context,type,t,status,url.toString());
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      mRequest=null;
      progressBar.setVisibility(View.GONE);
      layout.addView(new ErrorView(ImageViewActivity.this,error));
    }
  }
);
}
Program: 15381
Project: 15381
Buggy source:
public void onGifLoaded(){
  General.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      if (mIsDestroyed)       return;
      mRequest=null;
      imageView=new ImageView(context);
      imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
      setContentView(imageView);
      gifThread.setView(imageView);
      imageView.setOnClickListener(new View.OnClickListener(){
        public void onClick(        View v){
          finish();
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
public void onGifLoaded(){
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      if (mIsDestroyed)       return;
      mRequest=null;
      imageView=new ImageView(context);
      imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
      setContentView(imageView);
      gifThread.setView(imageView);
      imageView.setOnClickListener(new View.OnClickListener(){
        public void onClick(        View v){
          finish();
        }
      }
);
    }
  }
);
}
Program: 15383
Project: 15383
Buggy source:
private void revertToWeb(){
  final Runnable r=new Runnable(){
    public void run(){
      if (!mHaveReverted) {
        mHaveReverted=true;
        LinkHandler.onLinkClicked(ImageViewActivity.this,mUrl.toString(),true);
        finish();
      }
    }
  }
;
  if (General.isThisUIThread()) {
    r.run();
  }
 else {
    General.UI_THREAD_HANDLER.post(r);
  }
}

Fixed version (ground truth):
private void revertToWeb(){
  final Runnable r=new Runnable(){
    public void run(){
      if (!mHaveReverted) {
        mHaveReverted=true;
        LinkHandler.onLinkClicked(ImageViewActivity.this,mUrl.toString(),true);
        finish();
      }
    }
  }
;
  if (General.isThisUIThread()) {
    r.run();
  }
 else {
    AndroidApi.UI_THREAD_HANDLER.post(r);
  }
}
Program: 15384
Project: 15384
Buggy source:
@Override protected void onDownloadNecessary(){
  General.UI_THREAD_HANDLER.post(new Runnable(){
    @Override public void run(){
      progressBar.setVisibility(View.VISIBLE);
      progressBar.setIndeterminate(true);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onDownloadNecessary(){
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    @Override public void run(){
      progressBar.setVisibility(View.VISIBLE);
      progressBar.setIndeterminate(true);
    }
  }
);
}
Program: 15386
Project: 15386
Buggy source:
@Override protected void onFailure(final APIFailureType type){
  final RRError error=General.getGeneralErrorForFailure(context,type);
  General.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      General.showResultDialog(InboxListingActivity.this,error);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onFailure(final APIFailureType type){
  final RRError error=General.getGeneralErrorForFailure(context,type);
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      General.showResultDialog(InboxListingActivity.this,error);
    }
  }
);
}
Program: 15388
Project: 15388
Buggy source:
@Override public boolean onOptionsItemSelected(final MenuItem item){
switch (item.getItemId()) {
case OPTIONS_MENU_MARK_ALL_AS_READ:
    RedditAPI.markAllAsRead(CacheManager.getInstance(this),new APIResponseHandler.ActionResponseHandler(this){
      @Override protected void onSuccess(){
        General.quickToast(context,R.string.mark_all_as_read_success);
      }
      @Override protected void onCallbackException(      final Throwable t){
        BugReportActivity.addGlobalError(new RRError("String_Node_Str","String_Node_Str",t));
      }
      @Override protected void onFailure(      final RequestFailureType type,      final Throwable t,      final StatusLine status,      final String readableMessage){
        final RRError error=General.getGeneralErrorForFailure(context,type,t,status,"String_Node_Str");
        General.UI_THREAD_HANDLER.post(new Runnable(){
          public void run(){
            General.showResultDialog(InboxListingActivity.this,error);
          }
        }
);
      }
      @Override protected void onFailure(      final APIFailureType type){
        final RRError error=General.getGeneralErrorForFailure(context,type);
        General.UI_THREAD_HANDLER.post(new Runnable(){
          public void run(){
            General.showResultDialog(InboxListingActivity.this,error);
          }
        }
);
      }
    }
,RedditAccountManager.getInstance(this).getDefaultAccount(),this);
  return true;
case android.R.id.home:
finish();
return true;
default :
return super.onOptionsItemSelected(item);
}
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(final MenuItem item){
switch (item.getItemId()) {
case OPTIONS_MENU_MARK_ALL_AS_READ:
    RedditAPI.markAllAsRead(CacheManager.getInstance(this),new APIResponseHandler.ActionResponseHandler(this){
      @Override protected void onSuccess(){
        General.quickToast(context,R.string.mark_all_as_read_success);
      }
      @Override protected void onCallbackException(      final Throwable t){
        BugReportActivity.addGlobalError(new RRError("String_Node_Str","String_Node_Str",t));
      }
      @Override protected void onFailure(      final RequestFailureType type,      final Throwable t,      final StatusLine status,      final String readableMessage){
        final RRError error=General.getGeneralErrorForFailure(context,type,t,status,"String_Node_Str");
        AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
          public void run(){
            General.showResultDialog(InboxListingActivity.this,error);
          }
        }
);
      }
      @Override protected void onFailure(      final APIFailureType type){
        final RRError error=General.getGeneralErrorForFailure(context,type);
        AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
          public void run(){
            General.showResultDialog(InboxListingActivity.this,error);
          }
        }
);
      }
    }
,RedditAccountManager.getInstance(this).getDefaultAccount(),this);
  return true;
case android.R.id.home:
finish();
return true;
default :
return super.onOptionsItemSelected(item);
}
}
Program: 15390
Project: 15390
Buggy source:
@Override protected void onFailure(final APIFailureType type){
  final RRError error=General.getGeneralErrorForFailure(context,type);
  General.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      General.showResultDialog(PostSubmitActivity.this,error);
      if (progressDialog.isShowing())       progressDialog.dismiss();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onFailure(final APIFailureType type){
  final RRError error=General.getGeneralErrorForFailure(context,type);
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      General.showResultDialog(PostSubmitActivity.this,error);
      if (progressDialog.isShowing())       progressDialog.dismiss();
    }
  }
);
}
Program: 15392
Project: 15392
Buggy source:
@Override protected void onSuccess(){
  General.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      if (progressDialog.isShowing())       progressDialog.dismiss();
      General.quickToast(PostSubmitActivity.this,getString(R.string.post_submit_done));
      finish();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onSuccess(){
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      if (progressDialog.isShowing())       progressDialog.dismiss();
      General.quickToast(PostSubmitActivity.this,getString(R.string.post_submit_done));
      finish();
    }
  }
);
}
Program: 15393
Project: 15393
Buggy source:
public void setSubreddits(final Collection<String> subscriptions){
  final ArrayList<String> subscriptionsSorted=new ArrayList<String>(subscriptions);
  Collections.sort(subscriptionsSorted);
  General.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      subredditItems.clear();
      for (      final String subreddit : subscriptionsSorted) {
        try {
          subredditItems.add(makeSubredditItem(RedditSubreddit.stripRPrefix(subreddit)));
        }
 catch (        RedditSubreddit.InvalidSubredditNameException e) {
          subredditItems.add(makeSubredditItem("String_Node_Str" + subreddit));
        }
      }
      notifyDataSetChanged();
    }
  }
);
}

Fixed version (ground truth):
public void setSubreddits(final Collection<String> subscriptions){
  final ArrayList<String> subscriptionsSorted=new ArrayList<String>(subscriptions);
  Collections.sort(subscriptionsSorted);
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      subredditItems.clear();
      for (      final String subreddit : subscriptionsSorted) {
        try {
          subredditItems.add(makeSubredditItem(RedditSubreddit.stripRPrefix(subreddit)));
        }
 catch (        RedditSubreddit.InvalidSubredditNameException e) {
          subredditItems.add(makeSubredditItem("String_Node_Str" + subreddit));
        }
      }
      notifyDataSetChanged();
    }
  }
);
}
Program: 15394
Project: 15394
Buggy source:
public static void showResultDialog(final Activity context,final RRError error){
  UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      final AlertDialog.Builder alertBuilder=new AlertDialog.Builder(context);
      alertBuilder.setNeutralButton(R.string.dialog_close,null);
      alertBuilder.setNegativeButton(R.string.button_moredetail,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int which){
          ErrorPropertiesDialog.newInstance(error).show(context.getFragmentManager(),"String_Node_Str");
        }
      }
);
      alertBuilder.setTitle(error.title);
      alertBuilder.setMessage(error.message);
      alertBuilder.create().show();
    }
  }
);
}

Fixed version (ground truth):
public static void showResultDialog(final Activity context,final RRError error){
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      final AlertDialog.Builder alertBuilder=new AlertDialog.Builder(context);
      alertBuilder.setNeutralButton(R.string.dialog_close,null);
      alertBuilder.setNegativeButton(R.string.button_moredetail,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int which){
          ErrorPropertiesDialog.newInstance(error).show(context.getFragmentManager(),"String_Node_Str");
        }
      }
);
      alertBuilder.setTitle(error.title);
      alertBuilder.setMessage(error.message);
      alertBuilder.create().show();
    }
  }
);
}
Program: 15395
Project: 15395
Buggy source:
public static void quickToast(final Context context,final String text,final int duration){
  UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      Toast.makeText(context,text,duration).show();
    }
  }
);
}

Fixed version (ground truth):
public static void quickToast(final Context context,final String text,final int duration){
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      Toast.makeText(context,text,duration).show();
    }
  }
);
}
Program: 15397
Project: 15397
Buggy source:
private RedditComment(final Parcel in){
  body=in.readString();
  body_html=in.readString();
  author=in.readString();
  subreddit=in.readString();
  author_flair_text=in.readString();
switch (in.readInt()) {
case -1:
    likes=false;
  break;
case 0:
likes=null;
break;
case 1:
likes=true;
break;
}
replies=null;
id=in.readString();
subreddit_id=in.readString();
link_id=in.readString();
parent_id=in.readString();
name=in.readString();
context=in.readString();
ups=in.readInt();
downs=in.readInt();
final long in_edited=in.readLong();
if (in_edited == -1) {
edited=false;
}
 else {
edited=in_edited;
}
created=in.readLong();
created_utc=in.readLong();
saved=in.readInt() != 0;
gilded=in.readInt();
}

Fixed version (ground truth):
private RedditComment(final Parcel in){
  body=in.readString();
  body_html=in.readString();
  author=in.readString();
  subreddit=in.readString();
  author_flair_text=in.readString();
  archived=in.readInt() == 1;
switch (in.readInt()) {
case -1:
    likes=false;
  break;
case 0:
likes=null;
break;
case 1:
likes=true;
break;
}
replies=null;
id=in.readString();
subreddit_id=in.readString();
link_id=in.readString();
parent_id=in.readString();
name=in.readString();
context=in.readString();
ups=in.readInt();
downs=in.readInt();
final long in_edited=in.readLong();
if (in_edited == -1) {
edited=false;
}
 else {
edited=in_edited;
}
created=in.readLong();
created_utc=in.readLong();
saved=in.readInt() != 0;
gilded=in.readInt();
}
Program: 15398
Project: 15398
Buggy source:
public void writeToParcel(final Parcel parcel,final int flags){
  parcel.writeString(body);
  parcel.writeString(body_html);
  parcel.writeString(author);
  parcel.writeString(subreddit);
  parcel.writeString(author_flair_text);
  if (likes == null) {
    parcel.writeInt(0);
  }
 else {
    parcel.writeInt(likes ? 1 : -1);
  }
  parcel.writeString(id);
  parcel.writeString(subreddit_id);
  parcel.writeString(link_id);
  parcel.writeString(parent_id);
  parcel.writeString(name);
  parcel.writeString(context);
  parcel.writeInt(ups);
  parcel.writeInt(downs);
  if (edited instanceof Long) {
    parcel.writeLong((Long)edited);
  }
 else {
    parcel.writeLong(-1);
  }
  parcel.writeLong(created);
  parcel.writeLong(created_utc);
  parcel.writeInt(saved ? 1 : 0);
  parcel.writeInt(gilded);
}

Fixed version (ground truth):
public void writeToParcel(final Parcel parcel,final int flags){
  parcel.writeString(body);
  parcel.writeString(body_html);
  parcel.writeString(author);
  parcel.writeString(subreddit);
  parcel.writeString(author_flair_text);
  parcel.writeInt(archived ? 1 : 0);
  if (likes == null) {
    parcel.writeInt(0);
  }
 else {
    parcel.writeInt(likes ? 1 : -1);
  }
  parcel.writeString(id);
  parcel.writeString(subreddit_id);
  parcel.writeString(link_id);
  parcel.writeString(parent_id);
  parcel.writeString(name);
  parcel.writeString(context);
  parcel.writeInt(ups);
  parcel.writeInt(downs);
  if (edited instanceof Long) {
    parcel.writeLong((Long)edited);
  }
 else {
    parcel.writeLong(-1);
  }
  parcel.writeLong(created);
  parcel.writeLong(created_utc);
  parcel.writeInt(saved ? 1 : 0);
  parcel.writeInt(gilded);
}
Program: 15399
Project: 15399
Buggy source:
public void writeToParcel(final Parcel parcel,final int flags){
  parcel.writeString(id);
  parcel.writeString(name);
  parcel.writeString(title);
  parcel.writeString(url);
  parcel.writeString(author);
  parcel.writeString(domain);
  parcel.writeString(subreddit);
  parcel.writeString(subreddit_id);
  parcel.writeInt(num_comments);
  parcel.writeInt(score);
  parcel.writeInt(ups);
  parcel.writeInt(downs);
  parcel.writeInt(over_18 ? 1 : 0);
  parcel.writeInt(hidden ? 1 : 0);
  parcel.writeInt(saved ? 1 : 0);
  parcel.writeInt(is_self ? 1 : 0);
  parcel.writeInt(clicked ? 1 : 0);
  parcel.writeInt(stickied ? 1 : 0);
  if (edited instanceof Long) {
    parcel.writeLong((Long)edited);
  }
 else {
    parcel.writeLong(-1);
  }
  if (likes == null) {
    parcel.writeInt(0);
  }
 else {
    parcel.writeInt(likes ? 1 : -1);
  }
  parcel.writeLong(created);
  parcel.writeLong(created_utc);
  parcel.writeString(selftext);
  parcel.writeString(permalink);
  parcel.writeString(link_flair_text);
  parcel.writeString(author_flair_text);
  parcel.writeString(thumbnail);
}

Fixed version (ground truth):
public void writeToParcel(final Parcel parcel,final int flags){
  parcel.writeString(id);
  parcel.writeString(name);
  parcel.writeString(title);
  parcel.writeString(url);
  parcel.writeString(author);
  parcel.writeString(domain);
  parcel.writeString(subreddit);
  parcel.writeString(subreddit_id);
  parcel.writeInt(num_comments);
  parcel.writeInt(score);
  parcel.writeInt(ups);
  parcel.writeInt(downs);
  parcel.writeInt(archived ? 1 : 0);
  parcel.writeInt(over_18 ? 1 : 0);
  parcel.writeInt(hidden ? 1 : 0);
  parcel.writeInt(saved ? 1 : 0);
  parcel.writeInt(is_self ? 1 : 0);
  parcel.writeInt(clicked ? 1 : 0);
  parcel.writeInt(stickied ? 1 : 0);
  if (edited instanceof Long) {
    parcel.writeLong((Long)edited);
  }
 else {
    parcel.writeLong(-1);
  }
  if (likes == null) {
    parcel.writeInt(0);
  }
 else {
    parcel.writeInt(likes ? 1 : -1);
  }
  parcel.writeLong(created);
  parcel.writeLong(created_utc);
  parcel.writeString(selftext);
  parcel.writeString(permalink);
  parcel.writeString(link_flair_text);
  parcel.writeString(author_flair_text);
  parcel.writeString(thumbnail);
}
Program: 15400
Project: 15400
Buggy source:
private RedditPost(final Parcel in){
  id=in.readString();
  name=in.readString();
  title=in.readString();
  url=in.readString();
  author=in.readString();
  domain=in.readString();
  subreddit=in.readString();
  subreddit_id=in.readString();
  num_comments=in.readInt();
  score=in.readInt();
  ups=in.readInt();
  downs=in.readInt();
  over_18=in.readInt() == 1;
  hidden=in.readInt() == 1;
  saved=in.readInt() == 1;
  is_self=in.readInt() == 1;
  clicked=in.readInt() == 1;
  stickied=in.readInt() == 1;
  final long in_edited=in.readLong();
  if (in_edited == -1) {
    edited=false;
  }
 else {
    edited=in_edited;
  }
switch (in.readInt()) {
case -1:
    likes=false;
  break;
case 0:
likes=null;
break;
case 1:
likes=true;
break;
}
created=in.readLong();
created_utc=in.readLong();
selftext=in.readString();
permalink=in.readString();
link_flair_text=in.readString();
author_flair_text=in.readString();
thumbnail=in.readString();
}

Fixed version (ground truth):
private RedditPost(final Parcel in){
  id=in.readString();
  name=in.readString();
  title=in.readString();
  url=in.readString();
  author=in.readString();
  domain=in.readString();
  subreddit=in.readString();
  subreddit_id=in.readString();
  num_comments=in.readInt();
  score=in.readInt();
  ups=in.readInt();
  downs=in.readInt();
  archived=in.readInt() == 1;
  over_18=in.readInt() == 1;
  hidden=in.readInt() == 1;
  saved=in.readInt() == 1;
  is_self=in.readInt() == 1;
  clicked=in.readInt() == 1;
  stickied=in.readInt() == 1;
  final long in_edited=in.readLong();
  if (in_edited == -1) {
    edited=false;
  }
 else {
    edited=in_edited;
  }
switch (in.readInt()) {
case -1:
    likes=false;
  break;
case 0:
likes=null;
break;
case 1:
likes=true;
break;
}
created=in.readLong();
created_utc=in.readLong();
selftext=in.readString();
permalink=in.readString();
link_flair_text=in.readString();
author_flair_text=in.readString();
thumbnail=in.readString();
}
Program: 15404
Project: 15404
Buggy source:
@Override public synchronized void onFingerUp(FingerTracker.Finger finger){
  mScaleAnimation=null;
  mScrollbars.showBars();
  if (mSpareFingers.remove(finger)) {
    return;
  }
switch (mCurrentTouchState) {
case DOUBLE_TAP_ONE_FINGER_DOWN:
    if (finger.mDownDuration < TAP_MAX_DURATION_MS) {
      onDoubleTap(finger.mCurrentPos);
    }
  mCurrentTouchState=null;
mDragFinger=null;
break;
case ONE_FINGER_DOWN:
if (finger.mDownDuration < TAP_MAX_DURATION_MS) {
mDoubleTapGapTimer.startTimer();
mCurrentTouchState=TouchState.DOUBLE_TAP_WAIT_NO_FINGERS_DOWN;
mFirstTapReleaseTime=System.currentTimeMillis();
}
 else {
mCurrentTouchState=null;
}
mDragFinger=null;
break;
case ONE_FINGER_DRAG:
case DOUBLE_TAP_ONE_FINGER_DRAG:
if (mSpareFingers.isEmpty()) {
mCurrentTouchState=null;
mDragFinger=null;
}
 else {
mDragFinger=mSpareFingers.pop();
}
break;
case TWO_FINGER_PINCH:
if (mSpareFingers.isEmpty()) {
mCurrentTouchState=TouchState.ONE_FINGER_DRAG;
mDragFinger=(mPinchFinger1 == finger) ? mPinchFinger2 : mPinchFinger1;
mPinchFinger1=null;
mPinchFinger2=null;
}
 else {
if (mPinchFinger1 == finger) {
mPinchFinger1=mSpareFingers.pop();
}
 else {
mPinchFinger2=mSpareFingers.pop();
}
}
break;
}
}

Fixed version (ground truth):
@Override public synchronized void onFingerUp(FingerTracker.Finger finger){
  if (mScrollbars == null) {
    return;
  }
  mScaleAnimation=null;
  mScrollbars.showBars();
  if (mSpareFingers.remove(finger)) {
    return;
  }
switch (mCurrentTouchState) {
case DOUBLE_TAP_ONE_FINGER_DOWN:
    if (finger.mDownDuration < TAP_MAX_DURATION_MS) {
      onDoubleTap(finger.mCurrentPos);
    }
  mCurrentTouchState=null;
mDragFinger=null;
break;
case ONE_FINGER_DOWN:
if (finger.mDownDuration < TAP_MAX_DURATION_MS) {
mDoubleTapGapTimer.startTimer();
mCurrentTouchState=TouchState.DOUBLE_TAP_WAIT_NO_FINGERS_DOWN;
mFirstTapReleaseTime=System.currentTimeMillis();
}
 else {
mCurrentTouchState=null;
}
mDragFinger=null;
break;
case ONE_FINGER_DRAG:
case DOUBLE_TAP_ONE_FINGER_DRAG:
if (mSpareFingers.isEmpty()) {
mCurrentTouchState=null;
mDragFinger=null;
}
 else {
mDragFinger=mSpareFingers.pop();
}
break;
case TWO_FINGER_PINCH:
if (mSpareFingers.isEmpty()) {
mCurrentTouchState=TouchState.ONE_FINGER_DRAG;
mDragFinger=(mPinchFinger1 == finger) ? mPinchFinger2 : mPinchFinger1;
mPinchFinger1=null;
mPinchFinger2=null;
}
 else {
if (mPinchFinger1 == finger) {
mPinchFinger1=mSpareFingers.pop();
}
 else {
mPinchFinger2=mSpareFingers.pop();
}
}
break;
}
}
Program: 15405
Project: 15405
Buggy source:
@Override public synchronized void onFingerDown(FingerTracker.Finger finger){
  mScaleAnimation=null;
  mScrollbars.showBars();
  if (mCurrentTouchState == null) {
    mCurrentTouchState=TouchState.ONE_FINGER_DOWN;
    mDragFinger=finger;
  }
 else {
switch (mCurrentTouchState) {
case DOUBLE_TAP_WAIT_NO_FINGERS_DOWN:
      mCurrentTouchState=TouchState.DOUBLE_TAP_ONE_FINGER_DOWN;
    mDragFinger=finger;
  mDoubleTapGapTimer.stopTimer();
break;
case ONE_FINGER_DOWN:
case ONE_FINGER_DRAG:
case DOUBLE_TAP_ONE_FINGER_DOWN:
case DOUBLE_TAP_ONE_FINGER_DRAG:
mCurrentTouchState=TouchState.TWO_FINGER_PINCH;
mPinchFinger1=mDragFinger;
mPinchFinger2=finger;
mDragFinger=null;
break;
default :
mSpareFingers.push(finger);
break;
}
}
}

Fixed version (ground truth):
@Override public synchronized void onFingerDown(FingerTracker.Finger finger){
  if (mScrollbars == null) {
    return;
  }
  mScaleAnimation=null;
  mScrollbars.showBars();
  if (mCurrentTouchState == null) {
    mCurrentTouchState=TouchState.ONE_FINGER_DOWN;
    mDragFinger=finger;
  }
 else {
switch (mCurrentTouchState) {
case DOUBLE_TAP_WAIT_NO_FINGERS_DOWN:
      mCurrentTouchState=TouchState.DOUBLE_TAP_ONE_FINGER_DOWN;
    mDragFinger=finger;
  mDoubleTapGapTimer.stopTimer();
break;
case ONE_FINGER_DOWN:
case ONE_FINGER_DRAG:
case DOUBLE_TAP_ONE_FINGER_DOWN:
case DOUBLE_TAP_ONE_FINGER_DRAG:
mCurrentTouchState=TouchState.TWO_FINGER_PINCH;
mPinchFinger1=mDragFinger;
mPinchFinger2=finger;
mDragFinger=null;
break;
default :
mSpareFingers.push(finger);
break;
}
}
}
Program: 15406
Project: 15406
Buggy source:
public void reset(final RedditPreparedPost data){
  if (post == data) {
    return;
  }
  usageId++;
  super.reset();
  if (post != null)   post.unbind(this);
  data.bind(this);
  swipeReady=false;
  leftOverlayShown=false;
  rightOverlayShown=false;
  leftOverlayText.setVisibility(GONE);
  rightOverlayText.setVisibility(GONE);
  this.post=data;
  final Bitmap thumbnail=data.getThumbnail(this,usageId);
  thumbnailView.setImageBitmap(thumbnail);
  title.setText(data.title);
  commentsText.setText(String.valueOf(post.commentCount));
  if (data.hasThumbnail) {
    thumbnailView.setVisibility(VISIBLE);
    thumbnailView.setMinimumWidth((int)(64.0f * dpScale));
    thumbnailView.getLayoutParams().height=ViewGroup.LayoutParams.MATCH_PARENT;
  }
 else {
    thumbnailView.setMinimumWidth(0);
    thumbnailView.setVisibility(GONE);
  }
  updateAppearance();
}

Fixed version (ground truth):
public void reset(final RedditPreparedPost data){
  usageId++;
  super.reset();
  if (post != null)   post.unbind(this);
  data.bind(this);
  swipeReady=false;
  leftOverlayShown=false;
  rightOverlayShown=false;
  leftOverlayText.setVisibility(GONE);
  rightOverlayText.setVisibility(GONE);
  this.post=data;
  final Bitmap thumbnail=data.getThumbnail(this,usageId);
  thumbnailView.setImageBitmap(thumbnail);
  title.setText(data.title);
  commentsText.setText(String.valueOf(post.commentCount));
  if (data.hasThumbnail) {
    thumbnailView.setVisibility(VISIBLE);
    thumbnailView.setMinimumWidth((int)(64.0f * dpScale));
    thumbnailView.getLayoutParams().height=ViewGroup.LayoutParams.MATCH_PARENT;
  }
 else {
    thumbnailView.setMinimumWidth(0);
    thumbnailView.setVisibility(GONE);
  }
  updateAppearance();
}
Program: 15407
Project: 15407
Buggy source:
public void markAsRead(final Context context){
  setRead(true);
  final RedditAccount user=RedditAccountManager.getInstance(context).getDefaultAccount();
  RedditChangeDataManager.getInstance(context).update("String_Node_Str",user,RedditPreparedPost.this,true);
}

Fixed version (ground truth):
public void markAsRead(final Context context){
  setRead(true);
  refreshView(context);
  final RedditAccount user=RedditAccountManager.getInstance(context).getDefaultAccount();
  RedditChangeDataManager.getInstance(context).update("String_Node_Str",user,RedditPreparedPost.this,true);
}
Program: 15408
Project: 15408
Buggy source:
@Override public void handleMessage(final Message msg){
  if (usageId != msg.what)   return;
  thumbnailView.setImageBitmap((Bitmap)msg.obj);
  invalidate();
}

Fixed version (ground truth):
@Override public void handleMessage(final Message msg){
  if (usageId != msg.what)   return;
  thumbnailView.setImageBitmap((Bitmap)msg.obj);
  invalidate();
  mListView.invalidateViews();
}
Program: 15411
Project: 15411
Buggy source:
public void reset(final Activity activity,final RedditPreparedComment comment,final int indent){
  if (comment == mComment) {
    return;
  }
  if (mComment != null)   mComment.unbind(this);
  mComment=comment;
  comment.bind(this);
  mIndentView.setIndentation(indent);
  if (!comment.isCollapsed()) {
    mHeader.setText(comment.header);
  }
 else {
    mHeader.setText("String_Node_Str" + comment.header);
  }
  final boolean hideLinkButtons=comment.src.author.equalsIgnoreCase("String_Node_Str");
  mBodyHolder.removeAllViews();
  final ViewGroup commentBody=comment.getBody(activity,13.0f * mFontScale,mBodyCol,mShowLinkButtons && !hideLinkButtons);
  mBodyHolder.addView(commentBody);
  commentBody.getLayoutParams().width=ViewGroup.LayoutParams.MATCH_PARENT;
  ((MarginLayoutParams)commentBody.getLayoutParams()).topMargin=General.dpToPixels(activity,1);
  updateVisibility(activity);
}

Fixed version (ground truth):
public void reset(final Activity activity,final RedditPreparedComment comment,final int indent){
  if (comment == mComment) {
    comment.bind(this);
    return;
  }
  if (mComment != null) {
    mComment.unbind(this);
  }
  mComment=comment;
  comment.bind(this);
  mIndentView.setIndentation(indent);
  if (!comment.isCollapsed()) {
    mHeader.setText(comment.header);
  }
 else {
    mHeader.setText("String_Node_Str" + comment.header);
  }
  final boolean hideLinkButtons=comment.src.author.equalsIgnoreCase("String_Node_Str");
  mBodyHolder.removeAllViews();
  final ViewGroup commentBody=comment.getBody(activity,13.0f * mFontScale,mBodyCol,mShowLinkButtons && !hideLinkButtons);
  mBodyHolder.addView(commentBody);
  commentBody.getLayoutParams().width=ViewGroup.LayoutParams.MATCH_PARENT;
  ((MarginLayoutParams)commentBody.getLayoutParams()).topMargin=General.dpToPixels(activity,1);
  updateVisibility(activity);
}
Program: 15412
Project: 15412
Buggy source:
public PostCommentListingURL commentId(String commentId){
  if (commentId.startsWith("String_Node_Str")) {
    commentId=commentId.substring(3);
  }
  return new PostCommentListingURL(after,postId,commentId,context,limit,order);
}

Fixed version (ground truth):
public PostCommentListingURL commentId(String commentId){
  if (commentId != null && commentId.startsWith("String_Node_Str")) {
    commentId=commentId.substring(3);
  }
  return new PostCommentListingURL(after,postId,commentId,context,limit,order);
}
Program: 15413
Project: 15413
Buggy source:
@Override protected void prepare(Activity context,LinearLayout items){
  final RedditComment comment=getArguments().getParcelable("String_Node_Str");
  items.addView(propView(context,R.string.props_author,comment.author,false));
  if (comment.author_flair_text != null && comment.author_flair_text.length() > 0) {
    items.addView(propView(context,R.string.props_author_flair,comment.author_flair_text,false));
  }
  items.addView(propView(context,R.string.props_created,RRTime.formatDateTime(comment.created_utc * 1000,context),false));
  if (comment.edited instanceof Long) {
    items.addView(propView(context,R.string.props_edited,RRTime.formatDateTime((Long)comment.edited * 1000,context),false));
  }
 else {
    items.addView(propView(context,R.string.props_edited,R.string.props_never,false));
  }
  items.addView(propView(context,R.string.props_score,String.valueOf(comment.ups - comment.downs),false));
  items.addView(propView(context,R.string.props_subreddit,comment.subreddit,false));
  if (comment.body != null && comment.body.length() > 0) {
    items.addView(propView(context,R.string.props_body_markdown,StringEscapeUtils.unescapeHtml4(comment.body),false));
  }
}

Fixed version (ground truth):
@Override protected void prepare(Activity context,LinearLayout items){
  final RedditComment comment=getArguments().getParcelable("String_Node_Str");
  items.addView(propView(context,"String_Node_Str",comment.name,false));
  items.addView(propView(context,R.string.props_author,comment.author,false));
  if (comment.author_flair_text != null && comment.author_flair_text.length() > 0) {
    items.addView(propView(context,R.string.props_author_flair,comment.author_flair_text,false));
  }
  items.addView(propView(context,R.string.props_created,RRTime.formatDateTime(comment.created_utc * 1000,context),false));
  if (comment.edited instanceof Long) {
    items.addView(propView(context,R.string.props_edited,RRTime.formatDateTime((Long)comment.edited * 1000,context),false));
  }
 else {
    items.addView(propView(context,R.string.props_edited,R.string.props_never,false));
  }
  items.addView(propView(context,R.string.props_score,String.valueOf(comment.ups - comment.downs),false));
  items.addView(propView(context,R.string.props_subreddit,comment.subreddit,false));
  if (comment.body != null && comment.body.length() > 0) {
    items.addView(propView(context,R.string.props_body_markdown,StringEscapeUtils.unescapeHtml4(comment.body),false));
  }
}
Program: 15414
Project: 15414
Buggy source:
public List<PostCommentListingURL> getMoreUrls(){
  final ArrayList<PostCommentListingURL> urls=new ArrayList<PostCommentListingURL>(16);
  for (  JsonValue child : mSrc.children) {
    if (child.getType() == JsonValue.Type.STRING) {
      urls.add(mPostUrl.commentId(child.asString()));
    }
  }
  return urls;
}

Fixed version (ground truth):
public List<PostCommentListingURL> getMoreUrls(){
  final ArrayList<PostCommentListingURL> urls=new ArrayList<PostCommentListingURL>(16);
  if (mSrc.count > 0) {
    for (    JsonValue child : mSrc.children) {
      if (child.getType() == JsonValue.Type.STRING) {
        urls.add(mPostUrl.commentId(child.asString()));
      }
    }
  }
 else {
    urls.add(mPostUrl.commentId(mSrc.parent_id));
  }
  return urls;
}