Program: 29785
Project: 29785
Buggy source:
/** 
 * Get sitemaps from openHAB, if user already configured preffered sitemap just open it. If no preffered sitemap is configured - let user select one.
 * @param baseUrl  an absolute base URL of openHAB to open
 * @return      void
 */
private void selectSitemap(final String baseURL,final boolean forceSelect){
  Log.i(TAG,"String_Node_Str" + baseURL + "String_Node_Str");
  AsyncHttpClient asyncHttpClient=new MyAsyncHttpClient();
  asyncHttpClient.setBasicAuthCredientidals(openHABUsername,openHABPassword);
  asyncHttpClient.get(baseURL + "String_Node_Str",new AsyncHttpResponseHandler(){
    @Override public void onSuccess(    String content){
      List<OpenHABSitemap> sitemapList=parseSitemapList(content);
      if (sitemapList.size() == 0) {
        showAlertDialog("String_Node_Str");
        return;
      }
      if (forceSelect) {
        showSitemapSelectionDialog(sitemapList);
      }
 else {
        SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(OpenHABWidgetListActivity.this);
        String configuredSitemap=settings.getString("String_Node_Str","String_Node_Str");
        if (configuredSitemap.length() > 0) {
          if (sitemapExists(sitemapList,configuredSitemap)) {
            Log.i(TAG,"String_Node_Str");
            OpenHABSitemap selectedSitemap=getSitemapByName(sitemapList,configuredSitemap);
            openSitemap(selectedSitemap.getHomepageLink());
          }
 else {
            Log.i(TAG,"String_Node_Str");
            if (sitemapList.size() == 1) {
              Log.i(TAG,"String_Node_Str");
              Editor preferencesEditor=settings.edit();
              preferencesEditor.putString("String_Node_Str",sitemapList.get(0).getName());
              preferencesEditor.commit();
              openSitemap(sitemapList.get(0).getHomepageLink());
            }
 else {
              Log.i(TAG,"String_Node_Str");
              showSitemapSelectionDialog(sitemapList);
            }
          }
        }
 else {
          if (sitemapList.size() == 1) {
            Log.i(TAG,"String_Node_Str");
            Editor preferencesEditor=settings.edit();
            preferencesEditor.putString("String_Node_Str",sitemapList.get(0).getName());
            preferencesEditor.commit();
            openSitemap(sitemapList.get(0).getHomepageLink());
          }
 else {
            Log.i(TAG,"String_Node_Str");
            showSitemapSelectionDialog(sitemapList);
          }
        }
      }
    }
    @Override public void onFailure(    Throwable e){
      if (e.getMessage() != null) {
        if (e.getMessage().equals("String_Node_Str")) {
          showAlertDialog("String_Node_Str");
        }
 else {
          showAlertDialog("String_Node_Str" + e.getMessage());
        }
      }
 else {
        showAlertDialog("String_Node_Str");
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Get sitemaps from openHAB, if user already configured preffered sitemap just open it. If no preffered sitemap is configured - let user select one.
 * @param baseUrl  an absolute base URL of openHAB to open
 * @return      void
 */
private void selectSitemap(final String baseURL,final boolean forceSelect){
  Log.i(TAG,"String_Node_Str" + baseURL + "String_Node_Str");
  AsyncHttpClient asyncHttpClient=new MyAsyncHttpClient();
  asyncHttpClient.setBasicAuthCredientidals(openHABUsername,openHABPassword);
  asyncHttpClient.get(baseURL + "String_Node_Str",new AsyncHttpResponseHandler(){
    @Override public void onSuccess(    String content){
      List<OpenHABSitemap> sitemapList=parseSitemapList(content);
      if (sitemapList.size() == 0) {
        showAlertDialog("String_Node_Str");
        return;
      }
      if (forceSelect) {
        showSitemapSelectionDialog(sitemapList);
      }
 else {
        SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(OpenHABWidgetListActivity.this);
        String configuredSitemap=settings.getString("String_Node_Str","String_Node_Str");
        if (configuredSitemap.length() > 0) {
          if (sitemapExists(sitemapList,configuredSitemap)) {
            Log.i(TAG,"String_Node_Str");
            OpenHABSitemap selectedSitemap=getSitemapByName(sitemapList,configuredSitemap);
            openSitemap(selectedSitemap.getHomepageLink());
          }
 else {
            Log.i(TAG,"String_Node_Str");
            if (sitemapList.size() == 1) {
              Log.i(TAG,"String_Node_Str");
              Editor preferencesEditor=settings.edit();
              preferencesEditor.putString("String_Node_Str",sitemapList.get(0).getName());
              preferencesEditor.commit();
              openSitemap(sitemapList.get(0).getHomepageLink());
            }
 else {
              Log.i(TAG,"String_Node_Str");
              showSitemapSelectionDialog(sitemapList);
            }
          }
        }
 else {
          if (sitemapList.size() == 1) {
            Log.i(TAG,"String_Node_Str");
            Editor preferencesEditor=settings.edit();
            preferencesEditor.putString("String_Node_Str",sitemapList.get(0).getName());
            preferencesEditor.commit();
            openSitemap(sitemapList.get(0).getHomepageLink());
          }
 else {
            Log.i(TAG,"String_Node_Str");
            showSitemapSelectionDialog(sitemapList);
          }
        }
      }
    }
    @Override public void onFailure(    Throwable e){
      if (e.getMessage() != null) {
        if (e.getMessage().equals("String_Node_Str")) {
          showAlertDialog("String_Node_Str");
        }
 else {
          showAlertDialog("String_Node_Str" + e.getMessage());
        }
      }
 else {
      }
    }
  }
);
}