Program: 13577
Project: 13577
Buggy source:
private void showMap(final List<GeoviewModel> countries){
  if (!isAdded()) {
    return;
  }
  if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) {
    AppLog.w(AppLog.T.STATS,"String_Node_Str" + Build.VERSION.SDK_INT);
    return;
  }
  int dp4=DisplayUtils.dpToPx(mTopPagerContainer.getContext(),4);
  LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layoutParams.setMargins(0,0,dp4,0);
  mTopPagerContainer.setLayoutParams(layoutParams);
  mTopPagerContainer.removeAllViews();
  mTopPagerContainer.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      mTopPagerContainer.getViewTreeObserver().removeGlobalOnLayoutListener(this);
      if (!isAdded()) {
        return;
      }
      StringBuilder dataToLoad=new StringBuilder();
      for (int i=0; i < countries.size(); i++) {
        final GeoviewModel currentCountry=countries.get(i);
        dataToLoad.append("String_Node_Str").append(currentCountry.getCountryFullName()).append("String_Node_Str").append(currentCountry.getViews()).append("String_Node_Str");
      }
      String label=getResources().getString(getTotalsLabelResId());
      String htmlPage="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + label + "String_Node_Str"+ dataToLoad+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
      WebView webView=new WebView(getActivity());
      mTopPagerContainer.addView(webView);
      int width=mTopPagerContainer.getWidth();
      int height=width * 3 / 4;
      LinearLayout.LayoutParams params=(LinearLayout.LayoutParams)webView.getLayoutParams();
      params.width=WebView.LayoutParams.MATCH_PARENT;
      params.height=height;
      webView.setLayoutParams(params);
      webView.setWebViewClient(new MyWebViewClient());
      webView.getSettings().setJavaScriptEnabled(true);
      webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
      webView.loadData(htmlPage,"String_Node_Str","String_Node_Str");
    }
  }
);
  mTopPagerContainer.setVisibility(View.VISIBLE);
}

Fixed version (ground truth):
private void showMap(final List<GeoviewModel> countries){
  if (!isAdded()) {
    return;
  }
  if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) {
    AppLog.w(AppLog.T.STATS,"String_Node_Str" + Build.VERSION.SDK_INT);
    return;
  }
  int dp4=DisplayUtils.dpToPx(mTopPagerContainer.getContext(),4);
  LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  MarginLayoutParamsCompat.setMarginEnd(layoutParams,dp4);
  mTopPagerContainer.setLayoutParams(layoutParams);
  mTopPagerContainer.removeAllViews();
  mTopPagerContainer.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      mTopPagerContainer.getViewTreeObserver().removeGlobalOnLayoutListener(this);
      if (!isAdded()) {
        return;
      }
      StringBuilder dataToLoad=new StringBuilder();
      for (int i=0; i < countries.size(); i++) {
        final GeoviewModel currentCountry=countries.get(i);
        dataToLoad.append("String_Node_Str").append(currentCountry.getCountryFullName()).append("String_Node_Str").append(currentCountry.getViews()).append("String_Node_Str");
      }
      String label=getResources().getString(getTotalsLabelResId());
      String htmlPage="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + label + "String_Node_Str"+ dataToLoad+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
      WebView webView=new WebView(getActivity());
      mTopPagerContainer.addView(webView);
      int width=mTopPagerContainer.getWidth();
      int height=width * 3 / 4;
      LinearLayout.LayoutParams params=(LinearLayout.LayoutParams)webView.getLayoutParams();
      params.width=WebView.LayoutParams.MATCH_PARENT;
      params.height=height;
      webView.setLayoutParams(params);
      webView.setWebViewClient(new MyWebViewClient());
      webView.getSettings().setJavaScriptEnabled(true);
      webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
      webView.loadData(htmlPage,"String_Node_Str","String_Node_Str");
    }
  }
);
  mTopPagerContainer.setVisibility(View.VISIBLE);
}