Program: 29744
Project: 29744
Buggy source:
/** 
 * Parse XML sitemap page and show it
 * @param document	XML Document
 * @return      void
 */
public void processContent(Document document,boolean longPolling){
  openHABWidgetAdapter.stopVideoWidgets();
  openHABWidgetAdapter.stopImageRefresh();
  Node rootNode=document.getFirstChild();
  openHABWidgetDataSource.setSourceNode(rootNode);
  widgetList.clear();
  for (  OpenHABWidget w : openHABWidgetDataSource.getWidgets()) {
    if (w.getType().equals("String_Node_Str") && TextUtils.isEmpty(w.getLabel()))     continue;
    widgetList.add(w);
  }
  openHABWidgetAdapter.notifyDataSetChanged();
  if (!longPolling) {
    getListView().clearChoices();
    Log.d(TAG,String.format("String_Node_Str",mCurrentSelectedItem));
    if (mCurrentSelectedItem >= 0)     getListView().setItemChecked(mCurrentSelectedItem,true);
  }
  if (getActivity() != null && mIsVisible)   getActivity().setTitle(openHABWidgetDataSource.getTitle());
  if (this.nfcWidgetId != null && this.nfcCommand != null) {
    Log.d(TAG,"String_Node_Str");
    OpenHABWidget nfcWidget=this.openHABWidgetDataSource.getWidgetById(this.nfcWidgetId);
    OpenHABItem nfcItem=nfcWidget.getItem();
    if (nfcWidget != null && nfcItem != null) {
      if (this.nfcCommand.equals("String_Node_Str")) {
        if (nfcItem.getType().equals("String_Node_Str")) {
          if (nfcItem.getStateAsBoolean())           this.openHABWidgetAdapter.sendItemCommand(nfcItem,"String_Node_Str");
 else           this.openHABWidgetAdapter.sendItemCommand(nfcItem,"String_Node_Str");
        }
 else {
          if (nfcItem.getStateAsBoolean())           this.openHABWidgetAdapter.sendItemCommand(nfcItem,"String_Node_Str");
 else           this.openHABWidgetAdapter.sendItemCommand(nfcItem,"String_Node_Str");
        }
      }
 else {
        this.openHABWidgetAdapter.sendItemCommand(nfcItem,this.nfcCommand);
      }
    }
    this.nfcWidgetId=null;
    this.nfcCommand=null;
    if (this.nfcAutoClose) {
      getActivity().finish();
    }
  }
  showPage(displayPageUrl,true);
}

Fixed version (ground truth):
/** 
 * Parse XML sitemap page and show it
 * @param document	XML Document
 * @return      void
 */
public void processContent(Document document,boolean longPolling){
  openHABWidgetAdapter.stopVideoWidgets();
  openHABWidgetAdapter.stopImageRefresh();
  Node rootNode=document.getFirstChild();
  openHABWidgetDataSource.setSourceNode(rootNode);
  widgetList.clear();
  for (  OpenHABWidget w : openHABWidgetDataSource.getWidgets()) {
    if (w.getType().equals("String_Node_Str") && TextUtils.isEmpty(w.getLabel()))     continue;
    widgetList.add(w);
  }
  openHABWidgetAdapter.notifyDataSetChanged();
  if (!longPolling && isAdded()) {
    getListView().clearChoices();
    Log.d(TAG,String.format("String_Node_Str",mCurrentSelectedItem));
    if (mCurrentSelectedItem >= 0)     getListView().setItemChecked(mCurrentSelectedItem,true);
  }
  if (getActivity() != null && mIsVisible)   getActivity().setTitle(openHABWidgetDataSource.getTitle());
  if (this.nfcWidgetId != null && this.nfcCommand != null) {
    Log.d(TAG,"String_Node_Str");
    OpenHABWidget nfcWidget=this.openHABWidgetDataSource.getWidgetById(this.nfcWidgetId);
    OpenHABItem nfcItem=nfcWidget.getItem();
    if (nfcWidget != null && nfcItem != null) {
      if (this.nfcCommand.equals("String_Node_Str")) {
        if (nfcItem.getType().equals("String_Node_Str")) {
          if (nfcItem.getStateAsBoolean())           this.openHABWidgetAdapter.sendItemCommand(nfcItem,"String_Node_Str");
 else           this.openHABWidgetAdapter.sendItemCommand(nfcItem,"String_Node_Str");
        }
 else {
          if (nfcItem.getStateAsBoolean())           this.openHABWidgetAdapter.sendItemCommand(nfcItem,"String_Node_Str");
 else           this.openHABWidgetAdapter.sendItemCommand(nfcItem,"String_Node_Str");
        }
      }
 else {
        this.openHABWidgetAdapter.sendItemCommand(nfcItem,this.nfcCommand);
      }
    }
    this.nfcWidgetId=null;
    this.nfcCommand=null;
    if (this.nfcAutoClose) {
      getActivity().finish();
    }
  }
  showPage(displayPageUrl,true);
}