nus-yam/ex-repair huggingface dataset:
Program: 14757
Project: 14757
Buggy source:
@Override public void onSuccess(){
  if (statsActivityWeakRef.get() == null || statsActivityWeakRef.get().isFinishing() || !statsActivityWeakRef.get().mIsInFront) {
    return;
  }
  if (getBlogId() == null) {
    stopStatsService();
    AlertDialog.Builder builder=new AlertDialog.Builder(this.statsActivityWeakRef.get());
    if (WordPress.getCurrentBlog().isAdmin()) {
      builder.setMessage(getString(R.string.jetpack_message)).setTitle(getString(R.string.jetpack_not_found));
      builder.setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int id){
          Intent jetpackIntent=new Intent(VerifyJetpackSettingsCallback.this.statsActivityWeakRef.get(),AuthenticatedWebViewActivity.class);
          jetpackIntent.putExtra(AuthenticatedWebViewActivity.LOAD_AUTHENTICATED_URL,WordPress.getCurrentBlog().getAdminUrl() + "String_Node_Str");
          startActivityForResult(jetpackIntent,REQUEST_JETPACK);
        }
      }
);
      builder.setNegativeButton(R.string.no,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int id){
        }
      }
);
    }
 else {
      builder.setMessage(getString(R.string.jetpack_message_not_admin)).setTitle(getString(R.string.jetpack_not_found));
      builder.setPositiveButton(R.string.yes,null);
    }
    builder.create().show();
  }
}

Fixed version (ground truth):
@Override public void onSuccess(){
  if (statsActivityWeakRef.get() == null || statsActivityWeakRef.get().isFinishing() || !statsActivityWeakRef.get().mIsInFront) {
    return;
  }
  if (getBlogId() == null) {
    stopStatsService();
    mPullToRefreshHelper.setRefreshing(false);
    AlertDialog.Builder builder=new AlertDialog.Builder(this.statsActivityWeakRef.get());
    if (WordPress.getCurrentBlog().isAdmin()) {
      builder.setMessage(getString(R.string.jetpack_message)).setTitle(getString(R.string.jetpack_not_found));
      builder.setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int id){
          Intent jetpackIntent=new Intent(VerifyJetpackSettingsCallback.this.statsActivityWeakRef.get(),AuthenticatedWebViewActivity.class);
          jetpackIntent.putExtra(AuthenticatedWebViewActivity.LOAD_AUTHENTICATED_URL,WordPress.getCurrentBlog().getAdminUrl() + "String_Node_Str");
          startActivityForResult(jetpackIntent,REQUEST_JETPACK);
        }
      }
);
      builder.setNegativeButton(R.string.no,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int id){
        }
      }
);
    }
 else {
      builder.setMessage(getString(R.string.jetpack_message_not_admin)).setTitle(getString(R.string.jetpack_not_found));
      builder.setPositiveButton(R.string.yes,null);
    }
    builder.create().show();
  }
}
Program: 14758
Project: 14758
Buggy source:
@Override public void onDestroy(){
  for (  Request<JSONObject> req : statsNetworkRequests) {
    if (!req.hasHadResponseDelivered() && !req.isCanceled()) {
      req.cancel();
    }
  }
  if (orchestrator != null) {
    orchestrator.interrupt();
  }
  AppLog.i(T.STATS,"String_Node_Str");
  super.onDestroy();
}

Fixed version (ground truth):
@Override public void onDestroy(){
  stopRefresh();
  AppLog.i(T.STATS,"String_Node_Str");
  super.onDestroy();
}
Program: 14759
Project: 14759
Buggy source:
@Override public int onStartCommand(Intent intent,int flags,int startId){
  final String blogId=StringUtils.notNullStr(intent.getStringExtra(ARG_BLOG_ID));
  this.mBlogId=blogId;
  startTasks(blogId,startId);
  return START_NOT_STICKY;
}

Fixed version (ground truth):
@Override public int onStartCommand(Intent intent,int flags,int startId){
  final String blogId=StringUtils.notNullStr(intent.getStringExtra(ARG_BLOG_ID));
  if (mBlogId == null) {
    startTasks(blogId,startId);
  }
 else   if (blogId.equals(mBlogId)) {
    AppLog.i(T.STATS,"String_Node_Str" + mBlogId);
  }
 else {
    stopRefresh();
    startTasks(blogId,startId);
  }
  this.mBlogId=blogId;
  return START_NOT_STICKY;
}
Program: 14760
Project: 14760
Buggy source:
@Override public void onResponse(final JSONObject jsonObject){
  updateUIExecutor.submit(new Thread(){
    @Override public void run(){
      AppLog.d(T.STATS,"String_Node_Str");
      numberOfFinishedNetworkCalls++;
      try {
        if (jsonObject == null)         return;
        StatUtils.saveSummary(mBlogId,jsonObject);
        StatsSummary stats=StatUtils.getSummary(mBlogId);
        if (stats != null) {
          LocalBroadcastManager lbm=LocalBroadcastManager.getInstance(WordPress.getContext());
          Intent intent=new Intent(StatsService.ACTION_STATS_SUMMARY_UPDATED);
          intent.putExtra(StatsService.STATS_SUMMARY_UPDATED_EXTRA,stats);
          lbm.sendBroadcast(intent);
        }
      }
  finally {
        notifyResponseReceived();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void onResponse(final JSONObject jsonObject){
  if (!updateUIExecutor.isShutdown() && !updateUIExecutor.isTerminated() && !updateUIExecutor.isTerminating())   updateUIExecutor.submit(new Thread(){
    @Override public void run(){
      AppLog.d(T.STATS,"String_Node_Str");
      numberOfFinishedNetworkCalls++;
      try {
        if (jsonObject == null)         return;
        StatUtils.saveSummary(mBlogId,jsonObject);
        StatsSummary stats=StatUtils.getSummary(mBlogId);
        if (stats != null) {
          LocalBroadcastManager lbm=LocalBroadcastManager.getInstance(WordPress.getContext());
          Intent intent=new Intent(StatsService.ACTION_STATS_SUMMARY_UPDATED);
          intent.putExtra(StatsService.STATS_SUMMARY_UPDATED_EXTRA,stats);
          lbm.sendBroadcast(intent);
        }
      }
  finally {
        notifyResponseReceived();
      }
    }
  }
);
}
Program: 14762
Project: 14762
Buggy source:
@Override public void onErrorResponse(final VolleyError volleyError){
  updateUIExecutor.submit(new Thread(){
    @Override public void run(){
      numberOfFinishedNetworkCalls++;
      if (volleyError != null) {
        AppLog.e(T.STATS,"String_Node_Str" + volleyError.getMessage(),volleyError);
      }
      notifyResponseReceived();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onErrorResponse(final VolleyError volleyError){
  if (!updateUIExecutor.isShutdown() && !updateUIExecutor.isTerminated() && !updateUIExecutor.isTerminating())   updateUIExecutor.submit(new Thread(){
    @Override public void run(){
      numberOfFinishedNetworkCalls++;
      if (volleyError != null) {
        AppLog.e(T.STATS,"String_Node_Str" + volleyError.getMessage(),volleyError);
      }
      notifyResponseReceived();
    }
  }
);
}
Program: 14764
Project: 14764
Buggy source:
/** 
 * This method is called when the user changes the active blog or hides all blogs
 */
public void onBlogChanged(){
  WordPress.wpDB.updateLastBlogId(WordPress.getCurrentLocalTableBlogId());
  Iterator<MenuDrawerItem> itemIterator=mMenuItems.iterator();
  while (itemIterator.hasNext()) {
    MenuDrawerItem item=itemIterator.next();
    if (item.isSelected() && !item.isVisible()) {
      if (mAdapter.getCount() > 0) {
        mAdapter.getItem(0).selectItem();
      }
      if (item.hasItemId()) {
        SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(WPActionBarActivity.this);
        SharedPreferences.Editor editor=settings.edit();
        editor.putInt(LAST_ACTIVITY_PREFERENCE,item.getItemId());
        editor.commit();
      }
      break;
    }
  }
}

Fixed version (ground truth):
/** 
 * This method is called when the user changes the active blog or hides all blogs
 */
public void onBlogChanged(){
  WordPress.wpDB.updateLastBlogId(WordPress.getCurrentLocalTableBlogId());
  Iterator<MenuDrawerItem> itemIterator=mMenuItems.iterator();
  while (itemIterator.hasNext()) {
    MenuDrawerItem item=itemIterator.next();
    if (item.isSelected() && !item.isVisible()) {
      if (mAdapter.getCount() > 0) {
        mAdapter.getItem(0).selectItem();
      }
      if (item.hasItemId()) {
        SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(WPActionBarActivity.this);
        SharedPreferences.Editor editor=settings.edit();
        editor.putInt(LAST_ACTIVITY_PREFERENCE,item.getItemId());
        editor.commit();
      }
      break;
    }
  }
  if (shouldUpdateCurrentBlogStats()) {
    WordPress.updateCurrentBlogStats();
  }
}
Program: 14765
Project: 14765
Buggy source:
@Override public void onFailure(ApiHelper.ErrorType errorType,String errorMessage,Throwable throwable){
}

Fixed version (ground truth):
@Override public void onFailure(ApiHelper.ErrorType errorType,String errorMessage,Throwable throwable){
  mPullToRefreshHelper.setRefreshing(false);
  if (statsActivityWeakRef.get() == null || statsActivityWeakRef.get().isFinishing() || !statsActivityWeakRef.get().mIsInFront) {
    return;
  }
  if (mSignInDialog != null && mSignInDialog.isShowing()) {
    return;
  }
  stopStatsService();
  Toast.makeText(statsActivityWeakRef.get(),R.string.error_refresh_stats,Toast.LENGTH_LONG).show();
}
Program: 14766
Project: 14766
Buggy source:
@Override public void onSuccess(){
  if (statsActivityWeakRef.get() == null || statsActivityWeakRef.get().isFinishing() || !statsActivityWeakRef.get().mIsInFront) {
    return;
  }
  if (getBlogId() == null) {
    stopStatsService();
    AlertDialog.Builder builder=new AlertDialog.Builder(this.statsActivityWeakRef.get());
    if (WordPress.getCurrentBlog().isAdmin()) {
      builder.setMessage(getString(R.string.jetpack_message)).setTitle(getString(R.string.jetpack_not_found));
      builder.setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int id){
          Intent jetpackIntent=new Intent(VerifyJetpackSettingsCallback.this.statsActivityWeakRef.get(),AuthenticatedWebViewActivity.class);
          jetpackIntent.putExtra(AuthenticatedWebViewActivity.LOAD_AUTHENTICATED_URL,WordPress.getCurrentBlog().getAdminUrl() + "String_Node_Str");
          startActivityForResult(jetpackIntent,REQUEST_JETPACK);
        }
      }
);
      builder.setNegativeButton(R.string.no,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int id){
        }
      }
);
    }
 else {
      builder.setMessage(getString(R.string.jetpack_message_not_admin)).setTitle(getString(R.string.jetpack_not_found));
      builder.setPositiveButton(R.string.yes,null);
    }
    builder.create().show();
  }
}

Fixed version (ground truth):
@Override public void onSuccess(){
  if (statsActivityWeakRef.get() == null || statsActivityWeakRef.get().isFinishing() || !statsActivityWeakRef.get().mIsInFront) {
    return;
  }
  if (getBlogId() == null) {
    stopStatsService();
    mPullToRefreshHelper.setRefreshing(false);
    AlertDialog.Builder builder=new AlertDialog.Builder(this.statsActivityWeakRef.get());
    if (WordPress.getCurrentBlog().isAdmin()) {
      builder.setMessage(getString(R.string.jetpack_message)).setTitle(getString(R.string.jetpack_not_found));
      builder.setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int id){
          Intent jetpackIntent=new Intent(VerifyJetpackSettingsCallback.this.statsActivityWeakRef.get(),AuthenticatedWebViewActivity.class);
          jetpackIntent.putExtra(AuthenticatedWebViewActivity.LOAD_AUTHENTICATED_URL,WordPress.getCurrentBlog().getAdminUrl() + "String_Node_Str");
          startActivityForResult(jetpackIntent,REQUEST_JETPACK);
        }
      }
);
      builder.setNegativeButton(R.string.no,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int id){
        }
      }
);
    }
 else {
      builder.setMessage(getString(R.string.jetpack_message_not_admin)).setTitle(getString(R.string.jetpack_not_found));
      builder.setPositiveButton(R.string.yes,null);
    }
    builder.create().show();
  }
}
Program: 14767
Project: 14767
Buggy source:
@Override public void onDestroy(){
  for (  Request<JSONObject> req : statsNetworkRequests) {
    if (!req.hasHadResponseDelivered() && !req.isCanceled()) {
      req.cancel();
    }
  }
  if (orchestrator != null) {
    orchestrator.interrupt();
  }
  AppLog.i(T.STATS,"String_Node_Str");
  super.onDestroy();
}

Fixed version (ground truth):
@Override public void onDestroy(){
  stopRefresh();
  AppLog.i(T.STATS,"String_Node_Str");
  super.onDestroy();
}
Program: 14768
Project: 14768
Buggy source:
@Override public int onStartCommand(Intent intent,int flags,int startId){
  final String blogId=StringUtils.notNullStr(intent.getStringExtra(ARG_BLOG_ID));
  this.mBlogId=blogId;
  startTasks(blogId,startId);
  return START_NOT_STICKY;
}

Fixed version (ground truth):
@Override public int onStartCommand(Intent intent,int flags,int startId){
  final String blogId=StringUtils.notNullStr(intent.getStringExtra(ARG_BLOG_ID));
  if (mBlogId == null) {
    startTasks(blogId,startId);
  }
 else   if (blogId.equals(mBlogId)) {
    AppLog.i(T.STATS,"String_Node_Str" + mBlogId);
  }
 else {
    stopRefresh();
    startTasks(blogId,startId);
  }
  this.mBlogId=blogId;
  return START_NOT_STICKY;
}
Program: 14769
Project: 14769
Buggy source:
@Override public void onResponse(final JSONObject jsonObject){
  updateUIExecutor.submit(new Thread(){
    @Override public void run(){
      AppLog.d(T.STATS,"String_Node_Str");
      numberOfFinishedNetworkCalls++;
      try {
        if (jsonObject == null)         return;
        StatUtils.saveSummary(mBlogId,jsonObject);
        StatsSummary stats=StatUtils.getSummary(mBlogId);
        if (stats != null) {
          LocalBroadcastManager lbm=LocalBroadcastManager.getInstance(WordPress.getContext());
          Intent intent=new Intent(StatsService.ACTION_STATS_SUMMARY_UPDATED);
          intent.putExtra(StatsService.STATS_SUMMARY_UPDATED_EXTRA,stats);
          lbm.sendBroadcast(intent);
        }
      }
  finally {
        notifyResponseReceived();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void onResponse(final JSONObject jsonObject){
  if (!updateUIExecutor.isShutdown() && !updateUIExecutor.isTerminated() && !updateUIExecutor.isTerminating())   updateUIExecutor.submit(new Thread(){
    @Override public void run(){
      AppLog.d(T.STATS,"String_Node_Str");
      numberOfFinishedNetworkCalls++;
      try {
        if (jsonObject == null)         return;
        StatUtils.saveSummary(mBlogId,jsonObject);
        StatsSummary stats=StatUtils.getSummary(mBlogId);
        if (stats != null) {
          LocalBroadcastManager lbm=LocalBroadcastManager.getInstance(WordPress.getContext());
          Intent intent=new Intent(StatsService.ACTION_STATS_SUMMARY_UPDATED);
          intent.putExtra(StatsService.STATS_SUMMARY_UPDATED_EXTRA,stats);
          lbm.sendBroadcast(intent);
        }
      }
  finally {
        notifyResponseReceived();
      }
    }
  }
);
}
Program: 14771
Project: 14771
Buggy source:
@Override public void onErrorResponse(final VolleyError volleyError){
  updateUIExecutor.submit(new Thread(){
    @Override public void run(){
      numberOfFinishedNetworkCalls++;
      if (volleyError != null) {
        AppLog.e(T.STATS,"String_Node_Str" + volleyError.getMessage(),volleyError);
      }
      notifyResponseReceived();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onErrorResponse(final VolleyError volleyError){
  if (!updateUIExecutor.isShutdown() && !updateUIExecutor.isTerminated() && !updateUIExecutor.isTerminating())   updateUIExecutor.submit(new Thread(){
    @Override public void run(){
      numberOfFinishedNetworkCalls++;
      if (volleyError != null) {
        AppLog.e(T.STATS,"String_Node_Str" + volleyError.getMessage(),volleyError);
      }
      notifyResponseReceived();
    }
  }
);
}
Program: 14773
Project: 14773
Buggy source:
private static void handleGetPostsResponse(long blogId,JSONObject jsonObject,final ReaderActions.ActionListener actionListener){
  if (jsonObject == null) {
    if (actionListener != null)     actionListener.onActionResult(false);
    return;
  }
  ReaderPostList posts=ReaderPostList.fromJson(jsonObject);
  for (  ReaderPost post : posts) {
    post.blogId=blogId;
  }
  ReaderPostTable.addOrUpdatePosts(null,posts);
  if (actionListener != null) {
    actionListener.onActionResult(posts.size() > 0 ? true : false);
  }
}

Fixed version (ground truth):
private static void handleGetPostsResponse(JSONObject jsonObject,final ReaderActions.ActionListener actionListener){
  if (jsonObject == null) {
    if (actionListener != null)     actionListener.onActionResult(false);
    return;
  }
  ReaderPostList posts=ReaderPostList.fromJson(jsonObject);
  ReaderPostTable.addOrUpdatePosts(null,posts);
  if (actionListener != null) {
    actionListener.onActionResult(posts.size() > 0 ? true : false);
  }
}
Program: 14774
Project: 14774
Buggy source:
@Override public void onResponse(JSONObject jsonObject){
  handleGetPostsResponse(blogId,jsonObject,actionListener);
}

Fixed version (ground truth):
@Override public void onResponse(JSONObject jsonObject){
  handleGetPostsResponse(jsonObject,actionListener);
}
Program: 14775
Project: 14775
Buggy source:
public static void requestPostsForBlog(final long blogId,final ReaderActions.ActionListener actionListener){
  String path="String_Node_Str" + blogId + "String_Node_Str"+ "String_Node_Str";
  com.wordpress.rest.RestRequest.Listener listener=new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject jsonObject){
      handleGetPostsResponse(blogId,jsonObject,actionListener);
    }
  }
;
  RestRequest.ErrorListener errorListener=new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError volleyError){
      AppLog.e(T.READER,volleyError);
      if (actionListener != null)       actionListener.onActionResult(false);
    }
  }
;
  AppLog.d(T.READER,"String_Node_Str" + blogId);
  WordPress.getRestClientUtils().get(path,null,null,listener,errorListener);
}

Fixed version (ground truth):
public static void requestPostsForBlog(final long blogId,final ReaderActions.ActionListener actionListener){
  String path="String_Node_Str" + blogId + "String_Node_Str"+ "String_Node_Str";
  com.wordpress.rest.RestRequest.Listener listener=new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject jsonObject){
      handleGetPostsResponse(jsonObject,actionListener);
    }
  }
;
  RestRequest.ErrorListener errorListener=new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError volleyError){
      AppLog.e(T.READER,volleyError);
      if (actionListener != null)       actionListener.onActionResult(false);
    }
  }
;
  AppLog.d(T.READER,"String_Node_Str" + blogId);
  WordPress.getRestClientUtils().get(path,null,null,listener,errorListener);
}
Program: 14776
Project: 14776
Buggy source:
private int getThumbnailWidth(Context context,int targetWidth){
  final int DEFAULT_WIDTH=600;
  int width;
  if (targetWidth != 0) {
    width=targetWidth;
  }
 else {
    if (context == null) {
      return DEFAULT_WIDTH;
    }
    WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
    if (wm == null) {
      return DEFAULT_WIDTH;
    }
    Display display=wm.getDefaultDisplay();
    Point size=new Point();
    display.getSize(size);
    width=size.x;
    int height=size.y;
    if (height < width) {
      width=height;
    }
  }
  return width;
}

Fixed version (ground truth):
private int getThumbnailWidth(Context context,int targetWidth){
  final int DEFAULT_WIDTH=600;
  int width;
  if (targetWidth != 0) {
    width=targetWidth;
  }
 else {
    if (context == null) {
      return DEFAULT_WIDTH;
    }
    Point size=DisplayUtils.getDisplayPixelSize(context);
    width=size.x;
    if (size.y < width) {
      width=size.y;
    }
  }
  return width;
}
Program: 14777
Project: 14777
Buggy source:
@Override public void onActivityCreated(Bundle bundle){
  super.onActivityCreated(bundle);
  mProgressFooterView=View.inflate(getActivity(),R.layout.list_footer_progress,null);
  mProgressFooterView.setVisibility(View.GONE);
  ListView listView=getListView();
  listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  listView.setOnScrollListener(new ListScrollListener());
  listView.setDivider(getResources().getDrawable(R.drawable.list_divider));
  listView.setDividerHeight(1);
  listView.addFooterView(mProgressFooterView,null,false);
  setListAdapter(getNotesAdapter());
  TextView textview=(TextView)listView.getEmptyView();
  if (textview != null) {
    textview.setText(getText(R.string.notifications_empty_list));
  }
  mPullToRefreshHelper=new PullToRefreshHelper(getActivity(),(PullToRefreshLayout)getActivity().findViewById(R.id.ptr_layout),new RefreshListener(){
    @Override public void onRefreshStarted(    View view){
      if (getActivity() == null || !NetworkUtils.checkConnection(getActivity())) {
        mPullToRefreshHelper.setRefreshing(false);
        return;
      }
      if (getActivity() instanceof NotificationsActivity) {
        ((NotificationsActivity)getActivity()).refreshNotes();
      }
    }
  }
,TextView.class);
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle bundle){
  super.onActivityCreated(bundle);
  mProgressFooterView=View.inflate(getActivity(),R.layout.list_footer_progress,null);
  mProgressFooterView.setVisibility(View.GONE);
  ListView listView=getListView();
  listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  listView.setOnScrollListener(new ListScrollListener());
  listView.setDivider(getResources().getDrawable(R.drawable.list_divider));
  listView.setDividerHeight(1);
  listView.addFooterView(mProgressFooterView,null,false);
  setListAdapter(getNotesAdapter());
  TextView textview=(TextView)listView.getEmptyView();
  if (textview != null) {
    textview.setText(getText(R.string.notifications_empty_list));
  }
  initPullToRefreshHelper();
}
Program: 14778
Project: 14778
Buggy source:
@Override public void onActivityCreated(Bundle bundle){
  super.onActivityCreated(bundle);
  getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  mProgressFooterView=View.inflate(getActivity(),R.layout.list_footer_progress,null);
  getListView().addFooterView(mProgressFooterView,null,false);
  mProgressFooterView.setVisibility(View.GONE);
  getListView().setDivider(getResources().getDrawable(R.drawable.list_divider));
  getListView().setDividerHeight(1);
  getListView().setOnItemClickListener(new AdapterView.OnItemClickListener(){
    public void onItemClick(    AdapterView<?> arg0,    View v,    int position,    long id){
      if (position >= getPostListAdapter().getCount())       return;
      if (v == null)       return;
      PostsListPost postsListPost=(PostsListPost)getPostListAdapter().getItem(position);
      if (postsListPost == null)       return;
      if (!mIsFetchingPosts || isLoadingMorePosts()) {
        showPost(postsListPost.getPostId());
      }
 else       if (hasActivity()) {
        Toast.makeText(getActivity(),mIsPage ? R.string.loading_pages : R.string.loading_posts,Toast.LENGTH_SHORT).show();
      }
    }
  }
);
  TextView textView=(TextView)getActivity().findViewById(R.id.title_empty);
  if (textView != null) {
    if (mIsPage) {
      textView.setText(getText(R.string.pages_empty_list));
    }
 else {
      textView.setText(getText(R.string.posts_empty_list));
    }
  }
  WordPress.setOnPostUploadedListener(this);
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle bundle){
  super.onActivityCreated(bundle);
  getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  mProgressFooterView=View.inflate(getActivity(),R.layout.list_footer_progress,null);
  getListView().addFooterView(mProgressFooterView,null,false);
  mProgressFooterView.setVisibility(View.GONE);
  getListView().setDivider(getResources().getDrawable(R.drawable.list_divider));
  getListView().setDividerHeight(1);
  getListView().setOnItemClickListener(new AdapterView.OnItemClickListener(){
    public void onItemClick(    AdapterView<?> arg0,    View v,    int position,    long id){
      if (position >= getPostListAdapter().getCount())       return;
      if (v == null)       return;
      PostsListPost postsListPost=(PostsListPost)getPostListAdapter().getItem(position);
      if (postsListPost == null)       return;
      if (!mIsFetchingPosts || isLoadingMorePosts()) {
        showPost(postsListPost.getPostId());
      }
 else       if (hasActivity()) {
        Toast.makeText(getActivity(),mIsPage ? R.string.loading_pages : R.string.loading_posts,Toast.LENGTH_SHORT).show();
      }
    }
  }
);
  TextView textView=(TextView)getActivity().findViewById(R.id.title_empty);
  if (textView != null) {
    if (mIsPage) {
      textView.setText(getText(R.string.pages_empty_list));
    }
 else {
      textView.setText(getText(R.string.posts_empty_list));
    }
  }
  initPullToRefreshHelper();
  WordPress.setOnPostUploadedListener(this);
}
Program: 14779
Project: 14779
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.post_listview,container,false);
  mPullToRefreshHelper=new PullToRefreshHelper(getActivity(),(PullToRefreshLayout)view.findViewById(R.id.ptr_layout),new RefreshListener(){
    @Override public void onRefreshStarted(    View view){
      if (getActivity() == null || !NetworkUtils.checkConnection(getActivity())) {
        mPullToRefreshHelper.setRefreshing(false);
        return;
      }
      refreshPosts((PostsActivity)getActivity());
    }
  }
,LinearLayout.class);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.post_listview,container,false);
}
Program: 14781
Project: 14781
Buggy source:
@Override protected String doInBackground(Post... params){
  String result=null;
  post=params[0];
  if (post == null)   return null;
  Blog blog=WordPress.currentBlog;
  XMLRPCClientInterface client=XMLRPCFactory.instantiate(blog.getUri(),blog.getHttpuser(),blog.getHttppassword());
  Object getPostResult;
  try {
    Object[] vParams={WordPress.currentBlog.getRemoteBlogId(),post.getRemotePostId(),WordPress.currentBlog.getUsername(),WordPress.currentBlog.getPassword()};
    getPostResult=client.call(mIsPage ? "String_Node_Str" : "String_Node_Str",vParams);
  }
 catch (  XMLRPCException e) {
    AppLog.e(AppLog.T.POSTS,e);
    mErrorMsg=getResources().getText(R.string.error_generic).toString();
    return null;
  }
catch (  IOException e) {
    AppLog.e(AppLog.T.POSTS,e);
    mErrorMsg=getResources().getText(R.string.error_generic).toString();
    return null;
  }
catch (  XmlPullParserException e) {
    AppLog.e(AppLog.T.POSTS,e);
    mErrorMsg=getResources().getText(R.string.error_generic).toString();
    return null;
  }
  if (getPostResult != null && getPostResult instanceof Map) {
    try {
      Map<?,?> postMap=(Map<?,?>)getPostResult;
      String postStatus=MapUtils.getMapStr(postMap,mIsPage ? "String_Node_Str" : "String_Node_Str");
      if (!"String_Node_Str".equals(postStatus)) {
        if (mIsPage) {
          mErrorMsg=getString(R.string.page_not_published);
        }
 else {
          mErrorMsg=getString(R.string.post_not_published);
        }
        return null;
      }
 else {
        String postUrl=MapUtils.getMapStr(postMap,"String_Node_Str");
        String shortlink=getShortlinkTagHref(postUrl);
        if (shortlink == null) {
          result=postUrl;
        }
 else {
          result=shortlink;
        }
      }
    }
 catch (    Exception e) {
      mErrorMsg=getResources().getText(R.string.error_generic).toString();
      return null;
    }
  }
  return result;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Void... params){
  Object[] commentParams={WordPress.currentBlog.getRemoteBlogId(),WordPress.currentBlog.getUsername(),WordPress.currentBlog.getPassword()};
  try {
    ApiHelper.refreshComments(PostsActivity.this,commentParams);
  }
 catch (  final Exception e) {
    mErrorMsg=getResources().getText(R.string.error_generic).toString();
  }
  return null;
}
Program: 14782
Project: 14782
Buggy source:
@Override protected void onPostExecute(String shareURL){
  dismissDialog(ID_DIALOG_SHARE);
  if (shareURL == null) {
    AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(PostsActivity.this);
    dialogBuilder.setTitle(getResources().getText(R.string.connection_error));
    dialogBuilder.setMessage(mErrorMsg);
    dialogBuilder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int whichButton){
      }
    }
);
    dialogBuilder.setCancelable(true);
    if (!isFinishing()) {
      dialogBuilder.create().show();
    }
  }
 else {
    Intent share=new Intent(Intent.ACTION_SEND);
    share.setType("String_Node_Str");
    share.putExtra(Intent.EXTRA_SUBJECT,post.getTitle());
    share.putExtra(Intent.EXTRA_TEXT,shareURL);
    startActivity(Intent.createChooser(share,getResources().getText(R.string.share_url)));
    AppLockManager.getInstance().setExtendedTimeout();
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Boolean result){
  dismissDialog(ID_DIALOG_DELETING);
  attemptToSelectPost();
  if (result) {
    Toast.makeText(PostsActivity.this,getResources().getText((mIsPage) ? R.string.page_deleted : R.string.post_deleted),Toast.LENGTH_SHORT).show();
    checkForLocalChanges(false);
    WordPress.wpDB.deletePost(post);
    mPostList.requestPosts(false);
    mPostList.setRefreshing(true);
  }
 else {
    AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(PostsActivity.this);
    dialogBuilder.setTitle(getResources().getText(R.string.connection_error));
    dialogBuilder.setMessage(mErrorMsg);
    dialogBuilder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int whichButton){
      }
    }
);
    dialogBuilder.setCancelable(true);
    if (!isFinishing()) {
      dialogBuilder.create().show();
    }
  }
}
Program: 14783
Project: 14783
Buggy source:
@Override protected void onPreExecute(){
  showDialog(ID_DIALOG_SHARE);
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  popPostDetail();
  showDialog(ID_DIALOG_DELETING);
}
Program: 14784
Project: 14784
Buggy source:
/** 
 * Show Alert Dialog
 * @param context
 * @param titleId
 * @param messageId
 * @param positiveButtontxt
 * @param positiveListener
 */
public static void showAlert(Context context,int titleId,String message,CharSequence positiveButtontxt,DialogInterface.OnClickListener positiveListener){
  Dialog dlg=new AlertDialog.Builder(context).setIcon(android.R.drawable.ic_dialog_alert).setTitle(titleId).setPositiveButton(positiveButtontxt,positiveListener).setMessage(message).setCancelable(false).create();
  dlg.show();
}

Fixed version (ground truth):
/** 
 * Show Alert Dialog
 * @param context
 * @param titleId
 * @param messageId
 * @param positiveButtontxt
 * @param positiveListener
 */
public static void showAlert(Context context,int titleId,String message,CharSequence positiveButtontxt,DialogInterface.OnClickListener positiveListener){
  Dialog dlg=new AlertDialog.Builder(context).setTitle(titleId).setPositiveButton(positiveButtontxt,positiveListener).setMessage(message).setCancelable(false).create();
  dlg.show();
}
Program: 14785
Project: 14785
Buggy source:
public MediaFile getMediaFile(String src,Post post){
  Cursor c=db.query(MEDIA_TABLE,null,"String_Node_Str" + post.getId() + "String_Node_Str"+ src+ "String_Node_Str",null,null,null,null);
  int numRows=c.getCount();
  c.moveToFirst();
  MediaFile mf=new MediaFile();
  if (numRows >= 1) {
    mf.setPostID(c.getInt(1));
    mf.setFilePath(c.getString(2));
    mf.setFileName(c.getString(3));
    mf.setTitle(c.getString(4));
    mf.setDescription(c.getString(5));
    mf.setCaption(c.getString(6));
    mf.setHorizontalAlignment(c.getInt(7));
    mf.setWidth(c.getInt(8));
    mf.setHeight(c.getInt(9));
    mf.setMimeType(c.getString(10));
    mf.setFeatured(c.getInt(11) > 0);
    mf.setVideo(c.getInt(12) > 0);
    mf.setFeaturedInPost(c.getInt(13) > 0);
    mf.setFileURL(c.getString(14));
    mf.setThumbnailURL(c.getString(15));
    mf.setMediaId(c.getString(16));
    mf.setBlogId(c.getString(17));
    mf.setDateCreatedGMT(c.getLong(18));
    mf.setUploadState(c.getString(19));
    mf.setVideoPressShortCode(c.getString(20));
  }
 else {
    c.close();
    return null;
  }
  c.close();
  return mf;
}

Fixed version (ground truth):
public MediaFile getMediaFile(String src,Post post){
  Cursor c=db.query(MEDIA_TABLE,null,"String_Node_Str",new String[]{String.valueOf(post.getLocalTablePostId()),src},null,null,null);
  try {
    if (c.moveToFirst()) {
      MediaFile mf=new MediaFile();
      mf.setId(c.getInt(0));
      mf.setPostID(c.getInt(1));
      mf.setFilePath(c.getString(2));
      mf.setFileName(c.getString(3));
      mf.setTitle(c.getString(4));
      mf.setDescription(c.getString(5));
      mf.setCaption(c.getString(6));
      mf.setHorizontalAlignment(c.getInt(7));
      mf.setWidth(c.getInt(8));
      mf.setHeight(c.getInt(9));
      mf.setMimeType(c.getString(10));
      mf.setFeatured(c.getInt(11) > 0);
      mf.setVideo(c.getInt(12) > 0);
      mf.setFeaturedInPost(c.getInt(13) > 0);
      mf.setFileURL(c.getString(14));
      mf.setThumbnailURL(c.getString(15));
      mf.setMediaId(c.getString(16));
      mf.setBlogId(c.getString(17));
      mf.setDateCreatedGMT(c.getLong(18));
      mf.setUploadState(c.getString(19));
      mf.setVideoPressShortCode(c.getString(20));
      return mf;
    }
 else {
      return null;
    }
  }
  finally {
    c.close();
  }
}
Program: 14787
Project: 14787
Buggy source:
public int updatePost(Post post,int blogID){
  int success=0;
  if (post != null) {
    ContentValues values=new ContentValues();
    values.put("String_Node_Str",blogID);
    values.put("String_Node_Str",post.getTitle());
    values.put("String_Node_Str",post.getDate_created_gmt());
    values.put("String_Node_Str",post.getDescription());
    if (post.getMt_text_more() != null)     values.put("String_Node_Str",post.getMt_text_more());
    values.put("String_Node_Str",post.isUploaded());
    JSONArray categoriesJsonArray=post.getJSONCategories();
    if (categoriesJsonArray != null) {
      values.put("String_Node_Str",categoriesJsonArray.toString());
    }
    values.put("String_Node_Str",post.isLocalDraft());
    values.put("String_Node_Str",post.getMediaPaths());
    values.put("String_Node_Str",post.getMt_keywords());
    values.put("String_Node_Str",post.getWP_password());
    values.put("String_Node_Str",post.getPost_status());
    values.put("String_Node_Str",post.isPage());
    values.put("String_Node_Str",post.getWP_post_format());
    values.put("String_Node_Str",post.isLocalChange());
    values.put("String_Node_Str",post.getMt_excerpt());
    int pageInt=0;
    if (post.isPage())     pageInt=1;
    success=db.update(POSTS_TABLE,values,"String_Node_Str" + post.getBlogID() + "String_Node_Str"+ post.getId()+ "String_Node_Str"+ pageInt,null);
  }
  return (success);
}

Fixed version (ground truth):
public int updatePost(Post post){
  int result=0;
  if (post != null) {
    ContentValues values=new ContentValues();
    values.put("String_Node_Str",post.getTitle());
    values.put("String_Node_Str",post.getDate_created_gmt());
    values.put("String_Node_Str",post.getDescription());
    values.put("String_Node_Str",post.getMoreText());
    values.put("String_Node_Str",post.isUploaded());
    JSONArray categoriesJsonArray=post.getJSONCategories();
    if (categoriesJsonArray != null) {
      values.put("String_Node_Str",categoriesJsonArray.toString());
    }
    values.put("String_Node_Str",post.isLocalDraft());
    values.put("String_Node_Str",post.getMediaPaths());
    values.put("String_Node_Str",post.getKeywords());
    values.put("String_Node_Str",post.getPassword());
    values.put("String_Node_Str",post.getPostStatus());
    values.put("String_Node_Str",post.isPage());
    values.put("String_Node_Str",post.getPostFormat());
    values.put("String_Node_Str",post.isLocalChange());
    values.put("String_Node_Str",post.getPostExcerpt());
    result=db.update(POSTS_TABLE,values,"String_Node_Str",new String[]{String.valueOf(post.getLocalTableBlogId()),String.valueOf(post.getLocalTablePostId()),String.valueOf(SqlUtils.boolToSql(post.isPage()))});
  }
  return (result);
}
Program: 14788
Project: 14788
Buggy source:
public void deleteMediaFilesForPost(Post post){
  db.delete(MEDIA_TABLE,"String_Node_Str" + post.getBlogID() + "String_Node_Str"+ post.getId(),null);
}

Fixed version (ground truth):
public void deleteMediaFilesForPost(Post post){
  db.delete(MEDIA_TABLE,"String_Node_Str" + post.getLocalTableBlogId() + "String_Node_Str"+ post.getLocalTablePostId(),null);
}
Program: 14789
Project: 14789
Buggy source:
public boolean deletePost(Post post){
  int result=db.delete(POSTS_TABLE,"String_Node_Str",new String[]{String.valueOf(post.getBlogID()),String.valueOf(post.getId())});
  return (result == 1);
}

Fixed version (ground truth):
public boolean deletePost(Post post){
  int result=db.delete(POSTS_TABLE,"String_Node_Str",new String[]{String.valueOf(post.getLocalTableBlogId()),String.valueOf(post.getLocalTablePostId())});
  return (result == 1);
}
Program: 14790
Project: 14790
Buggy source:
public long savePost(Post post,int blogID){
  long returnValue=-1;
  if (post != null) {
    ContentValues values=new ContentValues();
    values.put("String_Node_Str",blogID);
    values.put("String_Node_Str",post.getTitle());
    values.put("String_Node_Str",post.getDate_created_gmt());
    values.put("String_Node_Str",post.getDescription());
    values.put("String_Node_Str",post.getMt_text_more());
    JSONArray categoriesJsonArray=post.getJSONCategories();
    if (categoriesJsonArray != null) {
      values.put("String_Node_Str",categoriesJsonArray.toString());
    }
    values.put("String_Node_Str",post.isLocalDraft());
    values.put("String_Node_Str",post.getMt_keywords());
    values.put("String_Node_Str",post.getWP_password());
    values.put("String_Node_Str",post.getPost_status());
    values.put("String_Node_Str",post.isUploaded());
    values.put("String_Node_Str",post.isPage());
    values.put("String_Node_Str",post.getWP_post_format());
    values.put("String_Node_Str",post.getLatitude());
    values.put("String_Node_Str",post.getLongitude());
    values.put("String_Node_Str",post.isLocalChange());
    values.put("String_Node_Str",post.getMt_excerpt());
    returnValue=db.insert(POSTS_TABLE,null,values);
  }
  return (returnValue);
}

Fixed version (ground truth):
public long savePost(Post post){
  long result=-1;
  if (post != null) {
    ContentValues values=new ContentValues();
    values.put("String_Node_Str",post.getLocalTableBlogId());
    values.put("String_Node_Str",post.getTitle());
    values.put("String_Node_Str",post.getDate_created_gmt());
    values.put("String_Node_Str",post.getDescription());
    values.put("String_Node_Str",post.getMoreText());
    JSONArray categoriesJsonArray=post.getJSONCategories();
    if (categoriesJsonArray != null) {
      values.put("String_Node_Str",categoriesJsonArray.toString());
    }
    values.put("String_Node_Str",post.isLocalDraft());
    values.put("String_Node_Str",post.getKeywords());
    values.put("String_Node_Str",post.getPassword());
    values.put("String_Node_Str",post.getPostStatus());
    values.put("String_Node_Str",post.isUploaded());
    values.put("String_Node_Str",post.isPage());
    values.put("String_Node_Str",post.getPostFormat());
    values.put("String_Node_Str",post.getLatitude());
    values.put("String_Node_Str",post.getLongitude());
    values.put("String_Node_Str",post.isLocalChange());
    values.put("String_Node_Str",post.getPostExcerpt());
    result=db.insert(POSTS_TABLE,null,values);
    if (result >= 0 && post.isLocalDraft() && !post.isUploaded()) {
      post.setLocalTablePostId(result);
    }
  }
  return (result);
}
Program: 14791
Project: 14791
Buggy source:
public void setDate_created_gmt(long dateCreatedGmt){
  date_created_gmt=dateCreatedGmt;
}

Fixed version (ground truth):
public void setDate_created_gmt(long dateCreatedGmt){
  this.dateCreatedGmt=dateCreatedGmt;
}
Program: 14792
Project: 14792
Buggy source:
public PostStatus getStatusEnum(){
  return PostStatus.fromString(post_status);
}

Fixed version (ground truth):
public PostStatus getStatusEnum(){
  return PostStatus.fromString(status);
}
Program: 14793
Project: 14793
Buggy source:
public String getTitle(){
  return title;
}

Fixed version (ground truth):
public String getTitle(){
  return StringUtils.notNullStr(title);
}
Program: 14794
Project: 14794
Buggy source:
public long getDate_created_gmt(){
  return date_created_gmt;
}

Fixed version (ground truth):
public long getDate_created_gmt(){
  return dateCreatedGmt;
}
Program: 14795
Project: 14795
Buggy source:
/** 
 * Get the entire post content Joins description and mt_text_more fields if both are valid
 * @return post content as String
 */
public String getContent(){
  String postContent;
  if (!getMt_text_more().equals("String_Node_Str")) {
    if (isLocalDraft())     postContent=getDescription() + "String_Node_Str" + getMt_text_more();
 else     postContent=getDescription() + "String_Node_Str" + getMt_text_more();
  }
 else   postContent=getDescription();
  return postContent;
}

Fixed version (ground truth):
/** 
 * Get the entire post content Joins description and moreText fields if both are valid
 * @return post content as String
 */
public String getContent(){
  String postContent;
  if (!TextUtils.isEmpty(getMoreText())) {
    if (isLocalDraft())     postContent=getDescription() + "String_Node_Str" + getMoreText();
 else     postContent=getDescription() + "String_Node_Str" + getMoreText();
  }
 else   postContent=getDescription();
  return postContent;
}
Program: 14796
Project: 14796
Buggy source:
public String getDescription(){
  return description;
}

Fixed version (ground truth):
public String getDescription(){
  return StringUtils.notNullStr(description);
}
Program: 14797
Project: 14797
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + blogID;
  result=prime * result + (int)(id ^ (id >>> 32));
  result=prime * result + (isPage ? 1231 : 1237);
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + localTableBlogId;
  result=prime * result + (int)(localTablePostId ^ (localTablePostId >>> 32));
  result=prime * result + (isPage ? 1231 : 1237);
  return result;
}
Program: 14798
Project: 14798
Buggy source:
public String getPermaLink(){
  return permaLink;
}

Fixed version (ground truth):
public String getPermaLink(){
  return StringUtils.notNullStr(permaLink);
}
Program: 14799
Project: 14799
Buggy source:
public String getMediaPaths(){
  return mediaPaths;
}

Fixed version (ground truth):
public String getMediaPaths(){
  return StringUtils.notNullStr(mediaPaths);
}
Program: 14800
Project: 14800
Buggy source:
public Post(int blog_id,String title,String content,String excerpt,String picturePaths,long date,String categories,String tags,String status,String password,double latitude,double longitude,boolean isPage,String postFormat,boolean isLocalChange){
  this.blogID=blog_id;
  this.title=title;
  this.description=content;
  this.mt_excerpt=excerpt;
  this.mediaPaths=picturePaths;
  this.date_created_gmt=date;
  this.categories=categories;
  this.mt_keywords=tags;
  this.post_status=status;
  this.wp_password=password;
  this.isPage=isPage;
  this.wp_post_format=postFormat;
  this.latitude=latitude;
  this.longitude=longitude;
  this.isLocalChange=isLocalChange;
}

Fixed version (ground truth):
public Post(int blogId,boolean isPage){
  this.localTableBlogId=blogId;
  this.isPage=isPage;
  this.localDraft=true;
}
Program: 14801
Project: 14801
Buggy source:
/** 
 * Checks if this post currently has data differing from another post.
 * @param otherPost The post to compare to this post's editable data.
 * @return True if this post's data differs from otherPost's data, False otherwise.
 */
public boolean hasChanges(Post otherPost){
  return otherPost == null || !(StringUtils.equals(title,otherPost.title) && StringUtils.equals(description,otherPost.description) && StringUtils.equals(mt_excerpt,otherPost.mt_excerpt)&& StringUtils.equals(mt_keywords,otherPost.mt_keywords)&& StringUtils.equals(categories,otherPost.categories)&& StringUtils.equals(post_status,otherPost.post_status)&& StringUtils.equals(wp_password,otherPost.wp_password)&& StringUtils.equals(wp_post_format,otherPost.wp_post_format)&& this.date_created_gmt == otherPost.date_created_gmt && this.latitude == otherPost.latitude && this.longitude == otherPost.longitude);
}

Fixed version (ground truth):
/** 
 * Checks if this post currently has data differing from another post.
 * @param otherPost The post to compare to this post's editable data.
 * @return True if this post's data differs from otherPost's data, False otherwise.
 */
public boolean hasChanges(Post otherPost){
  return otherPost == null || !(StringUtils.equals(title,otherPost.title) && StringUtils.equals(description,otherPost.description) && StringUtils.equals(excerpt,otherPost.excerpt)&& StringUtils.equals(keywords,otherPost.keywords)&& StringUtils.equals(categories,otherPost.categories)&& StringUtils.equals(status,otherPost.status)&& StringUtils.equals(password,otherPost.password)&& StringUtils.equals(postFormat,otherPost.postFormat)&& this.dateCreatedGmt == otherPost.dateCreatedGmt && this.latitude == otherPost.latitude && this.longitude == otherPost.longitude);
}
Program: 14802
Project: 14802
Buggy source:
public boolean isNew(){
  return getId() >= 0;
}

Fixed version (ground truth):
public boolean isNew(){
  return getLocalTablePostId() >= 0;
}
Program: 14803
Project: 14803
Buggy source:
public String getLink(){
  return link;
}

Fixed version (ground truth):
public String getLink(){
  return StringUtils.notNullStr(link);
}
Program: 14804
Project: 14804
Buggy source:
@Override public boolean equals(Object other){
  if (other == this)   return true;
  if (other instanceof Post) {
    Post otherPost=(Post)other;
    return (this.id == otherPost.id && this.isPage == otherPost.isPage && this.blogID == otherPost.blogID);
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean equals(Object other){
  if (other == this)   return true;
  if (other instanceof Post) {
    Post otherPost=(Post)other;
    return (this.localTablePostId == otherPost.localTablePostId && this.isPage == otherPost.isPage && this.localTableBlogId == otherPost.localTableBlogId);
  }
 else {
    return false;
  }
}
Program: 14805
Project: 14805
Buggy source:
public String getQuickPostType(){
  return quickPostType;
}

Fixed version (ground truth):
public String getQuickPostType(){
  return StringUtils.notNullStr(quickPostType);
}