Program: 15240
Project: 15240
Buggy source:
private void getStatsData(String apiKey,String blogID,final String reportType,int interval){
  if (isFinishing()) {
    finish();
  }
  String DATE_FORMAT="String_Node_Str";
  SimpleDateFormat sdf=new SimpleDateFormat(DATE_FORMAT);
  Calendar c1=Calendar.getInstance();
  String period="String_Node_Str";
  if (interval == 90) {
    period="String_Node_Str";
    interval=12;
  }
 else   if (interval == 365) {
    period="String_Node_Str";
    interval=11;
  }
 else   if (interval == -1) {
    period="String_Node_Str";
  }
  String uriString="String_Node_Str" + "String_Node_Str" + apiKey + "String_Node_Str"+ blogID+ "String_Node_Str"+ reportType+ "String_Node_Str"+ sdf.format(c1.getTime())+ "String_Node_Str"+ interval+ "String_Node_Str"+ period;
  vsoURI=uriString;
  if (!reportType.equals("String_Node_Str")) {
    uriString+="String_Node_Str";
  }
  URI uri=URI.create(uriString);
  configureClient(uri,null,null);
  try {
    HttpResponse response;
    response=client.execute(postMethod);
    XmlPullParser pullParser=XmlPullParserFactory.newInstance().newPullParser();
    HttpEntity entity=response.getEntity();
    PushbackInputStream is=new PushbackInputStream(entity.getContent());
    int bomCheck=is.read();
    int stopper=0;
    while (bomCheck != 60 && stopper < 20) {
      bomCheck=is.read();
      stopper++;
    }
    is.unread(bomCheck);
    pullParser.setInput(is,"String_Node_Str");
    int eventType=pullParser.getEventType();
    boolean foundDataItem=false;
    final Vector<HashMap<String,String>> dataSet=new Vector<HashMap<String,String>>();
    final Vector<Integer> numDataSet=new Vector<Integer>();
    int rowCount=0;
    while (eventType != XmlPullParser.END_DOCUMENT) {
      if (eventType == XmlPullParser.START_DOCUMENT) {
      }
 else       if (eventType == XmlPullParser.END_DOCUMENT) {
      }
 else       if (eventType == XmlPullParser.START_TAG) {
        String name=pullParser.getName();
        if (name.equals("String_Node_Str") || name.equals("String_Node_Str") || name.equals("String_Node_Str")|| name.equals("String_Node_Str")|| name.equals("String_Node_Str")|| name.equals("String_Node_Str")) {
        }
 else         if (pullParser.getName().equals("String_Node_Str")) {
          break;
        }
 else {
          foundDataItem=true;
          HashMap<String,String> dataRow=new HashMap<String,String>();
          for (int i=0; i < pullParser.getAttributeCount(); i++) {
            dataRow.put(pullParser.getAttributeName(i).toString(),pullParser.getAttributeValue(i).toString());
          }
          if (dataRow != null) {
            dataSet.add(rowCount,dataRow);
          }
        }
      }
 else       if (eventType == XmlPullParser.END_TAG) {
      }
 else       if (eventType == XmlPullParser.TEXT) {
        if (foundDataItem) {
          if (pullParser.getText().toString() == "String_Node_Str") {
            numDataSet.add(rowCount,0);
          }
 else {
            int value=0;
            try {
              value=Integer.parseInt(pullParser.getText().toString());
            }
 catch (            NumberFormatException e) {
            }
            numDataSet.add(rowCount,value);
          }
          rowCount++;
          foundDataItem=false;
        }
      }
      eventType=pullParser.next();
    }
    if (dataSet.size() > 0) {
      final int intervalT=interval;
      Thread uiThread=new Thread(){
        public void run(){
          RelativeLayout filters=(RelativeLayout)findViewById(R.id.filters);
          filters.setVisibility(View.VISIBLE);
          TextView reportTitle=(TextView)findViewById(R.id.chartTitle);
          reportTitle.setVisibility(View.VISIBLE);
          ImageView iv=(ImageView)findViewById(R.id.chart);
          if (reportType.equals("String_Node_Str")) {
            if (intervalT != 1) {
              iv.setVisibility(View.VISIBLE);
            }
 else {
              iv.setVisibility(View.GONE);
            }
            reportTitle.setText(getResources().getText(R.string.report_views));
            String dataValues="String_Node_Str", dateStrings="String_Node_Str", xLabels="String_Node_Str";
            Object[] key=numDataSet.toArray();
            Arrays.sort(key);
            TableLayout tl=(TableLayout)findViewById(R.id.dataTable);
            tl.removeAllViews();
            LayoutInflater inflater=getLayoutInflater();
            TableRow table_row=(TableRow)inflater.inflate(R.layout.table_row_header,tl,false);
            TextView col_1=(TextView)table_row.findViewById(R.id.col1);
            col_1.setText(getResources().getText(R.string.date));
            col_1.setTypeface(Typeface.DEFAULT_BOLD);
            TextView col_2=(TextView)table_row.findViewById(R.id.col2);
            col_2.setText(getResources().getText(R.string.report_views));
            col_2.setTypeface(Typeface.DEFAULT_BOLD);
            tl.addView(table_row);
            HashMap<?,?> row;
            for (int i=0; i < dataSet.size(); i++) {
              row=(HashMap<?,?>)dataSet.get(i);
              String date;
              try {
                date=row.get("String_Node_Str").toString();
              }
 catch (              Exception e) {
                return;
              }
              String value=numDataSet.get(i).toString();
              dateStrings+=date + "String_Node_Str";
              dataValues+=value + "String_Node_Str";
              if (i == 0)               xLabels+=date + "String_Node_Str";
 else               if (i == (dataSet.size() - 1))               xLabels+=date;
 else               xLabels+="String_Node_Str";
              TableRow tr=(TableRow)inflater.inflate(R.layout.table_row,tl,false);
              TextView col1=(TextView)tr.findViewById(R.id.col1);
              col1.setText(date);
              TextView col2=(TextView)tr.findViewById(R.id.col2);
              col2.setText(value);
              if (i % 2 == 0) {
                tr.setBackgroundColor(Color.parseColor("String_Node_Str"));
              }
              tl.addView(tr);
            }
            int maxValue=Integer.parseInt(key[key.length - 1].toString());
            int minValue=Integer.parseInt(key[0].toString());
            dataValues=dataValues.substring(0,dataValues.length() - 1);
            dateStrings=dateStrings.substring(0,dateStrings.length() - 1);
            long minBuffer=Math.round(minValue - (maxValue * .10));
            if (minBuffer < 0) {
              minBuffer=0;
            }
            long maxBuffer=Math.round(maxValue + (maxValue * .10));
            for (int i=0; i < 9; i++) {
              if (minBuffer % 10 == 0)               break;
 else {
                minBuffer--;
              }
            }
            for (int i=0; i < 9; i++) {
              if (maxBuffer % 10 == 0)               break;
 else {
                maxBuffer++;
              }
            }
            long yInterval=maxBuffer / 10;
            for (int i=0; i < 9; i++) {
              if (yInterval % 10 == 0)               break;
 else {
                yInterval++;
              }
            }
            float xGrid=100.00f / 6;
            if (yInterval == 0) {
              yInterval=1;
            }
            long numRows=(maxBuffer - minBuffer) / yInterval;
            float yGrid=100.00f / numRows;
            Display display=getWindowManager().getDefaultDisplay();
            int width=display.getWidth();
            int height=display.getHeight();
            String screenSize="String_Node_Str";
            if (width > 480 || height > 480) {
              screenSize="String_Node_Str";
            }
            final String chartViewURL="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + dataValues + "String_Node_Str"+ screenSize+ "String_Node_Str"+ "String_Node_Str"+ xLabels+ "String_Node_Str"+ minBuffer+ "String_Node_Str"+ maxBuffer+ "String_Node_Str"+ minBuffer+ "String_Node_Str"+ maxBuffer+ "String_Node_Str"+ yInterval+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ xGrid+ "String_Node_Str"+ yGrid+ "String_Node_Str";
            new statsChartTask().execute(chartViewURL);
          }
 else           if (reportType.equals("String_Node_Str")) {
            reportTitle.setText(getResources().getText(R.string.report_postviews));
            iv.setVisibility(View.GONE);
            Object[] key=numDataSet.toArray();
            Arrays.sort(key);
            TableLayout tl=(TableLayout)findViewById(R.id.dataTable);
            tl.removeAllViews();
            LayoutInflater inflater=getLayoutInflater();
            TableRow table_row=(TableRow)inflater.inflate(R.layout.table_row_header,tl,false);
            TextView col_1=(TextView)table_row.findViewById(R.id.col1);
            col_1.setText(getResources().getText(R.string.report_post_title));
            col_1.setTypeface(Typeface.DEFAULT_BOLD);
            TextView col_2=(TextView)table_row.findViewById(R.id.col2);
            col_2.setText(getResources().getText(R.string.report_views));
            col_2.setTypeface(Typeface.DEFAULT_BOLD);
            tl.addView(table_row);
            HashMap<?,?> row;
            for (int i=0; i < dataSet.size(); i++) {
              row=(HashMap<?,?>)dataSet.get(i);
              String date=row.get("String_Node_Str").toString();
              String value=numDataSet.get(i).toString();
              TableRow tr=(TableRow)inflater.inflate(R.layout.table_row,tl,false);
              TextView col1=(TextView)tr.findViewById(R.id.col1);
              col1.setText(date);
              TextView col2=(TextView)tr.findViewById(R.id.col2);
              col2.setText(value);
              if (i % 2 == 0) {
                tr.setBackgroundColor(Color.parseColor("String_Node_Str"));
              }
              tl.addView(tr);
            }
          }
 else           if (reportType.equals("String_Node_Str") || reportType.equals("String_Node_Str") || reportType.equals("String_Node_Str")) {
            iv.setVisibility(View.GONE);
            Object[] key=numDataSet.toArray();
            Arrays.sort(key);
            TableLayout tl=(TableLayout)findViewById(R.id.dataTable);
            tl.removeAllViews();
            LayoutInflater inflater=getLayoutInflater();
            TableRow table_row=(TableRow)inflater.inflate(R.layout.table_row_header,tl,false);
            TextView col_1=(TextView)table_row.findViewById(R.id.col1);
            if (reportType.equals("String_Node_Str")) {
              col_1.setText(getResources().getText(R.string.report_referrers));
              reportTitle.setText(getResources().getText(R.string.report_referrers));
            }
 else             if (reportType.equals("String_Node_Str")) {
              reportTitle.setText(getResources().getText(R.string.report_searchterms));
              col_1.setText(getResources().getText(R.string.report_searchterms));
            }
 else {
              reportTitle.setText(getResources().getText(R.string.report_clicks));
              col_1.setText(getResources().getText(R.string.report_clicks));
            }
            col_1.setTypeface(Typeface.DEFAULT_BOLD);
            TextView col_2=(TextView)table_row.findViewById(R.id.col2);
            col_2.setText("String_Node_Str");
            col_2.setTypeface(Typeface.DEFAULT_BOLD);
            tl.addView(table_row);
            HashMap<?,?> row;
            for (int i=0; i < dataSet.size(); i++) {
              row=(HashMap<?,?>)dataSet.get(i);
              String date=row.get("String_Node_Str").toString();
              String value=numDataSet.get(i).toString();
              TableRow tr=(TableRow)inflater.inflate(R.layout.table_row,tl,false);
              TextView col1=(TextView)tr.findViewById(R.id.col1);
              col1.setText(date);
              Linkify.addLinks(col1,Linkify.WEB_URLS);
              TextView col2=(TextView)tr.findViewById(R.id.col2);
              col2.setText(value);
              if (i % 2 == 0) {
                tr.setBackgroundColor(Color.parseColor("String_Node_Str"));
              }
              tl.addView(tr);
            }
          }
          if (!isFinishing())           dismissDialog(ID_DIALOG_GET_STATS);
        }
      }
;
      this.runOnUiThread(uiThread);
    }
 else {
      Thread alert=new Thread(){
        public void run(){
          dismissDialog(ID_DIALOG_GET_STATS);
          RelativeLayout filters=(RelativeLayout)findViewById(R.id.filters);
          filters.setVisibility(View.VISIBLE);
          Toast.makeText(ViewStats.this,getResources().getText(R.string.no_data_found),Toast.LENGTH_SHORT).show();
        }
      }
;
      if (!isFinishing()) {
        this.runOnUiThread(alert);
      }
    }
  }
 catch (  ClientProtocolException e) {
    dismissDialog(ID_DIALOG_GET_STATS);
    errorMsg=e.getMessage();
  }
catch (  IllegalStateException e) {
    dismissDialog(ID_DIALOG_GET_STATS);
    errorMsg=e.getMessage();
  }
catch (  IOException e) {
    dismissDialog(ID_DIALOG_GET_STATS);
    errorMsg=e.getMessage();
  }
catch (  XmlPullParserException e) {
    dismissDialog(ID_DIALOG_GET_STATS);
    errorMsg=e.getMessage();
  }
  if (errorMsg != "String_Node_Str") {
    Thread error=new Thread(){
      public void run(){
        AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(ViewStats.this);
        dialogBuilder.setTitle(getResources().getText(R.string.connection_error));
        dialogBuilder.setMessage(errorMsg);
        dialogBuilder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
          public void onClick(          DialogInterface dialog,          int whichButton){
          }
        }
);
        dialogBuilder.setCancelable(true);
        if (!isFinishing()) {
          dialogBuilder.create().show();
        }
      }
    }
;
    this.runOnUiThread(error);
  }
}

Fixed version (ground truth):
private void getStatsData(String apiKey,String blogID,final String reportType,int interval){
  if (isFinishing()) {
    finish();
  }
  String DATE_FORMAT="String_Node_Str";
  SimpleDateFormat sdf=new SimpleDateFormat(DATE_FORMAT);
  Calendar c1=Calendar.getInstance();
  String period="String_Node_Str";
  if (interval == 90) {
    period="String_Node_Str";
    interval=12;
  }
 else   if (interval == 365) {
    period="String_Node_Str";
    interval=11;
  }
 else   if (interval == -1) {
    period="String_Node_Str";
  }
  String uriString="String_Node_Str" + "String_Node_Str" + apiKey + "String_Node_Str"+ blogID+ "String_Node_Str"+ reportType+ "String_Node_Str"+ sdf.format(c1.getTime())+ "String_Node_Str"+ interval+ "String_Node_Str"+ period;
  vsoURI=uriString;
  if (!reportType.equals("String_Node_Str")) {
    uriString+="String_Node_Str";
  }
  URI uri=URI.create(uriString);
  configureClient(uri,null,null);
  try {
    HttpResponse response;
    response=client.execute(postMethod);
    XmlPullParser pullParser=XmlPullParserFactory.newInstance().newPullParser();
    HttpEntity entity=response.getEntity();
    PushbackInputStream is=new PushbackInputStream(entity.getContent());
    int bomCheck=is.read();
    int stopper=0;
    while (bomCheck != 60 && stopper < 20) {
      bomCheck=is.read();
      stopper++;
    }
    is.unread(bomCheck);
    pullParser.setInput(is,"String_Node_Str");
    int eventType=pullParser.getEventType();
    boolean foundDataItem=false;
    final Vector<HashMap<String,String>> dataSet=new Vector<HashMap<String,String>>();
    final Vector<Integer> numDataSet=new Vector<Integer>();
    int rowCount=0;
    while (eventType != XmlPullParser.END_DOCUMENT) {
      if (eventType == XmlPullParser.START_DOCUMENT) {
      }
 else       if (eventType == XmlPullParser.END_DOCUMENT) {
      }
 else       if (eventType == XmlPullParser.START_TAG) {
        String name=pullParser.getName();
        if (name.equals("String_Node_Str") || name.equals("String_Node_Str") || name.equals("String_Node_Str")|| name.equals("String_Node_Str")|| name.equals("String_Node_Str")|| name.equals("String_Node_Str")) {
        }
 else         if (pullParser.getName().equals("String_Node_Str")) {
          break;
        }
 else {
          foundDataItem=true;
          HashMap<String,String> dataRow=new HashMap<String,String>();
          for (int i=0; i < pullParser.getAttributeCount(); i++) {
            dataRow.put(pullParser.getAttributeName(i).toString(),pullParser.getAttributeValue(i).toString());
          }
          if (dataRow != null) {
            dataSet.add(rowCount,dataRow);
          }
        }
      }
 else       if (eventType == XmlPullParser.END_TAG) {
      }
 else       if (eventType == XmlPullParser.TEXT) {
        if (foundDataItem) {
          if (pullParser.getText().toString() == "String_Node_Str") {
            numDataSet.add(rowCount,0);
          }
 else {
            int value=0;
            try {
              value=Integer.parseInt(pullParser.getText().toString());
            }
 catch (            NumberFormatException e) {
            }
            numDataSet.add(rowCount,value);
          }
          rowCount++;
          foundDataItem=false;
        }
      }
      eventType=pullParser.next();
    }
    if (dataSet.size() > 0) {
      final int intervalT=interval;
      Thread uiThread=new Thread(){
        public void run(){
          RelativeLayout filters=(RelativeLayout)findViewById(R.id.filters);
          filters.setVisibility(View.VISIBLE);
          TextView reportTitle=(TextView)findViewById(R.id.chartTitle);
          reportTitle.setVisibility(View.VISIBLE);
          ImageView iv=(ImageView)findViewById(R.id.chart);
          if (reportType.equals("String_Node_Str")) {
            if (intervalT != 1) {
              iv.setVisibility(View.VISIBLE);
            }
 else {
              iv.setVisibility(View.GONE);
            }
            reportTitle.setText(getResources().getText(R.string.report_views));
            String dataValues="String_Node_Str", dateStrings="String_Node_Str", xLabels="String_Node_Str";
            Object[] key=numDataSet.toArray();
            Arrays.sort(key);
            TableLayout tl=(TableLayout)findViewById(R.id.dataTable);
            tl.removeAllViews();
            LayoutInflater inflater=getLayoutInflater();
            TableRow table_row=(TableRow)inflater.inflate(R.layout.table_row_header,tl,false);
            TextView col_1=(TextView)table_row.findViewById(R.id.col1);
            col_1.setText(getResources().getText(R.string.date));
            col_1.setTypeface(Typeface.DEFAULT_BOLD);
            TextView col_2=(TextView)table_row.findViewById(R.id.col2);
            col_2.setText(getResources().getText(R.string.report_views));
            col_2.setTypeface(Typeface.DEFAULT_BOLD);
            tl.addView(table_row);
            HashMap<?,?> row;
            for (int i=0; i < dataSet.size(); i++) {
              row=(HashMap<?,?>)dataSet.get(i);
              String date;
              try {
                date=row.get("String_Node_Str").toString();
              }
 catch (              Exception e) {
                return;
              }
              String value=numDataSet.get(i).toString();
              dateStrings+=date + "String_Node_Str";
              dataValues+=value + "String_Node_Str";
              if (i == 0)               xLabels+=date + "String_Node_Str";
 else               if (i == (dataSet.size() - 1))               xLabels+=date;
 else               xLabels+="String_Node_Str";
              TableRow tr=(TableRow)inflater.inflate(R.layout.table_row,tl,false);
              TextView col1=(TextView)tr.findViewById(R.id.col1);
              col1.setText(date);
              TextView col2=(TextView)tr.findViewById(R.id.col2);
              col2.setText(value);
              if (i % 2 == 0) {
                tr.setBackgroundColor(Color.parseColor("String_Node_Str"));
              }
              tl.addView(tr);
            }
            int maxValue=Integer.parseInt(key[key.length - 1].toString());
            int minValue=Integer.parseInt(key[0].toString());
            dataValues=dataValues.substring(0,dataValues.length() - 1);
            dateStrings=dateStrings.substring(0,dateStrings.length() - 1);
            long minBuffer=Math.round(minValue - (maxValue * .10));
            if (minBuffer < 0) {
              minBuffer=0;
            }
            long maxBuffer=Math.round(maxValue + (maxValue * .10));
            for (int i=0; i < 9; i++) {
              if (minBuffer % 10 == 0)               break;
 else {
                minBuffer--;
              }
            }
            for (int i=0; i < 9; i++) {
              if (maxBuffer % 10 == 0)               break;
 else {
                maxBuffer++;
              }
            }
            long yInterval=maxBuffer / 10;
            for (int i=0; i < 9; i++) {
              if (yInterval % 10 == 0)               break;
 else {
                yInterval++;
              }
            }
            float xGrid=100.00f / 6;
            if (yInterval == 0) {
              yInterval=1;
            }
            long numRows=(maxBuffer - minBuffer) / yInterval;
            float yGrid=100.00f / numRows;
            Display display=getWindowManager().getDefaultDisplay();
            int width=display.getWidth();
            int height=display.getHeight();
            String screenSize="String_Node_Str";
            if (width > 480 || height > 480) {
              screenSize="String_Node_Str";
            }
            final String chartViewURL="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + dataValues + "String_Node_Str"+ screenSize+ "String_Node_Str"+ "String_Node_Str"+ xLabels+ "String_Node_Str"+ minBuffer+ "String_Node_Str"+ maxBuffer+ "String_Node_Str"+ minBuffer+ "String_Node_Str"+ maxBuffer+ "String_Node_Str"+ yInterval+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ xGrid+ "String_Node_Str"+ yGrid+ "String_Node_Str";
            new statsChartTask().execute(chartViewURL);
          }
 else           if (reportType.equals("String_Node_Str")) {
            reportTitle.setText(getResources().getText(R.string.report_postviews));
            iv.setVisibility(View.GONE);
            Object[] key=numDataSet.toArray();
            Arrays.sort(key);
            TableLayout tl=(TableLayout)findViewById(R.id.dataTable);
            tl.removeAllViews();
            LayoutInflater inflater=getLayoutInflater();
            TableRow table_row=(TableRow)inflater.inflate(R.layout.table_row_header,tl,false);
            TextView col_1=(TextView)table_row.findViewById(R.id.col1);
            col_1.setText(getResources().getText(R.string.report_post_title));
            col_1.setTypeface(Typeface.DEFAULT_BOLD);
            TextView col_2=(TextView)table_row.findViewById(R.id.col2);
            col_2.setText(getResources().getText(R.string.report_views));
            col_2.setTypeface(Typeface.DEFAULT_BOLD);
            tl.addView(table_row);
            HashMap<?,?> row;
            for (int i=0; i < dataSet.size(); i++) {
              row=(HashMap<?,?>)dataSet.get(i);
              String date=row.get("String_Node_Str").toString();
              String value=numDataSet.get(i).toString();
              TableRow tr=(TableRow)inflater.inflate(R.layout.table_row,tl,false);
              TextView col1=(TextView)tr.findViewById(R.id.col1);
              col1.setText(date);
              TextView col2=(TextView)tr.findViewById(R.id.col2);
              col2.setText(value);
              if (i % 2 == 0) {
                tr.setBackgroundColor(Color.parseColor("String_Node_Str"));
              }
              tl.addView(tr);
            }
          }
 else           if (reportType.equals("String_Node_Str") || reportType.equals("String_Node_Str") || reportType.equals("String_Node_Str")) {
            iv.setVisibility(View.GONE);
            Object[] key=numDataSet.toArray();
            Arrays.sort(key);
            TableLayout tl=(TableLayout)findViewById(R.id.dataTable);
            tl.removeAllViews();
            LayoutInflater inflater=getLayoutInflater();
            TableRow table_row=(TableRow)inflater.inflate(R.layout.table_row_header,tl,false);
            TextView col_1=(TextView)table_row.findViewById(R.id.col1);
            if (reportType.equals("String_Node_Str")) {
              col_1.setText(getResources().getText(R.string.report_referrers));
              reportTitle.setText(getResources().getText(R.string.report_referrers));
            }
 else             if (reportType.equals("String_Node_Str")) {
              reportTitle.setText(getResources().getText(R.string.report_searchterms));
              col_1.setText(getResources().getText(R.string.report_searchterms));
            }
 else {
              reportTitle.setText(getResources().getText(R.string.report_clicks));
              col_1.setText(getResources().getText(R.string.report_clicks));
            }
            col_1.setTypeface(Typeface.DEFAULT_BOLD);
            TextView col_2=(TextView)table_row.findViewById(R.id.col2);
            col_2.setText("String_Node_Str");
            col_2.setTypeface(Typeface.DEFAULT_BOLD);
            tl.addView(table_row);
            HashMap<?,?> row;
            for (int i=0; i < dataSet.size(); i++) {
              row=(HashMap<?,?>)dataSet.get(i);
              String date=row.get("String_Node_Str").toString();
              String value=numDataSet.get(i).toString();
              TableRow tr=(TableRow)inflater.inflate(R.layout.table_row,tl,false);
              TextView col1=(TextView)tr.findViewById(R.id.col1);
              col1.setText(date);
              Linkify.addLinks(col1,Linkify.WEB_URLS);
              TextView col2=(TextView)tr.findViewById(R.id.col2);
              col2.setText(value);
              if (i % 2 == 0) {
                tr.setBackgroundColor(Color.parseColor("String_Node_Str"));
              }
              tl.addView(tr);
            }
          }
          if (!isFinishing())           titleBar.stopRotatingRefreshIcon();
        }
      }
;
      this.runOnUiThread(uiThread);
    }
 else {
      Thread alert=new Thread(){
        public void run(){
          titleBar.stopRotatingRefreshIcon();
          RelativeLayout filters=(RelativeLayout)findViewById(R.id.filters);
          filters.setVisibility(View.VISIBLE);
          Toast.makeText(ViewStats.this,getResources().getText(R.string.no_data_found),Toast.LENGTH_SHORT).show();
        }
      }
;
      if (!isFinishing()) {
        this.runOnUiThread(alert);
      }
    }
  }
 catch (  ClientProtocolException e) {
    titleBar.stopRotatingRefreshIcon();
    errorMsg=e.getMessage();
  }
catch (  IllegalStateException e) {
    titleBar.stopRotatingRefreshIcon();
    errorMsg=e.getMessage();
  }
catch (  IOException e) {
    titleBar.stopRotatingRefreshIcon();
    errorMsg=e.getMessage();
  }
catch (  XmlPullParserException e) {
    titleBar.stopRotatingRefreshIcon();
    errorMsg=e.getMessage();
  }
  if (errorMsg != "String_Node_Str") {
    Thread error=new Thread(){
      public void run(){
        AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(ViewStats.this);
        dialogBuilder.setTitle(getResources().getText(R.string.connection_error));
        dialogBuilder.setMessage(errorMsg);
        dialogBuilder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
          public void onClick(          DialogInterface dialog,          int whichButton){
          }
        }
);
        dialogBuilder.setCancelable(true);
        if (!isFinishing()) {
          dialogBuilder.create().show();
        }
      }
    }
;
    this.runOnUiThread(error);
  }
}