nus-yam/ex-repair huggingface dataset:
Program: 38294
Project: 38294
Buggy source:
public void popupDismissed(boolean topPopupOnly){
  if (mPopupStatus == POPUP_SECOND_LEVEL) {
    initializePopup();
    mPopupStatus=POPUP_FIRST_LEVEL;
    if (topPopupOnly)     mUI.showPopup(mPopup);
  }
}

Fixed version (ground truth):
public void popupDismissed(boolean topPopupOnly){
  if (mPopupStatus == POPUP_SECOND_LEVEL) {
    initializePopup();
    mPopupStatus=POPUP_FIRST_LEVEL;
    if (topPopupOnly) {
      if (popupNum == 1)       mUI.showPopup(mPopup1);
 else       if (popupNum == 2)       mUI.showPopup(mPopup2);
    }
  }
 else {
    initializePopup();
  }
}
Program: 38296
Project: 38296
Buggy source:
@Override public void onPreferenceClicked(ListPreference pref){
  if (mPopupStatus != POPUP_FIRST_LEVEL)   return;
  LayoutInflater inflater=(LayoutInflater)mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  if (CameraSettings.KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL.equals(pref.getKey())) {
    TimeIntervalPopup timeInterval=(TimeIntervalPopup)inflater.inflate(R.layout.time_interval_popup,null,false);
    timeInterval.initialize((IconListPreference)pref);
    timeInterval.setSettingChangedListener(this);
    mUI.dismissPopup(true);
    mPopup=timeInterval;
  }
 else {
    ListPrefSettingPopup basic=(ListPrefSettingPopup)inflater.inflate(R.layout.list_pref_setting_popup,null,false);
    basic.initialize(pref);
    basic.setSettingChangedListener(this);
    mUI.dismissPopup(true);
    mPopup=basic;
  }
  mUI.showPopup(mPopup);
  mPopupStatus=POPUP_SECOND_LEVEL;
}

Fixed version (ground truth):
@Override public void onPreferenceClicked(ListPreference pref){
  if (mPopupStatus != POPUP_FIRST_LEVEL)   return;
  LayoutInflater inflater=(LayoutInflater)mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  if (CameraSettings.KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL.equals(pref.getKey())) {
    TimeIntervalPopup timeInterval=(TimeIntervalPopup)inflater.inflate(R.layout.time_interval_popup,null,false);
    timeInterval.initialize((IconListPreference)pref);
    timeInterval.setSettingChangedListener(this);
    mUI.dismissPopup(true);
    mPopup1=timeInterval;
  }
 else {
    ListPrefSettingPopup basic=(ListPrefSettingPopup)inflater.inflate(R.layout.list_pref_setting_popup,null,false);
    basic.initialize(pref);
    basic.setSettingChangedListener(this);
    mUI.dismissPopup(true);
    mPopup1=basic;
  }
  mUI.showPopup(mPopup1);
  mPopupStatus=POPUP_SECOND_LEVEL;
}
Program: 38297
Project: 38297
Buggy source:
@Override public void overrideSettings(final String... keyvalues){
  super.overrideSettings(keyvalues);
  if (mPopup == null || mPopupStatus != POPUP_FIRST_LEVEL) {
    mPopupStatus=POPUP_FIRST_LEVEL;
    initializePopup();
  }
  ((MoreSettingPopup)mPopup).overrideSettings(keyvalues);
}

Fixed version (ground truth):
@Override public void overrideSettings(final String... keyvalues){
  super.overrideSettings(keyvalues);
  if (((mPopup1 == null) && (mPopup2 == null)) || mPopupStatus != POPUP_FIRST_LEVEL) {
    mPopupStatus=POPUP_FIRST_LEVEL;
    initializePopup();
  }
  ((MoreSettingPopup)mPopup1).overrideSettings(keyvalues);
  ((MoreSettingPopup)mPopup2).overrideSettings(keyvalues);
}
Program: 38298
Project: 38298
Buggy source:
@Override protected Bitmap doInBackground(Void... params){
  Bitmap bitmap=CameraUtil.downSample(mData,DOWN_SAMPLE_FACTOR);
  if (mOrientation != 0 || mMirror) {
    Matrix m=new Matrix();
    m.preRotate(mOrientation);
    if (mMirror) {
      m.setScale(-1f,1f);
    }
    return Bitmap.createBitmap(bitmap,0,0,bitmap.getWidth(),bitmap.getHeight(),m,false);
  }
  return bitmap;
}

Fixed version (ground truth):
@Override protected Bitmap doInBackground(Void... params){
  Bitmap bitmap=CameraUtil.downSample(mData,DOWN_SAMPLE_FACTOR);
  if (mOrientation != 0 || mMirror) {
    Matrix m=new Matrix();
    if (mMirror) {
      m.setScale(-1f,1f);
    }
    m.preRotate(mOrientation);
    return Bitmap.createBitmap(bitmap,0,0,bitmap.getWidth(),bitmap.getHeight(),m,false);
  }
  return bitmap;
}
Program: 38299
Project: 38299
Buggy source:
@Override public void stopPreview(){
  if (mCameraDevice != null && mCameraState != PREVIEW_STOPPED) {
    Log.v(TAG,"String_Node_Str");
    mCameraDevice.stopPreview();
    mFaceDetectionStarted=false;
  }
  setCameraState(PREVIEW_STOPPED);
  if (mFocusManager != null)   mFocusManager.onPreviewStopped();
}

Fixed version (ground truth):
@Override public void stopPreview(){
  if (mCameraDevice != null && mCameraState != PREVIEW_STOPPED) {
    Log.v(TAG,"String_Node_Str");
    mCameraDevice.stopPreview();
  }
  setCameraState(PREVIEW_STOPPED);
  if (mFocusManager != null)   mFocusManager.onPreviewStopped();
}
Program: 38300
Project: 38300
Buggy source:
private void startCameraPreview(){
  if (mCameraDevice == null) {
    return;
  }
  if (mUI.getSurfaceTexture() == null) {
    return;
  }
synchronized (mRendererLock) {
    if (mCameraTexture == null)     return;
    if (mCameraState != PREVIEW_STOPPED)     stopCameraPreview();
    mCameraDevice.setDisplayOrientation(0);
    mCameraTexture.setOnFrameAvailableListener(this);
    mCameraDevice.setPreviewTexture(mCameraTexture);
  }
  mCameraDevice.startPreview();
  mCameraState=PREVIEW_ACTIVE;
}

Fixed version (ground truth):
private void startCameraPreview(){
  if (mCameraDevice == null) {
    return;
  }
  if (mUI.getSurfaceTexture() == null) {
    return;
  }
synchronized (mRendererLock) {
    if (mCameraTexture == null)     return;
    if (mCameraState != PREVIEW_STOPPED)     stopCameraPreview();
    if (mCameraOrientation == 0)     mCameraDevice.setDisplayOrientation(270);
 else     mCameraDevice.setDisplayOrientation(0);
    if (mCameraTexture != null)     mCameraTexture.setOnFrameAvailableListener(this);
    mCameraDevice.setPreviewTexture(mCameraTexture);
  }
  mCameraDevice.startPreview();
  mCameraState=PREVIEW_ACTIVE;
}
Program: 38301
Project: 38301
Buggy source:
private int getCaptureOrientation(){
  int orientation;
  if (mUsingFrontCamera) {
    orientation=(mDeviceOrientationAtCapture - mCameraOrientation + 360) % 360;
  }
 else {
    orientation=(mDeviceOrientationAtCapture + mCameraOrientation) % 360;
  }
  return orientation;
}

Fixed version (ground truth):
private int getCaptureOrientation(){
  int orientation;
  int cameraOrientation=mCameraOrientation;
  if (mDeviceOrientationAtCapture == 270 || mDeviceOrientationAtCapture == 90) {
    if (mCameraOrientation == 0)     cameraOrientation=180;
  }
  if (mUsingFrontCamera) {
    orientation=(mDeviceOrientationAtCapture - cameraOrientation + 360) % 360;
  }
 else {
    orientation=(mDeviceOrientationAtCapture + cameraOrientation) % 360;
  }
  return orientation;
}
Program: 38302
Project: 38302
Buggy source:
private void startCameraPreview(){
  if (mCameraDevice == null) {
    return;
  }
  if (mUI.getSurfaceTexture() == null) {
    return;
  }
synchronized (mRendererLock) {
    if (mCameraTexture == null)     return;
    if (mCameraState != PREVIEW_STOPPED)     stopCameraPreview();
    if (mCameraOrientation == 0)     mCameraDevice.setDisplayOrientation(270);
 else     mCameraDevice.setDisplayOrientation(0);
    if (mCameraTexture != null)     mCameraTexture.setOnFrameAvailableListener(this);
    mCameraDevice.setPreviewTexture(mCameraTexture);
  }
  mCameraDevice.startPreview();
  mCameraState=PREVIEW_ACTIVE;
}

Fixed version (ground truth):
private void startCameraPreview(){
  if (mCameraDevice == null) {
    return;
  }
  if (mUI.getSurfaceTexture() == null) {
    return;
  }
synchronized (mRendererLock) {
    if (mCameraTexture == null)     return;
    if (mCameraState != PREVIEW_STOPPED)     stopCameraPreview();
    mPanoAngle=(mCameraOrientation - 90 + 360) % 360;
    mCameraDevice.setDisplayOrientation(mPanoAngle);
    if (mCameraTexture != null)     mCameraTexture.setOnFrameAvailableListener(this);
    mCameraDevice.setPreviewTexture(mCameraTexture);
  }
  mCameraDevice.startPreview();
  mCameraState=PREVIEW_ACTIVE;
}
Program: 38303
Project: 38303
Buggy source:
private int getCaptureOrientation(){
  int orientation;
  int cameraOrientation=mCameraOrientation;
  if (mDeviceOrientationAtCapture == 270 || mDeviceOrientationAtCapture == 90) {
    if (mCameraOrientation == 0)     cameraOrientation=180;
  }
  if (mUsingFrontCamera) {
    orientation=(mDeviceOrientationAtCapture - cameraOrientation + 360) % 360;
  }
 else {
    orientation=(mDeviceOrientationAtCapture + cameraOrientation) % 360;
  }
  return orientation;
}

Fixed version (ground truth):
private int getCaptureOrientation(){
  int orientation;
  if (mUsingFrontCamera) {
    orientation=(mDeviceOrientationAtCapture - mCameraOrientation - mPanoAngle + 360) % 360;
  }
 else {
    orientation=(mDeviceOrientationAtCapture + mCameraOrientation - mPanoAngle) % 360;
  }
  return orientation;
}
Program: 38304
Project: 38304
Buggy source:
@Override protected Bitmap doInBackground(Void... params){
  Bitmap bitmap=CameraUtil.downSample(mData,DOWN_SAMPLE_FACTOR);
  if (mOrientation != 0 || mMirror) {
    Matrix m=new Matrix();
    m.preRotate(mOrientation);
    if (mMirror) {
      m.setScale(-1f,1f);
    }
    return Bitmap.createBitmap(bitmap,0,0,bitmap.getWidth(),bitmap.getHeight(),m,false);
  }
  return bitmap;
}

Fixed version (ground truth):
@Override protected Bitmap doInBackground(Void... params){
  Bitmap bitmap=CameraUtil.downSample(mData,DOWN_SAMPLE_FACTOR);
  if (mOrientation != 0 || mMirror) {
    Matrix m=new Matrix();
    if (mMirror) {
      m.setScale(-1f,1f);
    }
    m.preRotate(mOrientation);
    return Bitmap.createBitmap(bitmap,0,0,bitmap.getWidth(),bitmap.getHeight(),m,false);
  }
  return bitmap;
}
Program: 38305
Project: 38305
Buggy source:
/** 
 * Used to update the flash mode. Video mode can turn on the flash as torch mode, which we would like to turn on and off when we switching in and out to the preview.
 * @param forceOff whether we want to force the flash off.
 */
private void forceFlashOff(boolean forceOff){
  if (!mPreviewing || mParameters.getFlashMode() == null) {
    return;
  }
  forceFlashOffIfSupported(forceOff);
  mCameraDevice.setParameters(mParameters);
}

Fixed version (ground truth):
/** 
 * Used to update the flash mode. Video mode can turn on the flash as torch mode, which we would like to turn on and off when we switching in and out to the preview.
 * @param forceOff whether we want to force the flash off.
 */
private void forceFlashOff(boolean forceOff){
  if (!mPreviewing || mParameters.getFlashMode() == null) {
    return;
  }
  forceFlashOffIfSupported(forceOff);
  mCameraDevice.setParameters(mParameters);
  mUI.updateOnScreenIndicators(mParameters,mPreferences);
}
Program: 38306
Project: 38306
Buggy source:
public boolean isVisible(){
  return mTextureView.getVisibility() == View.VISIBLE;
}

Fixed version (ground truth):
public boolean isVisible(){
  return mCameraControls.getVisibility() == View.VISIBLE;
}
Program: 38307
Project: 38307
Buggy source:
/** 
 * Used to update the flash mode. Video mode can turn on the flash as torch mode, which we would like to turn on and off when we switching in and out to the preview.
 * @param forceOff whether we want to force the flash off.
 */
private void forceFlashOff(boolean forceOff){
  if (!mPreviewing || mParameters.getFlashMode() == null) {
    return;
  }
  forceFlashOffIfSupported(forceOff);
  mCameraDevice.setParameters(mParameters);
}

Fixed version (ground truth):
/** 
 * Used to update the flash mode. Video mode can turn on the flash as torch mode, which we would like to turn on and off when we switching in and out to the preview.
 * @param forceOff whether we want to force the flash off.
 */
private void forceFlashOff(boolean forceOff){
  if (!mPreviewing || mParameters.getFlashMode() == null) {
    return;
  }
  forceFlashOffIfSupported(forceOff);
  mCameraDevice.setParameters(mParameters);
  mUI.updateOnScreenIndicators(mParameters,mPreferences);
}
Program: 38308
Project: 38308
Buggy source:
public boolean isVisible(){
  return mTextureView.getVisibility() == View.VISIBLE;
}

Fixed version (ground truth):
public boolean isVisible(){
  return mCameraControls.getVisibility() == View.VISIBLE;
}
Program: 38309
Project: 38309
Buggy source:
/** 
 * Used to update the flash mode. Video mode can turn on the flash as torch mode, which we would like to turn on and off when we switching in and out to the preview.
 * @param forceOff whether we want to force the flash off.
 */
private void forceFlashOff(boolean forceOff){
  if (!mPreviewing || mParameters.getFlashMode() == null) {
    return;
  }
  forceFlashOffIfSupported(forceOff);
  mCameraDevice.setParameters(mParameters);
}

Fixed version (ground truth):
/** 
 * Used to update the flash mode. Video mode can turn on the flash as torch mode, which we would like to turn on and off when we switching in and out to the preview.
 * @param forceOff whether we want to force the flash off.
 */
private void forceFlashOff(boolean forceOff){
  if (!mPreviewing || mParameters.getFlashMode() == null) {
    return;
  }
  forceFlashOffIfSupported(forceOff);
  mCameraDevice.setParameters(mParameters);
  mUI.updateOnScreenIndicators(mParameters,mPreferences);
}
Program: 38310
Project: 38310
Buggy source:
public boolean isVisible(){
  return mTextureView.getVisibility() == View.VISIBLE;
}

Fixed version (ground truth):
public boolean isVisible(){
  return mCameraControls.getVisibility() == View.VISIBLE;
}
Program: 38311
Project: 38311
Buggy source:
@Override @OnClickAttr public void onReviewCancelClicked(View v){
  mIsInReviewMode=false;
  if (mCurrentVideoUri != null) {
    mContentResolver.delete(mCurrentVideoUri,null,null);
  }
  doReturnToCaller(false);
}

Fixed version (ground truth):
@Override @OnClickAttr public void onReviewCancelClicked(View v){
  if (mIsInReviewMode && mCurrentVideoUri != null) {
    mContentResolver.delete(mCurrentVideoUri,null,null);
  }
  mIsInReviewMode=false;
  doReturnToCaller(false);
}
Program: 38312
Project: 38312
Buggy source:
@Override @OnClickAttr public void onReviewCancelClicked(View v){
  mIsInReviewMode=false;
  if (mCurrentVideoUri != null) {
    mContentResolver.delete(mCurrentVideoUri,null,null);
  }
  doReturnToCaller(false);
}

Fixed version (ground truth):
@Override @OnClickAttr public void onReviewCancelClicked(View v){
  if (mIsInReviewMode && mCurrentVideoUri != null) {
    mContentResolver.delete(mCurrentVideoUri,null,null);
  }
  mIsInReviewMode=false;
  doReturnToCaller(false);
}
Program: 38313
Project: 38313
Buggy source:
@Override @OnClickAttr public void onReviewCancelClicked(View v){
  mIsInReviewMode=false;
  if (mCurrentVideoUri != null) {
    mContentResolver.delete(mCurrentVideoUri,null,null);
  }
  doReturnToCaller(false);
}

Fixed version (ground truth):
@Override @OnClickAttr public void onReviewCancelClicked(View v){
  if (mIsInReviewMode && mCurrentVideoUri != null) {
    mContentResolver.delete(mCurrentVideoUri,null,null);
  }
  mIsInReviewMode=false;
  doReturnToCaller(false);
}
Program: 38314
Project: 38314
Buggy source:
@Override public Result doInBackground(Request message){
  RenderingRequest request=((Render)message).request;
  RenderResult result=null;
  mHighresPreviewPipeline.render(request);
  result=new RenderResult();
  result.request=request;
  return result;
}

Fixed version (ground truth):
@Override public Result doInBackground(Request message){
  RenderingRequest request=((Render)message).request;
  RenderResult result=null;
  mHighresPreviewPipeline.renderHighres(request);
  result=new RenderResult();
  result.request=request;
  return result;
}
Program: 38316
Project: 38316
Buggy source:
private void startLoadBitmap(Uri uri){
  mLoading=true;
  final View loading=findViewById(R.id.loading);
  final View imageShow=findViewById(R.id.imageShow);
  imageShow.setVisibility(View.INVISIBLE);
  loading.setVisibility(View.VISIBLE);
  mShowingTinyPlanet=false;
  mLoadBitmapTask=new LoadBitmapTask();
  mLoadBitmapTask.execute(uri);
}

Fixed version (ground truth):
private void startLoadBitmap(Uri uri){
  final View loading=findViewById(R.id.loading);
  final View imageShow=findViewById(R.id.imageShow);
  imageShow.setVisibility(View.INVISIBLE);
  loading.setVisibility(View.VISIBLE);
  mShowingTinyPlanet=false;
  mLoadBitmapTask=new LoadBitmapTask();
  mLoadBitmapTask.execute(uri);
}
Program: 38318
Project: 38318
Buggy source:
private Uri resetToOriginalImageIfNeeded(ImagePreset preset){
  Uri uri=null;
  if (!preset.hasModifications()) {
    File srcFile=getLocalFileFromUri(mContext,mSourceUri);
    if (srcFile != null) {
      srcFile.renameTo(mDestinationFile);
      uri=SaveImage.updateUriContent(mContext,mSelectedImageUri,mDestinationFile,System.currentTimeMillis());
    }
  }
  return uri;
}

Fixed version (ground truth):
private Uri resetToOriginalImageIfNeeded(ImagePreset preset){
  Uri uri=null;
  if (!preset.hasModifications()) {
    File srcFile=getLocalFileFromUri(mContext,mSourceUri);
    if (srcFile != null) {
      srcFile.renameTo(mDestinationFile);
      uri=SaveImage.linkNewFileToUri(mContext,mSelectedImageUri,mDestinationFile,System.currentTimeMillis());
    }
  }
  return uri;
}
Program: 38319
Project: 38319
Buggy source:
public static Uri makeAndInsertUri(Context context,Uri sourceUri){
  long time=System.currentTimeMillis();
  String filename=new SimpleDateFormat(TIME_STAMP_NAME).format(new Date(time));
  File saveDirectory=getFinalSaveDirectory(context,sourceUri);
  File file=new File(saveDirectory,filename + "String_Node_Str");
  return updateUriContent(context,sourceUri,file,time);
}

Fixed version (ground truth):
public static Uri makeAndInsertUri(Context context,Uri sourceUri){
  long time=System.currentTimeMillis();
  String filename=new SimpleDateFormat(TIME_STAMP_NAME).format(new Date(time));
  File saveDirectory=getFinalSaveDirectory(context,sourceUri);
  File file=new File(saveDirectory,filename + "String_Node_Str");
  return linkNewFileToUri(context,sourceUri,file,time);
}
Program: 38321
Project: 38321
Buggy source:
public void enableSave(boolean enable){
  if (mSaveButton != null)   mSaveButton.setEnabled(enable);
}

Fixed version (ground truth):
public void enableSave(boolean enable){
  if (mSaveButton != null) {
    mSaveButton.setEnabled(enable);
  }
}
Program: 38322
Project: 38322
Buggy source:
public void onNewValue(int parameter){
  invalidate();
  mActivity.enableSave(hasModifications());
}

Fixed version (ground truth):
public void onNewValue(int parameter){
  invalidate();
}
Program: 38323
Project: 38323
Buggy source:
@Override public void available(RenderingRequest request){
  if (request.getBitmap() == null) {
    return;
  }
  if (request.getType() == RenderingRequest.GEOMETRY_RENDERING) {
    mGeometryOnlyBitmap=request.getBitmap();
  }
  if (request.getType() == RenderingRequest.FILTERS_RENDERING) {
    mFiltersOnlyBitmap=request.getBitmap();
  }
  if (request.getType() == RenderingRequest.PARTIAL_RENDERING && request.getScaleFactor() == getScaleFactor()) {
    mPartialBitmap=request.getBitmap();
    notifyObservers();
  }
  if (request.getType() == RenderingRequest.HIGHRES_RENDERING) {
    mHighresBitmap=request.getBitmap();
    notifyObservers();
  }
}

Fixed version (ground truth):
@Override public void available(RenderingRequest request){
  if (request.getBitmap() == null) {
    return;
  }
  boolean needsCheckModification=false;
  if (request.getType() == RenderingRequest.GEOMETRY_RENDERING) {
    mGeometryOnlyBitmap=request.getBitmap();
    needsCheckModification=true;
  }
  if (request.getType() == RenderingRequest.FILTERS_RENDERING) {
    mFiltersOnlyBitmap=request.getBitmap();
    needsCheckModification=true;
  }
  if (request.getType() == RenderingRequest.PARTIAL_RENDERING && request.getScaleFactor() == getScaleFactor()) {
    mPartialBitmap=request.getBitmap();
    notifyObservers();
    needsCheckModification=true;
  }
  if (request.getType() == RenderingRequest.HIGHRES_RENDERING) {
    mHighresBitmap=request.getBitmap();
    notifyObservers();
    needsCheckModification=true;
  }
  if (needsCheckModification) {
    mActivity.enableSave(hasModifications());
  }
}
Program: 38324
Project: 38324
Buggy source:
public void updatePresets(boolean force){
  if (force || mGeometryOnlyPreset == null) {
    ImagePreset newPreset=new ImagePreset(mPreset);
    newPreset.setDoApplyFilters(false);
    newPreset.setDoApplyGeometry(true);
    if (force || mGeometryOnlyPreset == null || !newPreset.same(mGeometryOnlyPreset)) {
      mGeometryOnlyPreset=newPreset;
      RenderingRequest.post(mLoader.getOriginalBitmapLarge(),mGeometryOnlyPreset,RenderingRequest.GEOMETRY_RENDERING,this);
    }
  }
  if (force || mFiltersOnlyPreset == null) {
    ImagePreset newPreset=new ImagePreset(mPreset);
    newPreset.setDoApplyFilters(true);
    newPreset.setDoApplyGeometry(false);
    if (force || mFiltersOnlyPreset == null || !newPreset.same(mFiltersOnlyPreset)) {
      mFiltersOnlyPreset=newPreset;
      RenderingRequest.post(mLoader.getOriginalBitmapLarge(),mFiltersOnlyPreset,RenderingRequest.FILTERS_RENDERING,this);
    }
  }
  invalidatePreview();
  mActivity.enableSave(hasModifications());
}

Fixed version (ground truth):
public void updatePresets(boolean force){
  if (force || mGeometryOnlyPreset == null) {
    ImagePreset newPreset=new ImagePreset(mPreset);
    newPreset.setDoApplyFilters(false);
    newPreset.setDoApplyGeometry(true);
    if (force || mGeometryOnlyPreset == null || !newPreset.same(mGeometryOnlyPreset)) {
      mGeometryOnlyPreset=newPreset;
      RenderingRequest.post(mLoader.getOriginalBitmapLarge(),mGeometryOnlyPreset,RenderingRequest.GEOMETRY_RENDERING,this);
    }
  }
  if (force || mFiltersOnlyPreset == null) {
    ImagePreset newPreset=new ImagePreset(mPreset);
    newPreset.setDoApplyFilters(true);
    newPreset.setDoApplyGeometry(false);
    if (force || mFiltersOnlyPreset == null || !newPreset.same(mFiltersOnlyPreset)) {
      mFiltersOnlyPreset=newPreset;
      RenderingRequest.post(mLoader.getOriginalBitmapLarge(),mFiltersOnlyPreset,RenderingRequest.FILTERS_RENDERING,this);
    }
  }
  invalidatePreview();
}
Program: 38325
Project: 38325
Buggy source:
public synchronized boolean hasModifications(){
  if (mPreset == null) {
    return getLoadedPreset() != null;
  }
 else {
    return !mPreset.same(getLoadedPreset());
  }
}

Fixed version (ground truth):
public synchronized boolean hasModifications(){
  ImagePreset loadedPreset=getLoadedPreset();
  if (mPreset == null) {
    if (loadedPreset == null) {
      return false;
    }
 else {
      return loadedPreset.hasModifications();
    }
  }
 else {
    if (loadedPreset == null) {
      return mPreset.hasModifications();
    }
 else {
      return !mPreset.equals(getLoadedPreset());
    }
  }
}
Program: 38326
Project: 38326
Buggy source:
public void enableSave(boolean enable){
  if (mSaveButton != null)   mSaveButton.setEnabled(enable);
}

Fixed version (ground truth):
public void enableSave(boolean enable){
  if (mSaveButton != null) {
    mSaveButton.setEnabled(enable);
  }
}
Program: 38327
Project: 38327
Buggy source:
public void onNewValue(int parameter){
  invalidate();
  mActivity.enableSave(hasModifications());
}

Fixed version (ground truth):
public void onNewValue(int parameter){
  invalidate();
}
Program: 38328
Project: 38328
Buggy source:
@Override public void available(RenderingRequest request){
  if (request.getBitmap() == null) {
    return;
  }
  if (request.getType() == RenderingRequest.GEOMETRY_RENDERING) {
    mGeometryOnlyBitmap=request.getBitmap();
  }
  if (request.getType() == RenderingRequest.FILTERS_RENDERING) {
    mFiltersOnlyBitmap=request.getBitmap();
  }
  if (request.getType() == RenderingRequest.PARTIAL_RENDERING && request.getScaleFactor() == getScaleFactor()) {
    mPartialBitmap=request.getBitmap();
    notifyObservers();
  }
  if (request.getType() == RenderingRequest.HIGHRES_RENDERING) {
    mHighresBitmap=request.getBitmap();
    notifyObservers();
  }
}

Fixed version (ground truth):
@Override public void available(RenderingRequest request){
  if (request.getBitmap() == null) {
    return;
  }
  boolean needsCheckModification=false;
  if (request.getType() == RenderingRequest.GEOMETRY_RENDERING) {
    mGeometryOnlyBitmap=request.getBitmap();
    needsCheckModification=true;
  }
  if (request.getType() == RenderingRequest.FILTERS_RENDERING) {
    mFiltersOnlyBitmap=request.getBitmap();
    needsCheckModification=true;
  }
  if (request.getType() == RenderingRequest.PARTIAL_RENDERING && request.getScaleFactor() == getScaleFactor()) {
    mPartialBitmap=request.getBitmap();
    notifyObservers();
    needsCheckModification=true;
  }
  if (request.getType() == RenderingRequest.HIGHRES_RENDERING) {
    mHighresBitmap=request.getBitmap();
    notifyObservers();
    needsCheckModification=true;
  }
  if (needsCheckModification) {
    mActivity.enableSave(hasModifications());
  }
}
Program: 38329
Project: 38329
Buggy source:
public void updatePresets(boolean force){
  if (force || mGeometryOnlyPreset == null) {
    ImagePreset newPreset=new ImagePreset(mPreset);
    newPreset.setDoApplyFilters(false);
    newPreset.setDoApplyGeometry(true);
    if (force || mGeometryOnlyPreset == null || !newPreset.same(mGeometryOnlyPreset)) {
      mGeometryOnlyPreset=newPreset;
      RenderingRequest.post(mLoader.getOriginalBitmapLarge(),mGeometryOnlyPreset,RenderingRequest.GEOMETRY_RENDERING,this);
    }
  }
  if (force || mFiltersOnlyPreset == null) {
    ImagePreset newPreset=new ImagePreset(mPreset);
    newPreset.setDoApplyFilters(true);
    newPreset.setDoApplyGeometry(false);
    if (force || mFiltersOnlyPreset == null || !newPreset.same(mFiltersOnlyPreset)) {
      mFiltersOnlyPreset=newPreset;
      RenderingRequest.post(mLoader.getOriginalBitmapLarge(),mFiltersOnlyPreset,RenderingRequest.FILTERS_RENDERING,this);
    }
  }
  invalidatePreview();
  mActivity.enableSave(hasModifications());
}

Fixed version (ground truth):
public void updatePresets(boolean force){
  if (force || mGeometryOnlyPreset == null) {
    ImagePreset newPreset=new ImagePreset(mPreset);
    newPreset.setDoApplyFilters(false);
    newPreset.setDoApplyGeometry(true);
    if (force || mGeometryOnlyPreset == null || !newPreset.same(mGeometryOnlyPreset)) {
      mGeometryOnlyPreset=newPreset;
      RenderingRequest.post(mLoader.getOriginalBitmapLarge(),mGeometryOnlyPreset,RenderingRequest.GEOMETRY_RENDERING,this);
    }
  }
  if (force || mFiltersOnlyPreset == null) {
    ImagePreset newPreset=new ImagePreset(mPreset);
    newPreset.setDoApplyFilters(true);
    newPreset.setDoApplyGeometry(false);
    if (force || mFiltersOnlyPreset == null || !newPreset.same(mFiltersOnlyPreset)) {
      mFiltersOnlyPreset=newPreset;
      RenderingRequest.post(mLoader.getOriginalBitmapLarge(),mFiltersOnlyPreset,RenderingRequest.FILTERS_RENDERING,this);
    }
  }
  invalidatePreview();
}
Program: 38330
Project: 38330
Buggy source:
public synchronized boolean hasModifications(){
  if (mPreset == null) {
    return getLoadedPreset() != null;
  }
 else {
    return !mPreset.same(getLoadedPreset());
  }
}

Fixed version (ground truth):
public synchronized boolean hasModifications(){
  ImagePreset loadedPreset=getLoadedPreset();
  if (mPreset == null) {
    if (loadedPreset == null) {
      return false;
    }
 else {
      return loadedPreset.hasModifications();
    }
  }
 else {
    if (loadedPreset == null) {
      return mPreset.hasModifications();
    }
 else {
      return !mPreset.equals(getLoadedPreset());
    }
  }
}
Program: 38331
Project: 38331
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.undoButton:
{
      HistoryAdapter adapter=mMasterImage.getHistory();
      int position=adapter.undo();
      mMasterImage.onHistoryItemClick(position);
      mImageShow.showToast("String_Node_Str");
      invalidateViews();
      return true;
    }
case R.id.redoButton:
{
    HistoryAdapter adapter=mMasterImage.getHistory();
    int position=adapter.redo();
    mMasterImage.onHistoryItemClick(position);
    mImageShow.showToast("String_Node_Str");
    invalidateViews();
    return true;
  }
case R.id.resetHistoryButton:
{
  resetHistory();
  return true;
}
case R.id.showImageStateButton:
{
toggleImageStatePanel();
return true;
}
case android.R.id.home:
{
saveImage();
return true;
}
}
return false;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.undoButton:
{
      HistoryAdapter adapter=mMasterImage.getHistory();
      int position=adapter.undo();
      mMasterImage.onHistoryItemClick(position);
      mImageShow.showToast("String_Node_Str");
      backToMain();
      invalidateViews();
      return true;
    }
case R.id.redoButton:
{
    HistoryAdapter adapter=mMasterImage.getHistory();
    int position=adapter.redo();
    mMasterImage.onHistoryItemClick(position);
    mImageShow.showToast("String_Node_Str");
    invalidateViews();
    return true;
  }
case R.id.resetHistoryButton:
{
  resetHistory();
  return true;
}
case R.id.showImageStateButton:
{
toggleImageStatePanel();
return true;
}
case android.R.id.home:
{
saveImage();
return true;
}
}
return false;
}
Program: 38332
Project: 38332
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.undoButton:
{
      HistoryAdapter adapter=mMasterImage.getHistory();
      int position=adapter.undo();
      mMasterImage.onHistoryItemClick(position);
      mImageShow.showToast("String_Node_Str");
      invalidateViews();
      return true;
    }
case R.id.redoButton:
{
    HistoryAdapter adapter=mMasterImage.getHistory();
    int position=adapter.redo();
    mMasterImage.onHistoryItemClick(position);
    mImageShow.showToast("String_Node_Str");
    invalidateViews();
    return true;
  }
case R.id.resetHistoryButton:
{
  resetHistory();
  return true;
}
case R.id.showImageStateButton:
{
toggleImageStatePanel();
return true;
}
case android.R.id.home:
{
saveImage();
return true;
}
}
return false;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.undoButton:
{
      HistoryAdapter adapter=mMasterImage.getHistory();
      int position=adapter.undo();
      mMasterImage.onHistoryItemClick(position);
      mImageShow.showToast("String_Node_Str");
      backToMain();
      invalidateViews();
      return true;
    }
case R.id.redoButton:
{
    HistoryAdapter adapter=mMasterImage.getHistory();
    int position=adapter.redo();
    mMasterImage.onHistoryItemClick(position);
    mImageShow.showToast("String_Node_Str");
    invalidateViews();
    return true;
  }
case R.id.resetHistoryButton:
{
  resetHistory();
  return true;
}
case R.id.showImageStateButton:
{
toggleImageStatePanel();
return true;
}
case android.R.id.home:
{
saveImage();
return true;
}
}
return false;
}
Program: 38333
Project: 38333
Buggy source:
/** 
 * Resizes rectangle to have a certain aspect ratio (center remains stationary) while constraining it to remain within the original rect.
 * @param r rectangle to resize
 * @param w new width aspect
 * @param h new height aspect
 */
public static void fixAspectRatioContained(RectF r,float w,float h){
  float origW=r.width();
  float origH=r.height();
  float origA=origW / origH;
  float a=w / h;
  float finalW=origW;
  float finalH=origH;
  if (origA < a) {
    finalH=origW / a;
  }
 else {
    finalW=origH * a;
  }
  float centX=r.centerX();
  float centY=r.centerY();
  float hw=finalW / 2;
  float hh=finalH / 2;
  r.set(centX - hw,centY - hh,centX + hw,centY + hh);
}

Fixed version (ground truth):
/** 
 * Resizes rectangle to have a certain aspect ratio (center remains stationary) while constraining it to remain within the original rect.
 * @param r rectangle to resize
 * @param w new width aspect
 * @param h new height aspect
 */
public static void fixAspectRatioContained(RectF r,float w,float h){
  float origW=r.width();
  float origH=r.height();
  float origA=origW / origH;
  float a=w / h;
  float finalW=origW;
  float finalH=origH;
  if (origA < a) {
    finalH=origW / a;
    r.top=r.centerY() - finalH / 2;
    r.bottom=r.top + finalH;
  }
 else {
    finalW=origH * a;
    r.left=r.centerX() - finalW / 2;
    r.right=r.left + finalW;
  }
}
Program: 38335
Project: 38335
Buggy source:
private void fillFx(LinearLayout listFilters,int buttonId){
  FilterFxRepresentation[] fxArray=new FilterFxRepresentation[18];
  int p=0;
  int[] drawid={R.drawable.filtershow_fx_0005_punch,R.drawable.filtershow_fx_0000_vintage,R.drawable.filtershow_fx_0004_bw_contrast,R.drawable.filtershow_fx_0002_bleach,R.drawable.filtershow_fx_0001_instant,R.drawable.filtershow_fx_0007_washout,R.drawable.filtershow_fx_0003_blue_crush,R.drawable.filtershow_fx_0008_washout_color,R.drawable.filtershow_fx_0006_x_process};
  int[] fxNameid={R.string.ffx_punch,R.string.ffx_vintage,R.string.ffx_bw_contrast,R.string.ffx_bleach,R.string.ffx_instant,R.string.ffx_washout,R.string.ffx_blue_crush,R.string.ffx_washout_color,R.string.ffx_x_process};
  for (int i=0; i < drawid.length; i++) {
    FilterFxRepresentation fx=new FilterFxRepresentation(getString(fxNameid[i]),drawid[i],fxNameid[i]);
    fxArray[p++]=fx;
  }
  ImageButton button=(ImageButton)findViewById(buttonId);
  FilterFxRepresentation nullFx=new FilterFxRepresentation(getString(R.string.none),0,R.string.none);
  mNullFxFilter=setupFilterRepresentationButton(nullFx,listFilters,button);
  mNullFxFilter.setSelected(true);
  Vector<FilterRepresentation> filtersRepresentations=new Vector<FilterRepresentation>();
  FiltersManager.getManager().addLooks(filtersRepresentations);
  for (  FilterRepresentation representation : filtersRepresentations) {
    setupFilterRepresentationButton(representation,listFilters,button);
  }
  for (int i=0; i < p; i++) {
    setupFilterRepresentationButton(fxArray[i],listFilters,button);
  }
}

Fixed version (ground truth):
private void fillFx(LinearLayout listFilters,int buttonId){
  ImageButton button=(ImageButton)findViewById(buttonId);
  FilterFxRepresentation nullFx=new FilterFxRepresentation(getString(R.string.none),0,R.string.none);
  mNullFxFilter=setupFilterRepresentationButton(nullFx,listFilters,button);
  mNullFxFilter.setSelected(true);
  Vector<FilterRepresentation> filtersRepresentations=new Vector<FilterRepresentation>();
  FiltersManager.getManager().addLooks(this,filtersRepresentations);
  for (  FilterRepresentation representation : filtersRepresentations) {
    setupFilterRepresentationButton(representation,listFilters,button);
  }
}
Program: 38336
Project: 38336
Buggy source:
private void setupBorders(){
  LinearLayout list=(LinearLayout)findViewById(R.id.listBorders);
  Vector<FilterRepresentation> borders=new Vector<FilterRepresentation>();
  ImageButton borderButton=(ImageButton)findViewById(R.id.borderButton);
  borders.add(new FilterImageBorderRepresentation(0));
  FiltersManager.getManager().addBorders(borders);
  borders.add(new FilterImageBorderRepresentation(R.drawable.filtershow_border_4x5));
  borders.add(new FilterImageBorderRepresentation(R.drawable.filtershow_border_brush));
  borders.add(new FilterImageBorderRepresentation(R.drawable.filtershow_border_grunge));
  borders.add(new FilterImageBorderRepresentation(R.drawable.filtershow_border_sumi_e));
  borders.add(new FilterImageBorderRepresentation(R.drawable.filtershow_border_tape));
  borders.add(new FilterColorBorderRepresentation(Color.BLACK,mImageBorderSize,0));
  borders.add(new FilterColorBorderRepresentation(Color.BLACK,mImageBorderSize,mImageBorderSize));
  borders.add(new FilterColorBorderRepresentation(Color.WHITE,mImageBorderSize,0));
  borders.add(new FilterColorBorderRepresentation(Color.WHITE,mImageBorderSize,mImageBorderSize));
  int creamColor=Color.argb(255,237,237,227);
  borders.add(new FilterColorBorderRepresentation(creamColor,mImageBorderSize,0));
  borders.add(new FilterColorBorderRepresentation(creamColor,mImageBorderSize,mImageBorderSize));
  for (int i=0; i < borders.size(); i++) {
    FilterRepresentation filter=borders.elementAt(i);
    filter.setName(getString(R.string.borders));
    if (i == 0) {
      filter.setName(getString(R.string.none));
    }
    FilterIconButton b=setupFilterRepresentationButton(filter,list,borderButton);
    if (i == 0) {
      mNullBorderFilter=b;
      mNullBorderFilter.setSelected(true);
    }
  }
}

Fixed version (ground truth):
private void setupBorders(){
  LinearLayout list=(LinearLayout)findViewById(R.id.listBorders);
  Vector<FilterRepresentation> borders=new Vector<FilterRepresentation>();
  ImageButton borderButton=(ImageButton)findViewById(R.id.borderButton);
  borders.add(new FilterImageBorderRepresentation(0));
  FiltersManager.getManager().addBorders(this,borders);
  for (int i=0; i < borders.size(); i++) {
    FilterRepresentation filter=borders.elementAt(i);
    if (i == 0) {
      filter.setName(getString(R.string.none));
    }
    FilterIconButton b=setupFilterRepresentationButton(filter,list,borderButton);
    if (i == 0) {
      mNullBorderFilter=b;
      mNullBorderFilter.setSelected(true);
    }
  }
}
Program: 38337
Project: 38337
Buggy source:
public void setOriginal(Bitmap bitmap){
  if (mPipelineIsOn) {
    Log.e(LOGTAG,"String_Node_Str");
    return;
  }
  Log.v(LOGTAG,"String_Node_Str" + bitmap.getWidth() + "String_Node_Str"+ bitmap.getHeight());
  mAccessoryPipeline.setOriginal(bitmap);
  mPreviewPipeline.setOriginal(bitmap);
  mHighresPreviewPipeline.setOriginal(bitmap);
}

Fixed version (ground truth):
public void setOriginal(Bitmap bitmap){
  if (mPipelineIsOn) {
    Log.e(LOGTAG,"String_Node_Str");
    return;
  }
  mAccessoryPipeline.setOriginal(bitmap);
  mPreviewPipeline.setOriginal(bitmap);
  mHighresPreviewPipeline.setOriginal(bitmap);
}
Program: 38338
Project: 38338
Buggy source:
public void addBorders(Vector<FilterRepresentation> representations){
}

Fixed version (ground truth):
public void addBorders(Context context,Vector<FilterRepresentation> representations){
}
Program: 38339
Project: 38339
Buggy source:
public void addLooks(Vector<FilterRepresentation> representations){
}

Fixed version (ground truth):
public void addLooks(Context context,Vector<FilterRepresentation> representations){
  int[] drawid={R.drawable.filtershow_fx_0005_punch,R.drawable.filtershow_fx_0000_vintage,R.drawable.filtershow_fx_0004_bw_contrast,R.drawable.filtershow_fx_0002_bleach,R.drawable.filtershow_fx_0001_instant,R.drawable.filtershow_fx_0007_washout,R.drawable.filtershow_fx_0003_blue_crush,R.drawable.filtershow_fx_0008_washout_color,R.drawable.filtershow_fx_0006_x_process};
  int[] fxNameid={R.string.ffx_punch,R.string.ffx_vintage,R.string.ffx_bw_contrast,R.string.ffx_bleach,R.string.ffx_instant,R.string.ffx_washout,R.string.ffx_blue_crush,R.string.ffx_washout_color,R.string.ffx_x_process};
  for (int i=0; i < drawid.length; i++) {
    FilterFxRepresentation fx=new FilterFxRepresentation(context.getString(fxNameid[i]),drawid[i],fxNameid[i]);
    representations.add(fx);
  }
}
Program: 38340
Project: 38340
Buggy source:
private void fillFx(LinearLayout listFilters,int buttonId){
  FilterFxRepresentation[] fxArray=new FilterFxRepresentation[18];
  int p=0;
  int[] drawid={R.drawable.filtershow_fx_0005_punch,R.drawable.filtershow_fx_0000_vintage,R.drawable.filtershow_fx_0004_bw_contrast,R.drawable.filtershow_fx_0002_bleach,R.drawable.filtershow_fx_0001_instant,R.drawable.filtershow_fx_0007_washout,R.drawable.filtershow_fx_0003_blue_crush,R.drawable.filtershow_fx_0008_washout_color,R.drawable.filtershow_fx_0006_x_process};
  int[] fxNameid={R.string.ffx_punch,R.string.ffx_vintage,R.string.ffx_bw_contrast,R.string.ffx_bleach,R.string.ffx_instant,R.string.ffx_washout,R.string.ffx_blue_crush,R.string.ffx_washout_color,R.string.ffx_x_process};
  for (int i=0; i < drawid.length; i++) {
    FilterFxRepresentation fx=new FilterFxRepresentation(getString(fxNameid[i]),drawid[i],fxNameid[i]);
    fxArray[p++]=fx;
  }
  ImageButton button=(ImageButton)findViewById(buttonId);
  FilterFxRepresentation nullFx=new FilterFxRepresentation(getString(R.string.none),0,R.string.none);
  mNullFxFilter=setupFilterRepresentationButton(nullFx,listFilters,button);
  mNullFxFilter.setSelected(true);
  Vector<FilterRepresentation> filtersRepresentations=new Vector<FilterRepresentation>();
  FiltersManager.getManager().addLooks(filtersRepresentations);
  for (  FilterRepresentation representation : filtersRepresentations) {
    setupFilterRepresentationButton(representation,listFilters,button);
  }
  for (int i=0; i < p; i++) {
    setupFilterRepresentationButton(fxArray[i],listFilters,button);
  }
}

Fixed version (ground truth):
private void fillFx(LinearLayout listFilters,int buttonId){
  ImageButton button=(ImageButton)findViewById(buttonId);
  FilterFxRepresentation nullFx=new FilterFxRepresentation(getString(R.string.none),0,R.string.none);
  mNullFxFilter=setupFilterRepresentationButton(nullFx,listFilters,button);
  mNullFxFilter.setSelected(true);
  Vector<FilterRepresentation> filtersRepresentations=new Vector<FilterRepresentation>();
  FiltersManager.getManager().addLooks(this,filtersRepresentations);
  for (  FilterRepresentation representation : filtersRepresentations) {
    setupFilterRepresentationButton(representation,listFilters,button);
  }
}
Program: 38341
Project: 38341
Buggy source:
private void setupBorders(){
  LinearLayout list=(LinearLayout)findViewById(R.id.listBorders);
  Vector<FilterRepresentation> borders=new Vector<FilterRepresentation>();
  ImageButton borderButton=(ImageButton)findViewById(R.id.borderButton);
  borders.add(new FilterImageBorderRepresentation(0));
  FiltersManager.getManager().addBorders(borders);
  borders.add(new FilterImageBorderRepresentation(R.drawable.filtershow_border_4x5));
  borders.add(new FilterImageBorderRepresentation(R.drawable.filtershow_border_brush));
  borders.add(new FilterImageBorderRepresentation(R.drawable.filtershow_border_grunge));
  borders.add(new FilterImageBorderRepresentation(R.drawable.filtershow_border_sumi_e));
  borders.add(new FilterImageBorderRepresentation(R.drawable.filtershow_border_tape));
  borders.add(new FilterColorBorderRepresentation(Color.BLACK,mImageBorderSize,0));
  borders.add(new FilterColorBorderRepresentation(Color.BLACK,mImageBorderSize,mImageBorderSize));
  borders.add(new FilterColorBorderRepresentation(Color.WHITE,mImageBorderSize,0));
  borders.add(new FilterColorBorderRepresentation(Color.WHITE,mImageBorderSize,mImageBorderSize));
  int creamColor=Color.argb(255,237,237,227);
  borders.add(new FilterColorBorderRepresentation(creamColor,mImageBorderSize,0));
  borders.add(new FilterColorBorderRepresentation(creamColor,mImageBorderSize,mImageBorderSize));
  for (int i=0; i < borders.size(); i++) {
    FilterRepresentation filter=borders.elementAt(i);
    filter.setName(getString(R.string.borders));
    if (i == 0) {
      filter.setName(getString(R.string.none));
    }
    FilterIconButton b=setupFilterRepresentationButton(filter,list,borderButton);
    if (i == 0) {
      mNullBorderFilter=b;
      mNullBorderFilter.setSelected(true);
    }
  }
}

Fixed version (ground truth):
private void setupBorders(){
  LinearLayout list=(LinearLayout)findViewById(R.id.listBorders);
  Vector<FilterRepresentation> borders=new Vector<FilterRepresentation>();
  ImageButton borderButton=(ImageButton)findViewById(R.id.borderButton);
  borders.add(new FilterImageBorderRepresentation(0));
  FiltersManager.getManager().addBorders(this,borders);
  for (int i=0; i < borders.size(); i++) {
    FilterRepresentation filter=borders.elementAt(i);
    if (i == 0) {
      filter.setName(getString(R.string.none));
    }
    FilterIconButton b=setupFilterRepresentationButton(filter,list,borderButton);
    if (i == 0) {
      mNullBorderFilter=b;
      mNullBorderFilter.setSelected(true);
    }
  }
}
Program: 38342
Project: 38342
Buggy source:
public void setOriginal(Bitmap bitmap){
  if (mPipelineIsOn) {
    Log.e(LOGTAG,"String_Node_Str");
    return;
  }
  Log.v(LOGTAG,"String_Node_Str" + bitmap.getWidth() + "String_Node_Str"+ bitmap.getHeight());
  mAccessoryPipeline.setOriginal(bitmap);
  mPreviewPipeline.setOriginal(bitmap);
  mHighresPreviewPipeline.setOriginal(bitmap);
}

Fixed version (ground truth):
public void setOriginal(Bitmap bitmap){
  if (mPipelineIsOn) {
    Log.e(LOGTAG,"String_Node_Str");
    return;
  }
  mAccessoryPipeline.setOriginal(bitmap);
  mPreviewPipeline.setOriginal(bitmap);
  mHighresPreviewPipeline.setOriginal(bitmap);
}
Program: 38343
Project: 38343
Buggy source:
public void addBorders(Vector<FilterRepresentation> representations){
}

Fixed version (ground truth):
public void addBorders(Context context,Vector<FilterRepresentation> representations){
}
Program: 38344
Project: 38344
Buggy source:
public void addLooks(Vector<FilterRepresentation> representations){
}

Fixed version (ground truth):
public void addLooks(Context context,Vector<FilterRepresentation> representations){
  int[] drawid={R.drawable.filtershow_fx_0005_punch,R.drawable.filtershow_fx_0000_vintage,R.drawable.filtershow_fx_0004_bw_contrast,R.drawable.filtershow_fx_0002_bleach,R.drawable.filtershow_fx_0001_instant,R.drawable.filtershow_fx_0007_washout,R.drawable.filtershow_fx_0003_blue_crush,R.drawable.filtershow_fx_0008_washout_color,R.drawable.filtershow_fx_0006_x_process};
  int[] fxNameid={R.string.ffx_punch,R.string.ffx_vintage,R.string.ffx_bw_contrast,R.string.ffx_bleach,R.string.ffx_instant,R.string.ffx_washout,R.string.ffx_blue_crush,R.string.ffx_washout_color,R.string.ffx_x_process};
  for (int i=0; i < drawid.length; i++) {
    FilterFxRepresentation fx=new FilterFxRepresentation(context.getString(fxNameid[i]),drawid[i],fxNameid[i]);
    representations.add(fx);
  }
}
Program: 38346
Project: 38346
Buggy source:
@Override public void run(){
  mMenuTask=null;
  if (jc.isCancelled())   return;
  MenuExecutor.updateMenuOperation(mMenu,operation);
  MenuExecutor.updateMenuForPanorama(mMenu,supportCallback.mAllPanorama360,supportCallback.mHasPanorama360);
  if (mSharePanoramaMenuItem != null) {
    mSharePanoramaMenuItem.setEnabled(true);
    if (supportCallback.mAllPanorama360) {
      mShareMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
      mShareMenuItem.setTitle(mActivity.getResources().getString(R.string.share_as_photo));
    }
 else {
      mSharePanoramaMenuItem.setVisible(false);
      mShareMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
      mShareMenuItem.setTitle(mActivity.getResources().getString(R.string.share));
    }
    mSharePanoramaActionProvider.setShareIntent(share_panorama_intent);
  }
  if (mShareMenuItem != null) {
    mShareMenuItem.setEnabled(true);
    mShareActionProvider.setShareIntent(share_intent);
  }
}

Fixed version (ground truth):
@Override public void run(){
  mMenuTask=null;
  if (jc.isCancelled())   return;
  MenuExecutor.updateMenuOperation(mMenu,operation);
  MenuExecutor.updateMenuForPanorama(mMenu,canSharePanoramas && supportCallback.mAllPanorama360,canSharePanoramas && supportCallback.mHasPanorama360);
  if (mSharePanoramaMenuItem != null) {
    mSharePanoramaMenuItem.setEnabled(true);
    if (canSharePanoramas && supportCallback.mAllPanorama360) {
      mShareMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
      mShareMenuItem.setTitle(mActivity.getResources().getString(R.string.share_as_photo));
    }
 else {
      mSharePanoramaMenuItem.setVisible(false);
      mShareMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
      mShareMenuItem.setTitle(mActivity.getResources().getString(R.string.share));
    }
    mSharePanoramaActionProvider.setShareIntent(share_panorama_intent);
  }
  if (mShareMenuItem != null) {
    mShareMenuItem.setEnabled(canShare);
    mShareActionProvider.setShareIntent(share_intent);
  }
}