Program: 15372
Project: 15372
Buggy source:
@Override protected void onSuccess(final CacheManager.ReadableCacheFile cacheFile,long timestamp,UUID session,boolean fromCache,String mimetype){
  final Bitmap image;
  try {
    image=BitmapFactory.decodeStream(cacheFile.getInputStream());
  }
 catch (  IOException e) {
    BugReportActivity.handleGlobalError(CaptchaActivity.this,e);
    return;
  }
  General.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      final LinearLayout ll=new LinearLayout(CaptchaActivity.this);
      ll.setOrientation(LinearLayout.VERTICAL);
      final ImageView captchaImg=new ImageView(CaptchaActivity.this);
      ll.addView(captchaImg);
      final LinearLayout.LayoutParams layoutParams=(LinearLayout.LayoutParams)captchaImg.getLayoutParams();
      layoutParams.setMargins(20,20,20,20);
      layoutParams.height=General.dpToPixels(context,100);
      captchaImg.setScaleType(ImageView.ScaleType.FIT_CENTER);
      final EditText captchaText=new EditText(CaptchaActivity.this);
      ll.addView(captchaText);
      ((LinearLayout.LayoutParams)captchaText.getLayoutParams()).setMargins(20,0,20,20);
      captchaText.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD | InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS);
      captchaImg.setImageBitmap(image);
      final Button submitButton=new Button(CaptchaActivity.this);
      submitButton.setText(R.string.post_captcha_submit_button);
      ll.addView(submitButton);
      ((LinearLayout.LayoutParams)submitButton.getLayoutParams()).setMargins(20,0,20,20);
      ((LinearLayout.LayoutParams)submitButton.getLayoutParams()).gravity=Gravity.RIGHT;
      ((LinearLayout.LayoutParams)submitButton.getLayoutParams()).width=LinearLayout.LayoutParams.WRAP_CONTENT;
      submitButton.setOnClickListener(new View.OnClickListener(){
        public void onClick(        View v){
          final Intent result=new Intent();
          result.putExtra("String_Node_Str",captchaId);
          result.putExtra("String_Node_Str",captchaText.getText().toString());
          setResult(RESULT_OK,result);
          finish();
        }
      }
);
      final ScrollView sv=new ScrollView(CaptchaActivity.this);
      sv.addView(ll);
      setContentView(sv);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onSuccess(final CacheManager.ReadableCacheFile cacheFile,long timestamp,UUID session,boolean fromCache,String mimetype){
  final Bitmap image;
  try {
    image=BitmapFactory.decodeStream(cacheFile.getInputStream());
  }
 catch (  IOException e) {
    BugReportActivity.handleGlobalError(CaptchaActivity.this,e);
    return;
  }
  AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
    public void run(){
      final LinearLayout ll=new LinearLayout(CaptchaActivity.this);
      ll.setOrientation(LinearLayout.VERTICAL);
      final ImageView captchaImg=new ImageView(CaptchaActivity.this);
      ll.addView(captchaImg);
      final LinearLayout.LayoutParams layoutParams=(LinearLayout.LayoutParams)captchaImg.getLayoutParams();
      layoutParams.setMargins(20,20,20,20);
      layoutParams.height=General.dpToPixels(context,100);
      captchaImg.setScaleType(ImageView.ScaleType.FIT_CENTER);
      final EditText captchaText=new EditText(CaptchaActivity.this);
      ll.addView(captchaText);
      ((LinearLayout.LayoutParams)captchaText.getLayoutParams()).setMargins(20,0,20,20);
      captchaText.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD | InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS);
      captchaImg.setImageBitmap(image);
      final Button submitButton=new Button(CaptchaActivity.this);
      submitButton.setText(R.string.post_captcha_submit_button);
      ll.addView(submitButton);
      ((LinearLayout.LayoutParams)submitButton.getLayoutParams()).setMargins(20,0,20,20);
      ((LinearLayout.LayoutParams)submitButton.getLayoutParams()).gravity=Gravity.RIGHT;
      ((LinearLayout.LayoutParams)submitButton.getLayoutParams()).width=LinearLayout.LayoutParams.WRAP_CONTENT;
      submitButton.setOnClickListener(new View.OnClickListener(){
        public void onClick(        View v){
          final Intent result=new Intent();
          result.putExtra("String_Node_Str",captchaId);
          result.putExtra("String_Node_Str",captchaText.getText().toString());
          setResult(RESULT_OK,result);
          finish();
        }
      }
);
      final ScrollView sv=new ScrollView(CaptchaActivity.this);
      sv.addView(ll);
      setContentView(sv);
    }
  }
);
}