Program: 38462
Project: 38462
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setupMasterImage();
  ImageFilterRS.setRenderScriptContext(this);
  ImageShow.setDefaultBackgroundColor(getResources().getColor(R.color.background_screen));
  ImageZoom.setZoomedSize(getPixelsFromDip(256));
  FramedTextButton.setTextSize((int)getPixelsFromDip(14));
  FramedTextButton.setTrianglePadding((int)getPixelsFromDip(4));
  FramedTextButton.setTriangleSize((int)getPixelsFromDip(10));
  ImageShow.setTextSize((int)getPixelsFromDip(12));
  ImageShow.setTextPadding((int)getPixelsFromDip(10));
  ImageShow.setOriginalTextMargin((int)getPixelsFromDip(4));
  ImageShow.setOriginalTextSize((int)getPixelsFromDip(18));
  ImageShow.setOriginalText(getResources().getString(R.string.original_picture_text));
  mIconSeedSize=getResources().getDimensionPixelSize(R.dimen.thumbnail_size);
  Drawable curveHandle=getResources().getDrawable(R.drawable.camera_crop);
  int curveHandleSize=(int)getResources().getDimension(R.dimen.crop_indicator_size);
  Spline.setCurveHandle(curveHandle,curveHandleSize);
  Spline.setCurveWidth((int)getPixelsFromDip(3));
  setContentView(R.layout.filtershow_activity);
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
  actionBar.setCustomView(R.layout.filtershow_actionbar);
  mSaveButton=actionBar.getCustomView();
  mSaveButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View view){
      saveImage();
    }
  }
);
  mImageLoader=new ImageLoader(this,getApplicationContext());
  listFilters=(LinearLayout)findViewById(R.id.listFilters);
  listBorders=(LinearLayout)findViewById(R.id.listBorders);
  listColors=(LinearLayout)findViewById(R.id.listColorsFx);
  mImageShow=(ImageShow)findViewById(R.id.imageShow);
  mImageStraighten=(ImageStraighten)findViewById(R.id.imageStraighten);
  mImageCrop=(ImageCrop)findViewById(R.id.imageCrop);
  mImageRotate=(ImageRotate)findViewById(R.id.imageRotate);
  mImageFlip=(ImageFlip)findViewById(R.id.imageFlip);
  mImageTinyPlanet=(ImageTinyPlanet)findViewById(R.id.imageTinyPlanet);
  mImageRedEyes=(ImageRedEyes)findViewById(R.id.imageRedEyes);
  mImageDraw=(ImageDraw)findViewById(R.id.imageDraw);
  mImageCrop.setAspectTextSize((int)getPixelsFromDip(18));
  ImageCrop.setTouchTolerance((int)getPixelsFromDip(25));
  ImageCrop.setMinCropSize((int)getPixelsFromDip(55));
  mImageViews.add(mImageShow);
  mImageViews.add(mImageStraighten);
  mImageViews.add(mImageCrop);
  mImageViews.add(mImageRotate);
  mImageViews.add(mImageFlip);
  mImageViews.add(mImageTinyPlanet);
  mImageViews.add(mImageRedEyes);
  mEditorPlaceHolder.setContainer((FrameLayout)findViewById(R.id.editorContainer));
  mEditorPlaceHolder.addEditor(new EditorDraw());
  EditorManager.addEditors(mEditorPlaceHolder);
  mEditorPlaceHolder.setOldViews(mImageViews);
  mEditorPlaceHolder.setImageLoader(mImageLoader);
  mListFx=findViewById(R.id.fxList);
  mListBorders=findViewById(R.id.bordersList);
  mListGeometry=findViewById(R.id.geometryList);
  mListFilterButtons=findViewById(R.id.filterButtonsList);
  mListColors=findViewById(R.id.colorsFxList);
  mListViews.add(mListFx);
  mListViews.add(mListBorders);
  mListViews.add(mListGeometry);
  mListViews.add(mListFilterButtons);
  mListViews.add(mListColors);
  mFxButton=(ImageButton)findViewById(R.id.fxButton);
  mBorderButton=(ImageButton)findViewById(R.id.borderButton);
  mGeometryButton=(ImageButton)findViewById(R.id.geometryButton);
  mColorsButton=(ImageButton)findViewById(R.id.colorsButton);
  mBottomPanelButtons.add(mFxButton);
  mBottomPanelButtons.add(mBorderButton);
  mBottomPanelButtons.add(mGeometryButton);
  mBottomPanelButtons.add(mColorsButton);
  mImageShow.setImageLoader(mImageLoader);
  mImageStraighten.setImageLoader(mImageLoader);
  mImageCrop.setImageLoader(mImageLoader);
  mImageRotate.setImageLoader(mImageLoader);
  mImageFlip.setImageLoader(mImageLoader);
  mImageTinyPlanet.setImageLoader(mImageLoader);
  mImageRedEyes.setImageLoader(mImageLoader);
  mImageDraw.setImageLoader(mImageLoader);
  mPanelController.setActivity(this);
  mPanelController.setEditorPlaceHolder(mEditorPlaceHolder);
  mPanelController.addImageView(findViewById(R.id.imageShow));
  mPanelController.addImageView(findViewById(R.id.imageStraighten));
  mPanelController.addImageView(findViewById(R.id.imageCrop));
  mPanelController.addImageView(findViewById(R.id.imageRotate));
  mPanelController.addImageView(findViewById(R.id.imageFlip));
  mPanelController.addImageView(findViewById(R.id.imageTinyPlanet));
  mPanelController.addImageView(findViewById(R.id.imageRedEyes));
  mPanelController.addImageView(findViewById(R.id.imageDraw));
  mPanelController.addPanel(mFxButton,mListFx,0);
  mPanelController.addPanel(mBorderButton,mListBorders,1);
  mPanelController.addPanel(mGeometryButton,mListGeometry,2);
  mPanelController.addComponent(mGeometryButton,findViewById(R.id.straightenButton));
  mPanelController.addComponent(mGeometryButton,findViewById(R.id.cropButton));
  mPanelController.addComponent(mGeometryButton,findViewById(R.id.rotateButton));
  mPanelController.addComponent(mGeometryButton,findViewById(R.id.flipButton));
  mPanelController.addComponent(mGeometryButton,findViewById(R.id.redEyeButton));
  mPanelController.addPanel(mColorsButton,mListColors,3);
  Vector<ImageFilter> filters=new Vector<ImageFilter>();
  FiltersManager.addFilters(filters,mImageLoader);
  for (  ImageFilter filter : filters) {
    filter.setParameter(filter.getDefaultParameter());
    filter.setName(getString(filter.getTextId()));
    setupFilterButton(filter,listColors,mColorsButton);
  }
  mPanelController.addFilter(new ImageFilterRedEye());
  mPanelController.addView(findViewById(R.id.applyEffect));
  findViewById(R.id.resetOperationsButton).setOnClickListener(createOnClickResetOperationsButton());
  ListView operationsList=(ListView)findViewById(R.id.operationsList);
  operationsList.setAdapter(mMasterImage.getHistory());
  operationsList.setOnItemClickListener(this);
  ListView imageStateList=(ListView)findViewById(R.id.imageStateList);
  imageStateList.setAdapter(mMasterImage.getState());
  mImageLoader.setAdapter(mMasterImage.getHistory());
  fillListImages(listFilters);
  fillListBorders(listBorders);
  SeekBar seekBar=(SeekBar)findViewById(R.id.filterSeekBar);
  seekBar.setMax(SEEK_BAR_MAX);
  mImageShow.setSeekBar(seekBar);
  mImageTinyPlanet.setSeekBar(seekBar);
  mPanelController.setRowPanel(findViewById(R.id.secondRowPanel));
  mPanelController.setUtilityPanel(this,findViewById(R.id.filterButtonsList),findViewById(R.id.panelAccessoryViewList),findViewById(R.id.applyEffect));
  mPanelController.setCurrentPanel(mFxButton);
  Intent intent=getIntent();
  if (intent.getBooleanExtra(LAUNCH_FULLSCREEN,false)) {
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
  }
  if (intent.getData() != null) {
    startLoadBitmap(intent.getData());
  }
 else {
    pickImage();
  }
  String action=intent.getAction();
  if (action.equalsIgnoreCase(CROP_ACTION)) {
    Bundle extras=intent.getExtras();
    if (extras != null) {
      mCropExtras=new CropExtras(extras.getInt(CropExtras.KEY_OUTPUT_X,0),extras.getInt(CropExtras.KEY_OUTPUT_Y,0),extras.getBoolean(CropExtras.KEY_SCALE,true) && extras.getBoolean(CropExtras.KEY_SCALE_UP_IF_NEEDED,false),extras.getInt(CropExtras.KEY_ASPECT_X,0),extras.getInt(CropExtras.KEY_ASPECT_Y,0),extras.getBoolean(CropExtras.KEY_SET_AS_WALLPAPER,false),extras.getBoolean(CropExtras.KEY_RETURN_DATA,false),(Uri)extras.getParcelable(MediaStore.EXTRA_OUTPUT),extras.getString(CropExtras.KEY_OUTPUT_FORMAT),extras.getBoolean(CropExtras.KEY_SHOW_WHEN_LOCKED,false),extras.getFloat(CropExtras.KEY_SPOTLIGHT_X),extras.getFloat(CropExtras.KEY_SPOTLIGHT_Y));
      if (mCropExtras.getShowWhenLocked()) {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
      }
      mImageShow.getImagePreset().mGeoData.setCropExtras(mCropExtras);
      mImageCrop.setExtras(mCropExtras);
      String s=getString(R.string.Fixed);
      mImageCrop.setAspectString(s);
      mImageCrop.setCropActionFlag(true);
      mPanelController.setFixedAspect(mCropExtras.getAspectX() > 0 && mCropExtras.getAspectY() > 0);
    }
    mPanelController.showComponent(findViewById(R.id.cropButton));
  }
 else   if (action.equalsIgnoreCase(TINY_PLANET_ACTION)) {
    mPanelController.showComponent(findViewById(R.id.tinyplanetButton));
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setupMasterImage();
  ImageFilterRS.setRenderScriptContext(this);
  ImageShow.setDefaultBackgroundColor(getResources().getColor(R.color.background_screen));
  ImageZoom.setZoomedSize(getPixelsFromDip(256));
  FramedTextButton.setTextSize((int)getPixelsFromDip(14));
  FramedTextButton.setTrianglePadding((int)getPixelsFromDip(4));
  FramedTextButton.setTriangleSize((int)getPixelsFromDip(10));
  ImageShow.setTextSize((int)getPixelsFromDip(12));
  ImageShow.setTextPadding((int)getPixelsFromDip(10));
  ImageShow.setOriginalTextMargin((int)getPixelsFromDip(4));
  ImageShow.setOriginalTextSize((int)getPixelsFromDip(18));
  ImageShow.setOriginalText(getResources().getString(R.string.original_picture_text));
  mIconSeedSize=getResources().getDimensionPixelSize(R.dimen.thumbnail_size);
  Drawable curveHandle=getResources().getDrawable(R.drawable.camera_crop);
  int curveHandleSize=(int)getResources().getDimension(R.dimen.crop_indicator_size);
  Spline.setCurveHandle(curveHandle,curveHandleSize);
  Spline.setCurveWidth((int)getPixelsFromDip(3));
  setContentView(R.layout.filtershow_activity);
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
  actionBar.setCustomView(R.layout.filtershow_actionbar);
  mSaveButton=actionBar.getCustomView();
  mSaveButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View view){
      saveImage();
    }
  }
);
  mImageLoader=new ImageLoader(this,getApplicationContext());
  listFilters=(LinearLayout)findViewById(R.id.listFilters);
  listBorders=(LinearLayout)findViewById(R.id.listBorders);
  listColors=(LinearLayout)findViewById(R.id.listColorsFx);
  mImageShow=(ImageShow)findViewById(R.id.imageShow);
  mImageStraighten=(ImageStraighten)findViewById(R.id.imageStraighten);
  mImageCrop=(ImageCrop)findViewById(R.id.imageCrop);
  mImageRotate=(ImageRotate)findViewById(R.id.imageRotate);
  mImageFlip=(ImageFlip)findViewById(R.id.imageFlip);
  mImageTinyPlanet=(ImageTinyPlanet)findViewById(R.id.imageTinyPlanet);
  mImageRedEyes=(ImageRedEyes)findViewById(R.id.imageRedEyes);
  mImageDraw=(ImageDraw)findViewById(R.id.imageDraw);
  mImageCrop.setAspectTextSize((int)getPixelsFromDip(18));
  ImageCrop.setTouchTolerance((int)getPixelsFromDip(25));
  ImageCrop.setMinCropSize((int)getPixelsFromDip(55));
  mImageViews.add(mImageShow);
  mImageViews.add(mImageStraighten);
  mImageViews.add(mImageCrop);
  mImageViews.add(mImageRotate);
  mImageViews.add(mImageFlip);
  mImageViews.add(mImageTinyPlanet);
  mImageViews.add(mImageRedEyes);
  mEditorPlaceHolder.setContainer((FrameLayout)findViewById(R.id.editorContainer));
  mEditorPlaceHolder.addEditor(new EditorDraw());
  mEditorPlaceHolder.addEditor(new BasicEditor());
  EditorManager.addEditors(mEditorPlaceHolder);
  mEditorPlaceHolder.setOldViews(mImageViews);
  mEditorPlaceHolder.setImageLoader(mImageLoader);
  mListFx=findViewById(R.id.fxList);
  mListBorders=findViewById(R.id.bordersList);
  mListGeometry=findViewById(R.id.geometryList);
  mListFilterButtons=findViewById(R.id.filterButtonsList);
  mListColors=findViewById(R.id.colorsFxList);
  mListViews.add(mListFx);
  mListViews.add(mListBorders);
  mListViews.add(mListGeometry);
  mListViews.add(mListFilterButtons);
  mListViews.add(mListColors);
  mFxButton=(ImageButton)findViewById(R.id.fxButton);
  mBorderButton=(ImageButton)findViewById(R.id.borderButton);
  mGeometryButton=(ImageButton)findViewById(R.id.geometryButton);
  mColorsButton=(ImageButton)findViewById(R.id.colorsButton);
  mBottomPanelButtons.add(mFxButton);
  mBottomPanelButtons.add(mBorderButton);
  mBottomPanelButtons.add(mGeometryButton);
  mBottomPanelButtons.add(mColorsButton);
  mImageShow.setImageLoader(mImageLoader);
  mImageStraighten.setImageLoader(mImageLoader);
  mImageCrop.setImageLoader(mImageLoader);
  mImageRotate.setImageLoader(mImageLoader);
  mImageFlip.setImageLoader(mImageLoader);
  mImageTinyPlanet.setImageLoader(mImageLoader);
  mImageRedEyes.setImageLoader(mImageLoader);
  mImageDraw.setImageLoader(mImageLoader);
  mPanelController.setActivity(this);
  mPanelController.setEditorPlaceHolder(mEditorPlaceHolder);
  mPanelController.addImageView(findViewById(R.id.imageShow));
  mPanelController.addImageView(findViewById(R.id.imageStraighten));
  mPanelController.addImageView(findViewById(R.id.imageCrop));
  mPanelController.addImageView(findViewById(R.id.imageRotate));
  mPanelController.addImageView(findViewById(R.id.imageFlip));
  mPanelController.addImageView(findViewById(R.id.imageTinyPlanet));
  mPanelController.addImageView(findViewById(R.id.imageRedEyes));
  mPanelController.addImageView(findViewById(R.id.imageDraw));
  mPanelController.addPanel(mFxButton,mListFx,0);
  mPanelController.addPanel(mBorderButton,mListBorders,1);
  mPanelController.addPanel(mGeometryButton,mListGeometry,2);
  mPanelController.addComponent(mGeometryButton,findViewById(R.id.straightenButton));
  mPanelController.addComponent(mGeometryButton,findViewById(R.id.cropButton));
  mPanelController.addComponent(mGeometryButton,findViewById(R.id.rotateButton));
  mPanelController.addComponent(mGeometryButton,findViewById(R.id.flipButton));
  mPanelController.addComponent(mGeometryButton,findViewById(R.id.redEyeButton));
  mPanelController.addPanel(mColorsButton,mListColors,3);
  Vector<ImageFilter> filters=new Vector<ImageFilter>();
  FiltersManager.addFilters(filters,mImageLoader);
  for (  ImageFilter filter : filters) {
    filter.setParameter(filter.getDefaultParameter());
    filter.setName(getString(filter.getTextId()));
    setupFilterButton(filter,listColors,mColorsButton);
  }
  mPanelController.addFilter(new ImageFilterRedEye());
  mPanelController.addView(findViewById(R.id.applyEffect));
  findViewById(R.id.resetOperationsButton).setOnClickListener(createOnClickResetOperationsButton());
  ListView operationsList=(ListView)findViewById(R.id.operationsList);
  operationsList.setAdapter(mMasterImage.getHistory());
  operationsList.setOnItemClickListener(this);
  ListView imageStateList=(ListView)findViewById(R.id.imageStateList);
  imageStateList.setAdapter(mMasterImage.getState());
  mImageLoader.setAdapter(mMasterImage.getHistory());
  fillListImages(listFilters);
  fillListBorders(listBorders);
  SeekBar seekBar=(SeekBar)findViewById(R.id.filterSeekBar);
  seekBar.setMax(SEEK_BAR_MAX);
  mImageShow.setSeekBar(seekBar);
  mImageTinyPlanet.setSeekBar(seekBar);
  mPanelController.setRowPanel(findViewById(R.id.secondRowPanel));
  mPanelController.setUtilityPanel(this,findViewById(R.id.filterButtonsList),findViewById(R.id.panelAccessoryViewList),findViewById(R.id.applyEffect));
  mPanelController.setCurrentPanel(mFxButton);
  Intent intent=getIntent();
  if (intent.getBooleanExtra(LAUNCH_FULLSCREEN,false)) {
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
  }
  if (intent.getData() != null) {
    startLoadBitmap(intent.getData());
  }
 else {
    pickImage();
  }
  String action=intent.getAction();
  if (action.equalsIgnoreCase(CROP_ACTION)) {
    Bundle extras=intent.getExtras();
    if (extras != null) {
      mCropExtras=new CropExtras(extras.getInt(CropExtras.KEY_OUTPUT_X,0),extras.getInt(CropExtras.KEY_OUTPUT_Y,0),extras.getBoolean(CropExtras.KEY_SCALE,true) && extras.getBoolean(CropExtras.KEY_SCALE_UP_IF_NEEDED,false),extras.getInt(CropExtras.KEY_ASPECT_X,0),extras.getInt(CropExtras.KEY_ASPECT_Y,0),extras.getBoolean(CropExtras.KEY_SET_AS_WALLPAPER,false),extras.getBoolean(CropExtras.KEY_RETURN_DATA,false),(Uri)extras.getParcelable(MediaStore.EXTRA_OUTPUT),extras.getString(CropExtras.KEY_OUTPUT_FORMAT),extras.getBoolean(CropExtras.KEY_SHOW_WHEN_LOCKED,false),extras.getFloat(CropExtras.KEY_SPOTLIGHT_X),extras.getFloat(CropExtras.KEY_SPOTLIGHT_Y));
      if (mCropExtras.getShowWhenLocked()) {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
      }
      mImageShow.getImagePreset().mGeoData.setCropExtras(mCropExtras);
      mImageCrop.setExtras(mCropExtras);
      String s=getString(R.string.Fixed);
      mImageCrop.setAspectString(s);
      mImageCrop.setCropActionFlag(true);
      mPanelController.setFixedAspect(mCropExtras.getAspectX() > 0 && mCropExtras.getAspectY() > 0);
    }
    mPanelController.showComponent(findViewById(R.id.cropButton));
  }
 else   if (action.equalsIgnoreCase(TINY_PLANET_ACTION)) {
    mPanelController.showComponent(findViewById(R.id.tinyplanetButton));
  }
}