nus-yam/ex-repair huggingface dataset:
Program: 26182
Project: 26182
Buggy source:
@Override public void DownloadFinished(int AsynkTaskId,Long feedId,Bitmap bitmap){
  if (bitmap != null) {
    DatabaseConnectionOrm dbConn=new DatabaseConnectionOrm(context);
    Feed feed=dbConn.getFeedById(feedId);
    String avg=ColourCalculator.ColourHexFromBitmap(bitmap);
    feed.setAvgColour(avg);
    dbConn.updateFeed(feed);
  }
}

Fixed version (ground truth):
@Override public void DownloadFinished(long AsynkTaskId,Bitmap bitmap){
  if (bitmap != null) {
    DatabaseConnectionOrm dbConn=new DatabaseConnectionOrm(context);
    Feed feed=dbConn.getFeedById(AsynkTaskId);
    String avg=ColourCalculator.ColourHexFromBitmap(bitmap);
    feed.setAvgColour(avg);
    dbConn.updateFeed(feed);
  }
}
Program: 26183
Project: 26183
Buggy source:
void DownloadFinished(int AsynkTaskId,@NonNull Long feedId,Bitmap bitmap);

Fixed version (ground truth):
void DownloadFinished(long AsynkTaskId,Bitmap bitmap);
Program: 26184
Project: 26184
Buggy source:
@Override protected void onHandleIntent(Intent intent){
  boolean downloadFavIconsExclusive=intent.getBooleanExtra(DOWNLOAD_FAVICONS_EXCLUSIVE,false);
  DatabaseConnectionOrm dbConn=new DatabaseConnectionOrm(this);
  Notification notify=BuildNotification();
  SparseArray<String> linksFavIcons=dbConn.getUrlsToFavIcons();
  if (linksFavIcons.size() > 0)   notificationManager.notify(NOTIFICATION_ID,notify);
  for (int i=0; i < linksFavIcons.size(); i++) {
    int key=linksFavIcons.keyAt(i);
    String link=linksFavIcons.get(i);
    new FavIconHandler(this).PreCacheFavIcon(link,(long)key);
  }
  if (!downloadFavIconsExclusive) {
    long lastId=intent.getLongExtra(LAST_ITEM_ID,0);
    List<RssItem> rssItemList=dbConn.getAllItemsWithIdHigher(lastId);
    List<String> links=new ArrayList<String>();
    for (    RssItem rssItem : rssItemList) {
      String body=rssItem.getBody();
      links.addAll(ImageHandler.getImageLinksFromText(body));
    }
    maxCount=links.size();
    if (maxCount > 0)     notificationManager.notify(NOTIFICATION_ID,notify);
    for (    String link : links)     new GetImageAsyncTask(link,imgDownloadFinished,999,FileUtils.getPathImageCache(this),this,null).execute();
  }
}

Fixed version (ground truth):
@Override protected void onHandleIntent(Intent intent){
  boolean downloadFavIconsExclusive=intent.getBooleanExtra(DOWNLOAD_FAVICONS_EXCLUSIVE,false);
  DatabaseConnectionOrm dbConn=new DatabaseConnectionOrm(this);
  Notification notify=BuildNotification();
  List<Feed> feedList=dbConn.getListOfFeeds();
  FavIconHandler favIconHandler=new FavIconHandler(this);
  for (  Feed feed : feedList) {
    favIconHandler.PreCacheFavIcon(feed);
  }
  feedList=null;
  favIconHandler=null;
  if (!downloadFavIconsExclusive) {
    long lastId=intent.getLongExtra(LAST_ITEM_ID,0);
    List<RssItem> rssItemList=dbConn.getAllItemsWithIdHigher(lastId);
    List<String> links=new ArrayList<String>();
    for (    RssItem rssItem : rssItemList) {
      String body=rssItem.getBody();
      links.addAll(ImageHandler.getImageLinksFromText(body));
    }
    maxCount=links.size();
    if (maxCount > 0)     notificationManager.notify(NOTIFICATION_ID,notify);
    for (    String link : links)     new GetImageAsyncTask(link,imgDownloadFinished,999,FileUtils.getPathImageCache(this),this).execute();
  }
}
Program: 26185
Project: 26185
Buggy source:
@Override public void DownloadFinished(int AsynkTaskId,Long feedId,Bitmap bitmap){
  count++;
  NotificationDownloadImages.setProgress(maxCount,count,false);
  NotificationDownloadImages.setContentText("String_Node_Str" + count + "String_Node_Str"+ maxCount);
  notificationManager.notify(NOTIFICATION_ID,NotificationDownloadImages.build());
  if (maxCount == count) {
    notificationManager.cancel(NOTIFICATION_ID);
    if (DownloadImagesService.this != null)     RemoveOldImages(DownloadImagesService.this);
  }
}

Fixed version (ground truth):
@Override public void DownloadFinished(long AsynkTaskId,Bitmap bitmap){
  count++;
  NotificationDownloadImages.setProgress(maxCount,count,false);
  NotificationDownloadImages.setContentText("String_Node_Str" + count + "String_Node_Str"+ maxCount);
  notificationManager.notify(NOTIFICATION_ID,NotificationDownloadImages.build());
  if (maxCount == count) {
    notificationManager.cancel(NOTIFICATION_ID);
    if (DownloadImagesService.this != null)     RemoveOldImages(DownloadImagesService.this);
  }
}
Program: 26187
Project: 26187
Buggy source:
public GetImageAsyncTask(String WEB_URL_TO_FILE,ImageDownloadFinished imgDownloadFinished,int AsynkTaskId,String rootPath,Context cont,Long feedId){
  try {
    this.WEB_URL_TO_FILE=new URL(WEB_URL_TO_FILE);
  }
 catch (  Exception ex) {
    Log.d(TAG,ex.getLocalizedMessage() + "String_Node_Str" + WEB_URL_TO_FILE);
  }
  this.feedID=feedID;
  this.cont=cont;
  imageDownloadFinished=imgDownloadFinished;
  this.AsyncTaskId=AsynkTaskId;
  this.rootPath=rootPath;
}

Fixed version (ground truth):
public GetImageAsyncTask(String WEB_URL_TO_FILE,ImageDownloadFinished imgDownloadFinished,int AsynkTaskId,String rootPath,Context cont,Long feedId){
  try {
    this.WEB_URL_TO_FILE=new URL(WEB_URL_TO_FILE);
  }
 catch (  Exception ex) {
    Log.d(TAG,ex.getLocalizedMessage() + "String_Node_Str" + WEB_URL_TO_FILE);
  }
  this.feedID=feedId;
  this.cont=cont;
  imageDownloadFinished=imgDownloadFinished;
  this.AsyncTaskId=AsynkTaskId;
  this.rootPath=rootPath;
}
Program: 26188
Project: 26188
Buggy source:
@Override protected void onPostExecute(Object ex){
  for (  OnAsyncTaskCompletedListener listenerInstance : listener) {
    if (listenerInstance != null)     listenerInstance.onAsyncTaskCompleted(task_id,ex);
  }
  if (ex == null && NetworkConnection.isNetworkAvailable(context)) {
    SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(context);
    int syncStrategy=Integer.parseInt(mPrefs.getString(SettingsActivity.LV_CACHE_IMAGES_OFFLINE_STRING,"String_Node_Str"));
switch (syncStrategy) {
case 0:
      break;
case 1:
    if (NetworkConnection.isWLANConnected(context))     StartDownloadingImages(context,highestItemIdBeforeSync,false);
  break;
case 2:
StartDownloadingImages(context,highestItemIdBeforeSync,false);
break;
case 3:
if (!NetworkConnection.isWLANConnected(context)) ShowDownloadImageWithoutWifiQuestion();
 else StartDownloadingImages(context,highestItemIdBeforeSync,false);
break;
}
}
detach();
}

Fixed version (ground truth):
@Override protected void onPostExecute(Object ex){
  for (  OnAsyncTaskCompletedListener listenerInstance : listener) {
    if (listenerInstance != null)     listenerInstance.onAsyncTaskCompleted(task_id,ex);
  }
  if (ex == null && NetworkConnection.isNetworkAvailable(context)) {
    SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(context);
    int syncStrategy=Integer.parseInt(mPrefs.getString(SettingsActivity.LV_CACHE_IMAGES_OFFLINE_STRING,"String_Node_Str"));
    boolean downloadImages=false;
switch (syncStrategy) {
case 0:
      break;
case 1:
    if (NetworkConnection.isWLANConnected(context))     downloadImages=true;
  break;
case 2:
downloadImages=true;
break;
case 3:
if (!NetworkConnection.isWLANConnected(context)) ShowDownloadImageWithoutWifiQuestion();
 else downloadImages=true;
break;
}
if (downloadImages) StartDownloadingImages(context,highestItemIdBeforeSync,false);
 else StartDownloadingImages(context,highestItemIdBeforeSync,true);
}
detach();
}
Program: 26190
Project: 26190
Buggy source:
@TargetApi(Build.VERSION_CODES.FROYO) @Override public boolean onOptionsItemSelected(MenuItem item){
  int id=item.getItemId();
  if (id == R.id.action_settings) {
    return true;
  }
 else   if (id == R.id.action_save) {
    int checkedPosition=mFragment.lvItems.getCheckedItemPosition();
    Integer minutes=Integer.parseInt(items_values[checkedPosition]);
    mPrefs.edit().putInt(SYNC_INTERVAL_IN_MINUTES_STRING,minutes).commit();
    long SYNC_INTERVAL=minutes * SECONDS_PER_MINUTE;
    AccountManager mAccountManager=AccountManager.get(this);
    Account[] accounts=mAccountManager.getAccountsByType(AccountGeneral.ACCOUNT_TYPE);
    for (    Account account : accounts) {
      ContentResolver.setSyncAutomatically(account,AccountGeneral.ACCOUNT_TYPE,true);
      Bundle bundle=new Bundle();
      ContentResolver.addPeriodicSync(account,AccountGeneral.ACCOUNT_TYPE,bundle,SYNC_INTERVAL);
    }
    finish();
  }
  return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.FROYO) @Override public boolean onOptionsItemSelected(MenuItem item){
  int id=item.getItemId();
  if (id == R.id.action_settings) {
    return true;
  }
 else   if (id == R.id.action_save) {
    int checkedPosition=mFragment.lvItems.getCheckedItemPosition();
    Integer minutes=Integer.parseInt(items_values[checkedPosition]);
    mPrefs.edit().putInt(SYNC_INTERVAL_IN_MINUTES_STRING,minutes).commit();
    SetAccountSyncInterval(this);
    finish();
  }
  return super.onOptionsItemSelected(item);
}
Program: 26191
Project: 26191
Buggy source:
public SparseArray<String> getUnreadItemCountForFolder(Context mContext){
  String buildSQL="String_Node_Str" + FOLDER_LABEL_ID + "String_Node_Str"+ RSS_ITEM_RSSITEM_ID+ "String_Node_Str"+ "String_Node_Str"+ RSS_ITEM_TABLE+ "String_Node_Str"+ "String_Node_Str"+ SUBSCRIPTION_TABLE+ "String_Node_Str"+ RSS_ITEM_SUBSCRIPTION_ID+ "String_Node_Str"+ "String_Node_Str"+ FOLDER_TABLE+ "String_Node_Str"+ SUBSCRIPTION_FOLDER_ID+ "String_Node_Str"+ "String_Node_Str"+ RSS_ITEM_READ_TEMP+ "String_Node_Str"+ "String_Node_Str"+ FOLDER_LABEL_ID;
  SparseArray<String> values=getSparseArrayFromSQL(buildSQL,0,1);
  values.put(ALL_UNREAD_ITEMS.getValue(),new UnreadFolderCount(mContext,ALL_UNREAD_ITEMS.getValueString()).getText());
  values.put(ALL_STARRED_ITEMS.getValue(),new UnreadFolderCount(mContext,ALL_STARRED_ITEMS.getValueString()).getText());
  return values;
}

Fixed version (ground truth):
public SparseArray<String> getUnreadItemCountForFolder(Context mContext){
  String buildSQL="String_Node_Str" + RSS_ITEM_RSSITEM_ID + "String_Node_Str"+ "String_Node_Str"+ RSS_ITEM_TABLE+ "String_Node_Str"+ "String_Node_Str"+ SUBSCRIPTION_TABLE+ "String_Node_Str"+ RSS_ITEM_SUBSCRIPTION_ID+ "String_Node_Str"+ "String_Node_Str"+ FOLDER_TABLE+ "String_Node_Str"+ SUBSCRIPTION_FOLDER_ID+ "String_Node_Str"+ "String_Node_Str"+ RSS_ITEM_READ_TEMP+ "String_Node_Str"+ "String_Node_Str"+ FOLDER_LABEL_ID;
  SparseArray<String> values=getSparseArrayFromSQL(buildSQL,0,1);
  values.put(ALL_UNREAD_ITEMS.getValue(),new UnreadFolderCount(mContext,ALL_UNREAD_ITEMS.getValueString()).getText());
  values.put(ALL_STARRED_ITEMS.getValue(),new UnreadFolderCount(mContext,ALL_STARRED_ITEMS.getValueString()).getText());
  return values;
}
Program: 26192
Project: 26192
Buggy source:
public SparseArray<String> getUnreadItemCountForFolder(Context mContext){
  String buildSQL="String_Node_Str" + FOLDER_LABEL_ID + "String_Node_Str"+ RSS_ITEM_RSSITEM_ID+ "String_Node_Str"+ "String_Node_Str"+ RSS_ITEM_TABLE+ "String_Node_Str"+ "String_Node_Str"+ SUBSCRIPTION_TABLE+ "String_Node_Str"+ RSS_ITEM_SUBSCRIPTION_ID+ "String_Node_Str"+ SUBSCRIPTION_ID+ "String_Node_Str"+ FOLDER_TABLE+ "String_Node_Str"+ SUBSCRIPTION_FOLDER_ID+ "String_Node_Str"+ FOLDER_LABEL_ID+ "String_Node_Str"+ RSS_ITEM_READ_TEMP+ "String_Node_Str"+ "String_Node_Str"+ FOLDER_LABEL_ID;
  SparseArray<String> values=getSparseArrayFromSQL(buildSQL,0,1);
  values.put(ALL_UNREAD_ITEMS.getValue(),new UnreadFolderCount(mContext,ALL_UNREAD_ITEMS.getValueString()).getText());
  values.put(ALL_STARRED_ITEMS.getValue(),new UnreadFolderCount(mContext,ALL_STARRED_ITEMS.getValueString()).getText());
  return values;
}

Fixed version (ground truth):
public SparseArray<String> getUnreadItemCountForFolder(Context mContext){
  String buildSQL="String_Node_Str" + FOLDER_LABEL_ID + "String_Node_Str"+ RSS_ITEM_RSSITEM_ID+ "String_Node_Str"+ "String_Node_Str"+ RSS_ITEM_TABLE+ "String_Node_Str"+ "String_Node_Str"+ SUBSCRIPTION_TABLE+ "String_Node_Str"+ RSS_ITEM_SUBSCRIPTION_ID+ "String_Node_Str"+ "String_Node_Str"+ FOLDER_TABLE+ "String_Node_Str"+ SUBSCRIPTION_FOLDER_ID+ "String_Node_Str"+ "String_Node_Str"+ RSS_ITEM_READ_TEMP+ "String_Node_Str"+ "String_Node_Str"+ FOLDER_LABEL_ID;
  SparseArray<String> values=getSparseArrayFromSQL(buildSQL,0,1);
  values.put(ALL_UNREAD_ITEMS.getValue(),new UnreadFolderCount(mContext,ALL_UNREAD_ITEMS.getValueString()).getText());
  values.put(ALL_STARRED_ITEMS.getValue(),new UnreadFolderCount(mContext,ALL_STARRED_ITEMS.getValueString()).getText());
  return values;
}
Program: 26194
Project: 26194
Buggy source:
public void StartSync(){
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  if (mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING,null) == null) {
    NewsReaderListActivity nla=(NewsReaderListActivity)getActivity();
    nla.StartLoginFragment();
  }
 else {
    if (!_Reader.isSyncRunning()) {
      new PostDelayHandler(getActivity()).stopRunningPostDelayHandler();
      OwnCloud_Reader ocReader=(OwnCloud_Reader)_Reader;
      ocReader.Start_AsyncTask_GetVersion(Constants.TaskID_GetVersion,getActivity(),onAsyncTask_GetVersionFinished,username,password);
    }
 else     _Reader.attachToRunningTask(-10,getActivity(),onAsyncTask_GetVersionFinished);
  }
  UpdateSyncButtonLayout();
}

Fixed version (ground truth):
public void StartSync(){
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  username=PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext()).getString("String_Node_Str","String_Node_Str");
  password=PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext()).getString("String_Node_Str","String_Node_Str");
  if (mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING,null) == null) {
    NewsReaderListActivity nla=(NewsReaderListActivity)getActivity();
    nla.StartLoginFragment();
  }
 else {
    if (!_Reader.isSyncRunning()) {
      new PostDelayHandler(getActivity()).stopRunningPostDelayHandler();
      OwnCloud_Reader ocReader=(OwnCloud_Reader)_Reader;
      ocReader.Start_AsyncTask_GetVersion(Constants.TaskID_GetVersion,getActivity(),onAsyncTask_GetVersionFinished,username,password);
    }
 else     _Reader.attachToRunningTask(-10,getActivity(),onAsyncTask_GetVersionFinished);
  }
  UpdateSyncButtonLayout();
}
Program: 26195
Project: 26195
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setRetainInstance(true);
  dbConn=new DatabaseConnection(getActivity());
  if (getArguments() != null) {
    if (getArguments().containsKey(NewsReaderListActivity.SUBSCRIPTION_ID)) {
      idFeed=getArguments().getString(NewsReaderListActivity.SUBSCRIPTION_ID);
    }
    if (getArguments().containsKey(NewsReaderListActivity.TITEL)) {
      titel=getArguments().getString(NewsReaderListActivity.TITEL);
    }
    if (getArguments().containsKey(NewsReaderListActivity.FOLDER_ID)) {
      idFolder=getArguments().getString(NewsReaderListActivity.FOLDER_ID);
    }
    ((SherlockFragmentActivity)getActivity()).getSupportActionBar().setTitle(titel);
    UpdateMenuItemsState();
    lvAdapter=null;
    UpdateCursor();
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setRetainInstance(true);
  if (getArguments() != null) {
    if (getArguments().containsKey(NewsReaderListActivity.SUBSCRIPTION_ID)) {
      idFeed=getArguments().getString(NewsReaderListActivity.SUBSCRIPTION_ID);
    }
    if (getArguments().containsKey(NewsReaderListActivity.TITEL)) {
      titel=getArguments().getString(NewsReaderListActivity.TITEL);
    }
    if (getArguments().containsKey(NewsReaderListActivity.FOLDER_ID)) {
      idFolder=getArguments().getString(NewsReaderListActivity.FOLDER_ID);
    }
    ((SherlockFragmentActivity)getActivity()).getSupportActionBar().setTitle(titel);
    UpdateMenuItemsState();
    lvAdapter=new NewsListCursorAdapter(getActivity(),null,this);
    setListAdapter(lvAdapter);
    getActivity().getSupportLoaderManager().destroyLoader(0);
    UpdateCursor();
  }
}
Program: 26196
Project: 26196
Buggy source:
public void UpdateCursor(){
  try {
    Cursor cursor=getRightCusor(idFolder);
    if (lvAdapter == null) {
      lvAdapter=new NewsListCursorAdapter(getActivity(),cursor,this);
      setListAdapter(lvAdapter);
    }
 else     lvAdapter.changeCursor(cursor);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public void UpdateCursor(){
  try {
    LoaderManager loader=getActivity().getSupportLoaderManager();
    loader.initLoader(0,null,new LoaderCallbacks<Cursor>(){
      @Override public Loader<Cursor> onCreateLoader(      int id,      Bundle args){
        return new NewsDetailCursorLoader(getActivity(),idFolder,idFeed);
      }
      @Override public void onLoadFinished(      Loader<Cursor> loader,      Cursor cursor){
        ((NewsListCursorAdapter)getListAdapter()).swapCursor(cursor);
      }
      @Override public void onLoaderReset(      Loader<Cursor> loader){
        ((NewsListCursorAdapter)getListAdapter()).swapCursor(null);
      }
    }
);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}
Program: 26197
Project: 26197
Buggy source:
public Cursor getRightCusor(String ID_FOLDER){
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  boolean onlyUnreadItems=mPrefs.getBoolean(SettingsActivity.CB_SHOWONLYUNREAD_STRING,false);
  boolean onlyStarredItems=false;
  if (ID_FOLDER != null)   if (ID_FOLDER.equals(SubscriptionExpandableListAdapter.ALL_STARRED_ITEMS))   onlyStarredItems=true;
  SORT_DIRECTION sDirection=SORT_DIRECTION.asc;
  String sortDirection=mPrefs.getString(SettingsActivity.SP_SORT_ORDER,"String_Node_Str");
  if (sortDirection.equals(SORT_DIRECTION.desc.toString()))   sDirection=SORT_DIRECTION.desc;
  String sqlSelectStatement=null;
  if (idFeed != null)   sqlSelectStatement=dbConn.getAllItemsIdsForFeedSQL(idFeed,onlyUnreadItems,onlyStarredItems,sDirection);
 else   if (idFolder != null) {
    if (idFolder.equals(SubscriptionExpandableListAdapter.ALL_STARRED_ITEMS))     onlyUnreadItems=false;
    sqlSelectStatement=dbConn.getAllItemsIdsForFolderSQL(idFolder,onlyUnreadItems,sDirection);
  }
  if (sqlSelectStatement != null) {
    dbConn.insertIntoRssCurrentViewTable(sqlSelectStatement);
  }
  return dbConn.getCurrentSelectedRssItems(sDirection);
}

Fixed version (ground truth):
public static Cursor getRightCusor(Context context,String idFolder,String idFeed){
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(context);
  boolean onlyUnreadItems=mPrefs.getBoolean(SettingsActivity.CB_SHOWONLYUNREAD_STRING,false);
  boolean onlyStarredItems=false;
  if (idFolder != null)   if (idFolder.equals(SubscriptionExpandableListAdapter.ALL_STARRED_ITEMS))   onlyStarredItems=true;
  SORT_DIRECTION sDirection=SORT_DIRECTION.asc;
  String sortDirection=mPrefs.getString(SettingsActivity.SP_SORT_ORDER,"String_Node_Str");
  if (sortDirection.equals(SORT_DIRECTION.desc.toString()))   sDirection=SORT_DIRECTION.desc;
  DatabaseConnection dbConn=new DatabaseConnection(context);
  String sqlSelectStatement=null;
  if (idFeed != null)   sqlSelectStatement=dbConn.getAllItemsIdsForFeedSQL(idFeed,onlyUnreadItems,onlyStarredItems,sDirection);
 else   if (idFolder != null) {
    if (idFolder.equals(SubscriptionExpandableListAdapter.ALL_STARRED_ITEMS))     onlyUnreadItems=false;
    sqlSelectStatement=dbConn.getAllItemsIdsForFolderSQL(idFolder,onlyUnreadItems,sDirection);
  }
  if (sqlSelectStatement != null) {
    dbConn.insertIntoRssCurrentViewTable(sqlSelectStatement);
  }
  return dbConn.getCurrentSelectedRssItems(sDirection);
}
Program: 26198
Project: 26198
Buggy source:
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override protected void onCreate(Bundle savedInstanceState){
  ThemeChooser.chooseTheme(this);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_newsreader);
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  if (mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING,null) == null)   StartLoginFragment();
  mSlidingLayout=(SlidingPaneLayout)findViewById(R.id.sliding_pane);
  mSlidingLayout.setParallaxDistance(280);
  mSlidingLayout.setPanelSlideListener(new PanelSlideListener(){
    @Override public void onPanelSlide(    View arg0,    float arg1){
    }
    @Override public void onPanelOpened(    View arg0){
      getSupportActionBar().setDisplayHomeAsUpEnabled(true);
      getSupportActionBar().setHomeButtonEnabled(true);
    }
    @Override public void onPanelClosed(    View arg0){
      getSupportActionBar().setDisplayHomeAsUpEnabled(false);
      getSupportActionBar().setHomeButtonEnabled(false);
    }
  }
);
  mSlidingLayout.openPane();
  if (shouldDrawerStayOpen()) {
  }
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override protected void onCreate(Bundle savedInstanceState){
  ThemeChooser.chooseTheme(this);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_newsreader);
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  if (mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING,null) == null)   StartLoginFragment();
  mSlidingLayout=(SlidingPaneLayout)findViewById(R.id.sliding_pane);
  mSlidingLayout.setParallaxDistance(280);
  mSlidingLayout.setSliderFadeColor(getResources().getColor(android.R.color.transparent));
  mSlidingLayout.setPanelSlideListener(new PanelSlideListener(){
    @Override public void onPanelSlide(    View arg0,    float arg1){
    }
    @Override public void onPanelOpened(    View arg0){
      getSupportActionBar().setDisplayHomeAsUpEnabled(true);
      getSupportActionBar().setHomeButtonEnabled(true);
    }
    @Override public void onPanelClosed(    View arg0){
      getSupportActionBar().setDisplayHomeAsUpEnabled(false);
      getSupportActionBar().setHomeButtonEnabled(false);
      if (startDetailFHolder != null) {
        startDetailFHolder.StartDetailFragment();
        startDetailFHolder=null;
      }
    }
  }
);
  mSlidingLayout.openPane();
  if (shouldDrawerStayOpen()) {
  }
}
Program: 26199
Project: 26199
Buggy source:
@Override public void onChildItemClicked(String idSubscription,String optional_folder_id){
  if (!shouldDrawerStayOpen())   mSlidingLayout.closePane();
  StartDetailFragment(idSubscription,false,optional_folder_id);
}

Fixed version (ground truth):
@Override public void onChildItemClicked(String idSubscription,String optional_folder_id){
  if (!shouldDrawerStayOpen())   mSlidingLayout.closePane();
  startDetailFHolder=new StartDetailFragmentHolder(idSubscription,false,optional_folder_id);
}
Program: 26200
Project: 26200
Buggy source:
/** 
 * Callback method from   {@link NewsReaderListFragment.Callbacks} indicatingthat the item with the given ID was selected.
 */
@Override public void onTopItemClicked(String idSubscription,boolean isFolder,String optional_folder_id){
  if (!shouldDrawerStayOpen())   mSlidingLayout.closePane();
  StartDetailFragment(idSubscription,isFolder,optional_folder_id);
}

Fixed version (ground truth):
/** 
 * Callback method from   {@link NewsReaderListFragment.Callbacks} indicatingthat the item with the given ID was selected.
 */
@Override public void onTopItemClicked(String idSubscription,boolean isFolder,String optional_folder_id){
  if (!shouldDrawerStayOpen())   mSlidingLayout.closePane();
  startDetailFHolder=new StartDetailFragmentHolder(idSubscription,isFolder,optional_folder_id);
}
Program: 26201
Project: 26201
Buggy source:
@Override public void onPanelClosed(View arg0){
  getSupportActionBar().setDisplayHomeAsUpEnabled(false);
  getSupportActionBar().setHomeButtonEnabled(false);
}

Fixed version (ground truth):
@Override public void onPanelClosed(View arg0){
  getSupportActionBar().setDisplayHomeAsUpEnabled(false);
  getSupportActionBar().setHomeButtonEnabled(false);
  if (startDetailFHolder != null) {
    startDetailFHolder.StartDetailFragment();
    startDetailFHolder=null;
  }
}
Program: 26202
Project: 26202
Buggy source:
@Override public View newView(Context cont,Cursor cursor,ViewGroup parent){
  LayoutInflater inflater=LayoutInflater.from(parent.getContext());
  View retView=null;
switch (selectedDesign) {
case 0:
    retView=inflater.inflate(R.layout.subscription_detail_list_item_simple,parent,false);
  break;
case 1:
retView=inflater.inflate(R.layout.subscription_detail_list_item_extended,parent,false);
break;
case 2:
retView=inflater.inflate(R.layout.subscription_detail_list_item_extended_webview,parent,false);
break;
default :
break;
}
if (retView != null) retView.setTag(cursor.getString(0));
return retView;
}

Fixed version (ground truth):
@Override public View newView(Context cont,Cursor cursor,ViewGroup parent){
  LayoutInflater inflater=LayoutInflater.from(parent.getContext());
  View retView=null;
switch (selectedDesign) {
case 0:
    retView=inflater.inflate(R.layout.subscription_detail_list_item_simple,parent,false);
  break;
case 1:
retView=inflater.inflate(R.layout.subscription_detail_list_item_extended,parent,false);
break;
case 2:
retView=inflater.inflate(R.layout.subscription_detail_list_item_extended_webview,parent,false);
break;
}
if (retView != null) retView.setTag(cursor.getString(0));
return retView;
}
Program: 26203
Project: 26203
Buggy source:
public void updateAdapter(){
  NewsReaderListFragment nlf=((NewsReaderListFragment)getSupportFragmentManager().findFragmentById(R.id.newsreader_list));
  if (nlf != null) {
    PullToRefreshExpandableListView ptrel=((PullToRefreshExpandableListView)nlf.eListView);
    BlockingExpandableListView bView=((BlockingExpandableListView)ptrel.getRefreshableView());
    bView.setBlockLayoutChildren(true);
    nlf.lvAdapter.notifyDataSetChanged();
    bView.setBlockLayoutChildren(false);
  }
}

Fixed version (ground truth):
public void updateAdapter(){
  NewsReaderListFragment nlf=((NewsReaderListFragment)getSupportFragmentManager().findFragmentById(R.id.newsreader_list));
  if (nlf != null) {
    PullToRefreshExpandableListView ptrel=((PullToRefreshExpandableListView)nlf.eListView);
    BlockingExpandableListView bView=((BlockingExpandableListView)ptrel.getRefreshableView());
    int firstVisPos=bView.getFirstVisiblePosition();
    View firstVisView=bView.getChildAt(0);
    int top=firstVisView != null ? firstVisView.getTop() : 0;
    int itemsAddedBeforeFirstVisible=0;
    bView.setBlockLayoutChildren(true);
    nlf.lvAdapter.notifyDataSetChanged();
    bView.setBlockLayoutChildren(false);
    bView.setSelectionFromTop(firstVisPos + itemsAddedBeforeFirstVisible,top);
  }
}
Program: 26204
Project: 26204
Buggy source:
@Override public void onAsyncTaskCompleted(int task_id,Object task_result){
  if (isAdded()) {
    if (task_result != null)     ShowToastLong(((Exception)task_result).getLocalizedMessage());
    lvAdapter.notifyDataSetChanged();
    if (eListView != null)     eListView.getLoadingLayoutProxy().setLastUpdatedLabel(null);
    UpdateSyncButtonLayout();
    lvAdapter.ReloadAdapter();
    NewsReaderListActivity nlActivity=(NewsReaderListActivity)getActivity();
    nlActivity.UpdateItemList();
    Log.d(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onAsyncTaskCompleted(int task_id,Object task_result){
  if (isTwoPaneMode() || isAdded()) {
    if (task_result != null)     ShowToastLong(((Exception)task_result).getLocalizedMessage());
    lvAdapter.notifyDataSetChanged();
    if (eListView != null)     eListView.getLoadingLayoutProxy().setLastUpdatedLabel(null);
    UpdateSyncButtonLayout();
    lvAdapter.ReloadAdapter();
    NewsReaderListActivity nlActivity=(NewsReaderListActivity)getActivity();
    nlActivity.UpdateItemList();
    Log.d(TAG,"String_Node_Str");
  }
}
Program: 26205
Project: 26205
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View V=null;
  if (isAdded()) {
    V=inflater.inflate(R.layout.expandable_list_layout,container,false);
    eListView=(PullToRefreshExpandableListView)V.findViewById(R.id.expandableListView);
    eListView.setGroupIndicator(null);
    eListView.setShowIndicator(false);
    eListView.setOnRefreshListener(new OnRefreshListener<BlockingExpandableListView>(){
      @Override public void onRefresh(      PullToRefreshBase<BlockingExpandableListView> refreshView){
        StartSync();
      }
    }
);
    eListView.setOnChildClickListener(onChildClickListener);
    View empty=inflater.inflate(R.layout.subscription_detail_list_item_empty,null,false);
    getActivity().addContentView(empty,new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
    eListView.setEmptyView(empty);
    eListView.setExpandableAdapter(lvAdapter);
    SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
    if (mPrefs.getBoolean(SettingsActivity.CB_SYNCONSTARTUP_STRING,false))     StartSync();
  }
  return V;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View V=null;
  if (isTwoPaneMode() || isAdded()) {
    V=inflater.inflate(R.layout.expandable_list_layout,container,false);
    eListView=(PullToRefreshExpandableListView)V.findViewById(R.id.expandableListView);
    eListView.setGroupIndicator(null);
    eListView.setShowIndicator(false);
    eListView.setOnRefreshListener(new OnRefreshListener<BlockingExpandableListView>(){
      @Override public void onRefresh(      PullToRefreshBase<BlockingExpandableListView> refreshView){
        StartSync();
      }
    }
);
    eListView.setOnChildClickListener(onChildClickListener);
    View empty=inflater.inflate(R.layout.subscription_detail_list_item_empty,null,false);
    getActivity().addContentView(empty,new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
    eListView.setEmptyView(empty);
    eListView.setExpandableAdapter(lvAdapter);
    SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
    if (mPrefs.getBoolean(SettingsActivity.CB_SYNCONSTARTUP_STRING,false))     StartSync();
  }
  return V;
}
Program: 26207
Project: 26207
Buggy source:
@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  dbConn.updateIsReadOfItem(idItemDb,isChecked);
  UpdateListCursor(mContext);
  pDelayHandler.DelayTimer();
  RobotoTextView textView=(RobotoTextView)view.findViewById(R.id.summary);
  if (textView != null) {
    if (isChecked)     textView.setTextAppearance(mContext,R.style.RobotoFontStyle);
 else     textView.setTextAppearance(mContext,R.style.RobotoFontStyleBold);
  }
}

Fixed version (ground truth):
@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  dbConn.updateIsReadOfItem(idItemDb,isChecked);
  UpdateListCursor(mContext);
  pDelayHandler.DelayTimer();
  RobotoTextView textView=(RobotoTextView)view.findViewById(R.id.summary);
  if (textView != null) {
    if (isChecked)     textView.setTextAppearance(mContext,R.style.RobotoFontStyle);
 else     textView.setTextAppearance(mContext,R.style.RobotoFontStyleBold);
    textView.invalidate();
  }
}
Program: 26208
Project: 26208
Buggy source:
public void onClick(DialogInterface dialog,int id){
  StartDownloadingImages();
}

Fixed version (ground truth):
public void onClick(DialogInterface dialog,int id){
}
Program: 26209
Project: 26209
Buggy source:
private void StartDownloadingImages(){
  DatabaseConnection dbConn=new DatabaseConnection(context);
  try {
    Intent service=new Intent(context,DownloadImagesService.class);
    service.putExtra(DownloadImagesService.LAST_ITEM_ID,highestItemIdBeforeSync);
    context.startService(service);
  }
  finally {
    dbConn.closeDatabase();
  }
}

Fixed version (ground truth):
private void StartDownloadingImages(Context context){
  DatabaseConnection dbConn=new DatabaseConnection(context);
  try {
    Intent service=new Intent(context,DownloadImagesService.class);
    service.putExtra(DownloadImagesService.LAST_ITEM_ID,highestItemIdBeforeSync);
    context.startService(service);
  }
  finally {
    dbConn.closeDatabase();
  }
}
Program: 26210
Project: 26210
Buggy source:
@Override protected void onPostExecute(Object ex){
  for (  OnAsyncTaskCompletedListener listenerInstance : listener) {
    if (listenerInstance != null)     listenerInstance.onAsyncTaskCompleted(task_id,ex);
  }
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(context);
  if (mPrefs.getBoolean(SettingsActivity.CB_CACHE_IMAGES_OFFLINE_STRING,false)) {
    if (!NetworkConnection.isWLANConnected(context) && NetworkConnection.isNetworkAvailable(context))     ShowDownloadImageWithoutWifiQuestion();
 else     if (NetworkConnection.isNetworkAvailable(context))     StartDownloadingImages();
  }
  detach();
}

Fixed version (ground truth):
@Override protected void onPostExecute(Object ex){
  for (  OnAsyncTaskCompletedListener listenerInstance : listener) {
    if (listenerInstance != null)     listenerInstance.onAsyncTaskCompleted(task_id,ex);
  }
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(context);
  if (mPrefs.getBoolean(SettingsActivity.CB_CACHE_IMAGES_OFFLINE_STRING,false)) {
    if (!NetworkConnection.isWLANConnected(context) && NetworkConnection.isNetworkAvailable(context))     ShowDownloadImageWithoutWifiQuestion();
 else     if (NetworkConnection.isNetworkAvailable(context))     StartDownloadingImages(context);
  }
  detach();
}
Program: 26211
Project: 26211
Buggy source:
private void ShowDownloadImageWithoutWifiQuestion(){
  AlertDialog.Builder alertDialogBuilder=new AlertDialog.Builder(context);
  alertDialogBuilder.setTitle(context.getString(R.string.no_wifi_available));
  alertDialogBuilder.setMessage(context.getString(R.string.do_you_want_to_download_without_wifi)).setCancelable(true).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      StartDownloadingImages();
    }
  }
);
  AlertDialog alertDialog=alertDialogBuilder.create();
  alertDialog.show();
}

Fixed version (ground truth):
private void ShowDownloadImageWithoutWifiQuestion(){
  final Context contextDownloadImage=this.context;
  AlertDialog.Builder alertDialogBuilder=new AlertDialog.Builder(context);
  alertDialogBuilder.setTitle(contextDownloadImage.getString(R.string.no_wifi_available));
  alertDialogBuilder.setMessage(contextDownloadImage.getString(R.string.do_you_want_to_download_without_wifi)).setCancelable(true).setPositiveButton(contextDownloadImage.getString(android.R.string.yes),new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      StartDownloadingImages(contextDownloadImage);
    }
  }
).setNegativeButton(contextDownloadImage.getString(android.R.string.no),new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
    }
  }
);
  AlertDialog alertDialog=alertDialogBuilder.create();
  alertDialog.show();
}
Program: 26212
Project: 26212
Buggy source:
public void StartSync(){
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  if (mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING,null) == null) {
    NewsReaderListActivity nla=(NewsReaderListActivity)getActivity();
    nla.StartLoginFragment();
  }
 else {
    if (!_Reader.isSyncRunning()) {
      OwnCloud_Reader ocReader=(OwnCloud_Reader)_Reader;
      ocReader.Start_AsyncTask_GetVersion(Constants.TaskID_GetVersion,getActivity(),onAsyncTask_GetVersionFinished,username,password);
    }
 else     _Reader.attachToRunningTask(-10,getActivity(),onAsyncTask_GetVersionFinished);
  }
  UpdateSyncButtonLayout();
}

Fixed version (ground truth):
public void StartSync(){
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  if (mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING,null) == null) {
    NewsReaderListActivity nla=(NewsReaderListActivity)getActivity();
    nla.StartLoginFragment();
  }
 else {
    if (!_Reader.isSyncRunning()) {
      new PostDelayHandler(getActivity()).stopRunningPostDelayHandler();
      OwnCloud_Reader ocReader=(OwnCloud_Reader)_Reader;
      ocReader.Start_AsyncTask_GetVersion(Constants.TaskID_GetVersion,getActivity(),onAsyncTask_GetVersionFinished,username,password);
    }
 else     _Reader.attachToRunningTask(-10,getActivity(),onAsyncTask_GetVersionFinished);
  }
  UpdateSyncButtonLayout();
}
Program: 26213
Project: 26213
Buggy source:
public PostDelayHandler(Context context){
  handlerTimer=new Handler();
  this.context=context;
}

Fixed version (ground truth):
public PostDelayHandler(Context context){
  if (handlerTimer == null)   handlerTimer=new Handler();
  this.context=context;
}
Program: 26215
Project: 26215
Buggy source:
@SuppressLint("String_Node_Str") public static int performTagChangeRequest(String urlString,String username,String password,Context context,String content) throws Exception {
  URL url=new URL(urlString);
  DefaultHttpClient httpClient;
  SharedPreferences sp=PreferenceManager.getDefaultSharedPreferences(context);
  if (sp.getBoolean(SettingsActivity.CB_ALLOWALLSSLCERTIFICATES_STRING,false) && url.getProtocol().toLowerCase().equals("String_Node_Str"))   httpClient=new SSLHttpClient(context);
 else   httpClient=new DefaultHttpClient();
  if (username != null && password != null)   httpClient.getCredentialsProvider().setCredentials(new AuthScope(null,-1),new UsernamePasswordCredentials(username,password));
  HttpPut request=new HttpPut(url.toString());
  request.setEntity(new StringEntity(content));
  request.addHeader("String_Node_Str","String_Node_Str");
  HttpResponse response=httpClient.execute(request);
  return response.getStatusLine().getStatusCode();
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") public static int performTagChangeRequest(String urlString,String username,String password,Context context,String content) throws Exception {
  URL url=new URL(urlString);
  HttpURLConnection urlConnection=getUrlConnection(url,context,username,password);
  urlConnection.setDoOutput(true);
  urlConnection.setRequestMethod("String_Node_Str");
  urlConnection.setRequestProperty("String_Node_Str","String_Node_Str");
  if (content != null) {
    OutputStreamWriter out=new OutputStreamWriter(urlConnection.getOutputStream());
    out.write(content);
    out.close();
  }
  return urlConnection.getResponseCode();
}
Program: 26216
Project: 26216
Buggy source:
@Override public void logout(RestClient client) throws JiraException {
}

Fixed version (ground truth):
public void logout(RestClient client) throws JiraException {
}
Program: 26217
Project: 26217
Buggy source:
/** 
 * Sets the Authorization header for the given request.
 * @param req HTTP request to authenticate
 */
public void authenticate(HttpRequest req){
  Credentials creds=new UsernamePasswordCredentials(username,password);
  req.addHeader(new BasicScheme().authenticate(creds,"String_Node_Str",false));
}

Fixed version (ground truth):
/** 
 * Sets the Authorization header for the given request.
 * @param req HTTP request to authenticate
 */
public void authenticate(HttpRequest req){
  Credentials creds=new UsernamePasswordCredentials(username,password);
  req.addHeader(BasicScheme.authenticate(creds,"String_Node_Str",false));
}
Program: 26218
Project: 26218
Buggy source:
@Override public void initialize(RestClient client) throws JiraException {
}

Fixed version (ground truth):
public void initialize(RestClient client) throws JiraException {
}
Program: 26219
Project: 26219
Buggy source:
@Override public void logout(RestClient client) throws JiraException {
  if (token != null) {
    try {
      client.delete(Resource.getAuthUri() + "String_Node_Str");
    }
 catch (    Exception e) {
      throw new JiraException("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public void logout(RestClient client) throws JiraException {
  if (token != null) {
    try {
      client.delete(Resource.getAuthUri() + "String_Node_Str");
    }
 catch (    Exception e) {
      throw new JiraException("String_Node_Str",e);
    }
  }
}
Program: 26220
Project: 26220
Buggy source:
@Override public void initialize(RestClient client) throws JiraException {
  if (token == null) {
    try {
      JSONObject req=new JSONObject();
      req.put("String_Node_Str",username);
      req.put("String_Node_Str",password);
      JSON json=client.post(Resource.getAuthUri() + "String_Node_Str",req);
      System.out.println(json.toString());
    }
 catch (    Exception ex) {
      throw new JiraException("String_Node_Str",ex);
    }
  }
}

Fixed version (ground truth):
public void initialize(RestClient client) throws JiraException {
  if (token == null) {
    try {
      JSONObject req=new JSONObject();
      req.put("String_Node_Str",username);
      req.put("String_Node_Str",password);
      JSON json=client.post(Resource.getAuthUri() + "String_Node_Str",req);
      System.out.println(json.toString());
    }
 catch (    Exception ex) {
      throw new JiraException("String_Node_Str",ex);
    }
  }
}
Program: 26221
Project: 26221
Buggy source:
private Transition getTransition(String id,boolean name) throws JiraException {
  Transition result=null;
  for (  Transition transition : transitions) {
    if ((name && id.equals(transition.getName()) || (!name && id.equals(transition.getId())))) {
      result=transition;
    }
  }
  if (result == null) {
    final String allTransitionNames=Arrays.toString(transitions.toArray());
    throw new JiraException("String_Node_Str" + name + "String_Node_Str"+ allTransitionNames);
  }
  return result;
}

Fixed version (ground truth):
private Transition getTransition(String id,boolean isName) throws JiraException {
  Transition result=null;
  for (  Transition transition : transitions) {
    if ((isName && id.equals(transition.getName()) || (!isName && id.equals(transition.getId())))) {
      result=transition;
    }
  }
  if (result == null) {
    final String allTransitionNames=Arrays.toString(transitions.toArray());
    throw new JiraException("String_Node_Str" + id + "String_Node_Str"+ allTransitionNames);
  }
  return result;
}
Program: 26222
Project: 26222
Buggy source:
private void deserialise(JSONObject json){
  Map map=json;
  self=Field.getString(map.get("String_Node_Str"));
  id=Field.getString(map.get("String_Node_Str"));
  type=Field.getResource(LinkType.class,map.get("String_Node_Str"),restclient);
  inwardIssue=Field.getResource(Issue.class,map.get("String_Node_Str"),restclient);
}

Fixed version (ground truth):
private void deserialise(JSONObject json){
  Map map=json;
  self=Field.getString(map.get("String_Node_Str"));
  id=Field.getString(map.get("String_Node_Str"));
  type=Field.getResource(LinkType.class,map.get("String_Node_Str"),restclient);
  outwardIssue=Field.getResource(Issue.class,map.get("String_Node_Str"),restclient);
}
Program: 26223
Project: 26223
Buggy source:
@Override public String toString(){
  return String.format("String_Node_Str",getType().getInward(),getInwardIssue());
}

Fixed version (ground truth):
@Override public String toString(){
  return String.format("String_Node_Str",getType().getInward(),getOutwardIssue());
}
Program: 26224
Project: 26224
Buggy source:
@Override public String getPullRequest(){
  return getProperty(SHIPPABLE_PULL_REQUEST);
}

Fixed version (ground truth):
@Override public String getPullRequest(){
  String pullRequest=getProperty(SHIPPABLE_PULL_REQUEST);
  if ("String_Node_Str".equals(pullRequest)) {
    return null;
  }
  return pullRequest;
}
Program: 26225
Project: 26225
Buggy source:
private Map<String,String> env(){
  Map<String,String> env=new HashMap<String,String>();
  env.put(Shippable.SHIPPABLE,"String_Node_Str");
  env.put(Shippable.SHIPPABLE_BUILD_ID,"String_Node_Str");
  env.put(Shippable.SHIPPABLE_BUILD_NUMBER,"String_Node_Str");
  env.put(Shippable.SHIPPABLE_BRANCH,"String_Node_Str");
  env.put(Shippable.SHIPPABLE_COMMIT,"String_Node_Str");
  return env;
}

Fixed version (ground truth):
private Map<String,String> env(){
  Map<String,String> env=new HashMap<String,String>();
  env.put(Shippable.SHIPPABLE,"String_Node_Str");
  env.put(Shippable.SHIPPABLE_BUILD_ID,"String_Node_Str");
  env.put(Shippable.SHIPPABLE_BUILD_NUMBER,"String_Node_Str");
  env.put(Shippable.SHIPPABLE_BRANCH,"String_Node_Str");
  env.put(Shippable.SHIPPABLE_COMMIT,"String_Node_Str");
  env.put(Shippable.SHIPPABLE_PULL_REQUEST,"String_Node_Str");
  return env;
}
Program: 26226
Project: 26226
Buggy source:
@Nullable private CacheItem getFromDiskCache(final String url,boolean checkExpiration){
  CacheItem result=null;
  if (mDiskCache == null) {
    return null;
  }
  checkNotOnMainThread();
  try {
    final String key=transformUrlForDiskCacheKey(url);
    DiskLruCache.Snapshot snapshot=mDiskCache.get(key);
    if (null != snapshot) {
      Object value=readValueFromDisk(snapshot.getInputStream(0));
      DateTime expiresAt=new DateTime(readExpirationFromDisk(snapshot.getInputStream(1)));
      if (value != null) {
        if (checkExpiration && expiresAt.isBeforeNow()) {
          mDiskCache.remove(key);
          scheduleDiskCacheFlush();
        }
 else {
          result=new CacheItem(value,expiresAt);
          if (null != mMemoryCache) {
            mMemoryCache.put(url,result);
          }
        }
      }
 else {
        mDiskCache.remove(key);
        scheduleDiskCacheFlush();
      }
    }
  }
 catch (  Exception e) {
    Timber.e(e,"String_Node_Str",url);
  }
  return result;
}

Fixed version (ground truth):
@Nullable private CacheItem getFromDiskCache(final String url,boolean checkExpiration){
  CacheItem result=null;
  if (mDiskCache == null) {
    return null;
  }
  checkNotOnMainThread();
  try {
    final String key=transformUrlForDiskCacheKey(url);
    DiskLruCache.Snapshot snapshot=mDiskCache.get(key);
    if (null != snapshot) {
      Object value=readValueFromDisk(snapshot.getInputStream(0));
      DateTime expiresAt=new DateTime(readExpirationFromDisk(snapshot.getInputStream(1)));
      if (value != null) {
        if (checkExpiration && expiresAt.isBeforeNow()) {
          mDiskCache.remove(key);
          scheduleDiskCacheFlush();
        }
 else {
          result=new CacheItem(value,expiresAt);
          if (null != mMemoryCache) {
            mMemoryCache.put(url,result);
          }
        }
      }
 else {
        mDiskCache.remove(key);
        scheduleDiskCacheFlush();
      }
    }
  }
 catch (  Exception e) {
    Timber.e(e,"String_Node_Str",url);
    remove(url);
  }
  return result;
}
Program: 26227
Project: 26227
Buggy source:
ModelCache(){
  mGson=new GsonBuilder().registerTypeAdapter(DateTime.class,new DateTimeDeserializer()).registerTypeAdapter(DateTime.class,new DateTimeSerializer()).create();
}

Fixed version (ground truth):
ModelCache(){
  mGson=new GsonBuilder().registerTypeAdapter(DateTime.class,new ModelCacheDateTimeDeserializer()).registerTypeAdapter(DateTime.class,new ModelCacheDateTimeSerializer()).create();
}