Program: 29787
Project: 29787
Buggy source:
/** 
 * Parse XML sitemap page and show it
 * @param content	XML as a text
 * @return      void
 */
public void processContent(String content){
  DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
  try {
    DocumentBuilder builder=factory.newDocumentBuilder();
    Document document;
    openHABWidgetAdapter.stopVideoWidgets();
    openHABWidgetAdapter.stopImageRefresh();
    if (content != null) {
      document=builder.parse(new ByteArrayInputStream(content.getBytes("String_Node_Str")));
    }
 else {
      Log.i(TAG,"String_Node_Str");
      return;
    }
    Node rootNode=document.getFirstChild();
    openHABWidgetDataSource.setSourceNode(rootNode);
    widgetList.clear();
    for (    OpenHABWidget w : openHABWidgetDataSource.getWidgets()) {
      widgetList.add(w);
    }
    openHABWidgetAdapter.notifyDataSetChanged();
    setTitle(openHABWidgetDataSource.getTitle());
    setProgressBarIndeterminateVisibility(false);
    getListView().setOnItemClickListener(new OnItemClickListener(){
      @Override public void onItemClick(      AdapterView<?> parent,      View view,      int position,      long id){
        Log.i(TAG,"String_Node_Str" + String.valueOf(position));
        OpenHABWidget openHABWidget=openHABWidgetAdapter.getItem(position);
        if (openHABWidget.hasLinkedPage()) {
          pageStack.add(0,new OpenHABPage(displayPageUrl,OpenHABWidgetListActivity.this.getListView().getFirstVisiblePosition()));
          displayPageUrl=openHABWidget.getLinkedPage().getLink();
          showPage(openHABWidget.getLinkedPage().getLink(),false);
        }
      }
    }
);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  showPage(displayPageUrl,true);
}

Fixed version (ground truth):
/** 
 * Parse XML sitemap page and show it
 * @param content	XML as a text
 * @return      void
 */
public void processContent(String content){
  DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
  try {
    DocumentBuilder builder=factory.newDocumentBuilder();
    Document document;
    openHABWidgetAdapter.stopVideoWidgets();
    openHABWidgetAdapter.stopImageRefresh();
    if (content != null) {
      document=builder.parse(new ByteArrayInputStream(content.getBytes("String_Node_Str")));
    }
 else {
      Log.i(TAG,"String_Node_Str");
      return;
    }
    Node rootNode=document.getFirstChild();
    openHABWidgetDataSource.setSourceNode(rootNode);
    widgetList.clear();
    for (    OpenHABWidget w : openHABWidgetDataSource.getWidgets()) {
      widgetList.add(w);
    }
    openHABWidgetAdapter.notifyDataSetChanged();
    setTitle(openHABWidgetDataSource.getTitle());
    setProgressBarIndeterminateVisibility(false);
    getListView().setSelection(this.widgetListPosition);
    getListView().setOnItemClickListener(new OnItemClickListener(){
      @Override public void onItemClick(      AdapterView<?> parent,      View view,      int position,      long id){
        Log.i(TAG,"String_Node_Str" + String.valueOf(position));
        OpenHABWidget openHABWidget=openHABWidgetAdapter.getItem(position);
        if (openHABWidget.hasLinkedPage()) {
          pageStack.add(0,new OpenHABPage(displayPageUrl,OpenHABWidgetListActivity.this.getListView().getFirstVisiblePosition()));
          displayPageUrl=openHABWidget.getLinkedPage().getLink();
          showPage(openHABWidget.getLinkedPage().getLink(),false);
        }
      }
    }
);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  this.widgetListPosition=0;
  showPage(displayPageUrl,true);
}