Program: 94108
Project: 94108
Buggy source:
public static void lensDialog(final Context context,final TextView loadedLensesTextView,LayoutInflater inflater,ViewGroup container){
  if (MainActivity.lensDBHelper == null)   MainActivity.lensDBHelper=new LensDatabaseHelper(context);
  ArrayList<Object> lensList=MainActivity.lensDBHelper.getAllLenses();
  AlertDialog.Builder builder=new AlertDialog.Builder(context);
  builder.setTitle("String_Node_Str");
  View view=inflater.inflate(R.layout.lenslist_layout,container,false);
  GridLayout gridLayout=(GridLayout)view.findViewById(R.id.lensloader_gridholder);
  for (  Object lensObj : lensList) {
    final LensData lensData=(LensData)lensObj;
    final LinearLayout inflatedLayout=(LinearLayout)inflater.inflate(R.layout.lensholder_layout,gridLayout,false);
    inflatedLayout.setBackgroundResource(lensData.mActive ? R.drawable.lens_bg_selected : R.drawable.lens_bg_unselected);
    inflatedLayout.setTag(lensData.mCode);
    inflatedLayout.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        LinearLayout btn=(LinearLayout)v;
        String mCode=(String)btn.getTag();
        Logger.log("String_Node_Str" + mCode);
        try {
          boolean activeState=MainActivity.lensDBHelper.toggleLensActiveState(mCode);
          inflatedLayout.setBackgroundResource(activeState ? R.drawable.lens_bg_selected : R.drawable.lens_bg_unselected);
          inflatedLayout.invalidate();
        }
 catch (        Exception e) {
          Logger.log("String_Node_Str" + mCode + "String_Node_Str"+ e.getMessage());
        }
      }
    }
);
    ImageView iconImageView=(ImageView)inflatedLayout.findViewById(R.id.lensIconView);
    TextView iconName=(TextView)inflatedLayout.findViewById(R.id.lensTextView);
    String nameBuilder=lensData.mCode;
    for (    String filter : stringFilter)     nameBuilder=nameBuilder.replace(filter,"String_Node_Str");
    nameBuilder=nameBuilder.replaceAll("String_Node_Str","String_Node_Str");
    iconName.setText(nameBuilder.trim());
    iconName.setMaxWidth(5);
    LensContainerData containerData=iconMap.get(lensData.mCode);
    if (containerData == null || containerData.bmp == null) {
      containerData=new LensContainerData(inflatedLayout,iconImageView,iconName,lensData.mIconLink,null);
      iconMap.put(lensData.mCode,containerData);
      new LensIconLoader.AsyncLensIconDownloader().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,containerData,context);
    }
 else {
      iconImageView.setImageBitmap(containerData.bmp);
      iconImageView.invalidate();
      iconName.setMaxWidth(containerData.bmp.getWidth());
      iconName.invalidate();
      inflatedLayout.invalidate();
    }
    gridLayout.addView(inflatedLayout);
  }
  builder.setView(view);
  builder.setPositiveButton(Common.dialog_done,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      int selectedLensSize=MainActivity.lensDBHelper.getActiveLensCount();
      loadedLensesTextView.setText(String.format("String_Node_Str",selectedLensSize));
    }
  }
);
  builder.setNegativeButton(Common.dialog_cancel,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      int selectedLensSize=MainActivity.lensDBHelper.getActiveLensCount();
      loadedLensesTextView.setText(String.format("String_Node_Str",selectedLensSize));
    }
  }
);
  builder.show();
}

Fixed version (ground truth):
public static void lensDialog(final Context context,final TextView loadedLensesTextView,LayoutInflater inflater,ViewGroup container){
  if (MainActivity.lensDBHelper == null)   MainActivity.lensDBHelper=new LensDatabaseHelper(context);
  ArrayList<Object> lensList=MainActivity.lensDBHelper.getAllLenses();
  if (lensList == null) {
    Logger.log("String_Node_Str");
    return;
  }
  AlertDialog.Builder builder=new AlertDialog.Builder(context);
  builder.setTitle("String_Node_Str");
  View view=inflater.inflate(R.layout.lenslist_layout,container,false);
  GridLayout gridLayout=(GridLayout)view.findViewById(R.id.lensloader_gridholder);
  for (  Object lensObj : lensList) {
    final LensData lensData=(LensData)lensObj;
    final LinearLayout inflatedLayout=(LinearLayout)inflater.inflate(R.layout.lensholder_layout,gridLayout,false);
    inflatedLayout.setBackgroundResource(lensData.mActive ? R.drawable.lens_bg_selected : R.drawable.lens_bg_unselected);
    inflatedLayout.setTag(lensData.mCode);
    inflatedLayout.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        LinearLayout btn=(LinearLayout)v;
        String mCode=(String)btn.getTag();
        Logger.log("String_Node_Str" + mCode);
        try {
          boolean activeState=MainActivity.lensDBHelper.toggleLensActiveState(mCode);
          inflatedLayout.setBackgroundResource(activeState ? R.drawable.lens_bg_selected : R.drawable.lens_bg_unselected);
          inflatedLayout.invalidate();
        }
 catch (        Exception e) {
          Logger.log("String_Node_Str" + mCode + "String_Node_Str"+ e.getMessage());
        }
      }
    }
);
    ImageView iconImageView=(ImageView)inflatedLayout.findViewById(R.id.lensIconView);
    TextView iconName=(TextView)inflatedLayout.findViewById(R.id.lensTextView);
    String nameBuilder=lensData.mCode;
    for (    String filter : stringFilter)     nameBuilder=nameBuilder.replace(filter,"String_Node_Str");
    nameBuilder=nameBuilder.replaceAll("String_Node_Str","String_Node_Str");
    iconName.setText(nameBuilder.trim());
    iconName.setMaxWidth(5);
    LensContainerData containerData=iconMap.get(lensData.mCode);
    if (containerData == null || containerData.bmp == null) {
      containerData=new LensContainerData(inflatedLayout,iconImageView,iconName,lensData.mIconLink,null);
      iconMap.put(lensData.mCode,containerData);
      new LensIconLoader.AsyncLensIconDownloader().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,containerData,context);
    }
 else {
      iconImageView.setImageBitmap(containerData.bmp);
      iconImageView.invalidate();
      iconName.setMaxWidth(containerData.bmp.getWidth());
      iconName.invalidate();
      inflatedLayout.invalidate();
    }
    gridLayout.addView(inflatedLayout);
  }
  builder.setView(view);
  builder.setPositiveButton(Common.dialog_done,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      int selectedLensSize=MainActivity.lensDBHelper.getActiveLensCount();
      loadedLensesTextView.setText(String.format("String_Node_Str",selectedLensSize));
    }
  }
);
  builder.setNegativeButton(Common.dialog_cancel,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      int selectedLensSize=MainActivity.lensDBHelper.getActiveLensCount();
      loadedLensesTextView.setText(String.format("String_Node_Str",selectedLensSize));
    }
  }
);
  builder.show();
}