Program: 26193
Project: 26193
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  String idFeed=getIdCurrentFeed(currentPosition);
  Cursor cursor=dbConn.getArticleByID(idFeed);
switch (item.getItemId()) {
case android.R.id.home:
    super.onBackPressed();
  break;
case R.id.action_starred:
String idItem_Db=getIdCurrentFeed(currentPosition);
Boolean curState=dbConn.isFeedUnreadStarred(idItem_Db,false);
dbConn.updateIsStarredOfItem(idItem_Db,!curState);
UpdateActionBarIcons();
pDelayHandler.DelayTimer();
List<String> idItems=new ArrayList<String>();
cursor.moveToFirst();
idItems.add(cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_RSSITEM_ID)));
cursor.close();
break;
case R.id.action_openInBrowser:
String link="String_Node_Str";
if (cursor != null) {
cursor.moveToFirst();
link=cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_LINK));
cursor.close();
}
if (link.trim().length() > 0) {
Intent browserIntent=new Intent(Intent.ACTION_VIEW,Uri.parse(link));
startActivity(browserIntent);
}
break;
case R.id.action_ShareItem:
String title="String_Node_Str";
String linkToItem="String_Node_Str";
if (cursor != null) {
cursor.moveToFirst();
title=cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_TITLE));
linkToItem=cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_LINK));
cursor.close();
}
Intent share=new Intent(Intent.ACTION_SEND);
share.setType("String_Node_Str");
share.putExtra(Intent.EXTRA_SUBJECT,title);
share.putExtra(Intent.EXTRA_TEXT,linkToItem);
startActivity(Intent.createChooser(share,"String_Node_Str"));
break;
case R.id.action_read:
if (cursor != null) {
cursor.moveToFirst();
String id=cursor.getString(0);
markItemAsReadUnread(id,!menuItem_Read.isChecked());
cursor.close();
}
UpdateActionBarIcons();
pDelayHandler.DelayTimer();
break;
}
return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  String idFeed=getIdCurrentFeed(currentPosition);
  Cursor cursor=dbConn.getArticleByID(idFeed);
switch (item.getItemId()) {
case android.R.id.home:
    super.onBackPressed();
  break;
case R.id.action_starred:
String idItem_Db=getIdCurrentFeed(currentPosition);
Boolean curState=dbConn.isFeedUnreadStarred(idItem_Db,false);
dbConn.updateIsStarredOfItem(idItem_Db,!curState);
UpdateActionBarIcons();
pDelayHandler.DelayTimer();
List<String> idItems=new ArrayList<String>();
cursor.moveToFirst();
idItems.add(cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_RSSITEM_ID)));
cursor.close();
break;
case R.id.action_openInBrowser:
String link="String_Node_Str";
if (cursor != null) {
cursor.moveToFirst();
link=cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_LINK));
cursor.close();
}
if (link.trim().length() > 0) {
Intent browserIntent=new Intent(Intent.ACTION_VIEW,Uri.parse(link));
startActivity(browserIntent);
}
break;
case R.id.action_ShareItem:
String title="String_Node_Str";
String content="String_Node_Str";
if (cursor != null) {
cursor.moveToFirst();
title=cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_TITLE));
content=cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_LINK));
cursor.close();
}
NewsDetailFragment fragment=(NewsDetailFragment)getSupportFragmentManager().findFragmentByTag("String_Node_Str" + R.id.pager + "String_Node_Str"+ currentPosition);
if (fragment != null) {
if (!fragment.webview.getUrl().equals("String_Node_Str")) {
content=fragment.webview.getUrl();
title=fragment.webview.getTitle();
}
}
content+="String_Node_Str";
Intent share=new Intent(Intent.ACTION_SEND);
share.setType("String_Node_Str");
share.putExtra(Intent.EXTRA_SUBJECT,title);
share.putExtra(Intent.EXTRA_TEXT,content);
startActivity(Intent.createChooser(share,"String_Node_Str"));
break;
case R.id.action_read:
if (cursor != null) {
cursor.moveToFirst();
String id=cursor.getString(0);
markItemAsReadUnread(id,!menuItem_Read.isChecked());
cursor.close();
}
UpdateActionBarIcons();
pDelayHandler.DelayTimer();
break;
}
return super.onOptionsItemSelected(item);
}