nus-yam/ex-repair huggingface dataset:
Program: 195724
Project: 195724
Buggy source:
private static final View createScrim(Context context){
  View view=new View(context);
  int flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN| WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
  final int stretch=ViewGroup.LayoutParams.MATCH_PARENT;
  final int type=WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM;
  WindowManager.LayoutParams lp=new WindowManager.LayoutParams(stretch,stretch,type,flags,PixelFormat.TRANSLUCENT);
  lp.softInputMode=WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
  lp.screenOrientation=ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
  lp.setTitle("String_Node_Str");
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(view,lp);
  view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_RECENT| View.STATUS_BAR_DISABLE_EXPAND| View.STATUS_BAR_DISABLE_SEARCH);
  return view;
}

Fixed version (ground truth):
private static final View createScrim(Context context){
  View view=new View(context);
  int flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN| WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
  final int stretch=ViewGroup.LayoutParams.MATCH_PARENT;
  final int type=WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM;
  WindowManager.LayoutParams lp=new WindowManager.LayoutParams(stretch,stretch,type,flags,PixelFormat.TRANSLUCENT);
  lp.softInputMode=WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
  lp.screenOrientation=ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
  lp.setTitle("String_Node_Str");
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(view,lp);
  view.setVisibility(View.GONE);
  view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_RECENT| View.STATUS_BAR_DISABLE_EXPAND| View.STATUS_BAR_DISABLE_SEARCH);
  return view;
}
Program: 195725
Project: 195725
Buggy source:
public void onScreenTurnedOn(final ShowListener showListener){
  if (mKeyguardService != null) {
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showListener + "String_Node_Str");
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
  }
 else {
    Slog.w(TAG,"String_Node_Str");
    mShowListenerWhenConnect=showListener;
    showScrim();
  }
  mKeyguardState.screenIsOn=true;
}

Fixed version (ground truth):
public void onScreenTurnedOn(final ShowListener showListener){
  if (mKeyguardService != null) {
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showListener + "String_Node_Str");
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
  }
 else {
    Slog.w(TAG,"String_Node_Str");
    showListener.onShown(null);
  }
  mKeyguardState.screenIsOn=true;
}
Program: 195726
Project: 195726
Buggy source:
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mKeyguardService=new KeyguardServiceWrapper(mContext,IKeyguardService.Stub.asInterface(service));
  if (mKeyguardState.systemIsReady) {
    mKeyguardService.onSystemReady();
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(mShowListenerWhenConnect));
    if (mShowListenerWhenConnect != null) {
      Log.v(TAG,"String_Node_Str");
      mShowListenerWhenConnect=null;
      hideScrim();
    }
  }
  if (mKeyguardState.bootCompleted) {
    mKeyguardService.onBootCompleted();
  }
}

Fixed version (ground truth):
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mKeyguardService=new KeyguardServiceWrapper(mContext,IKeyguardService.Stub.asInterface(service));
  if (mKeyguardState.systemIsReady) {
    mKeyguardService.onSystemReady();
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(null));
  }
  if (mKeyguardState.bootCompleted) {
    mKeyguardService.onBootCompleted();
  }
}
Program: 195727
Project: 195727
Buggy source:
private static final View createScrim(Context context){
  View view=new View(context);
  int flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN| WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
  final int stretch=ViewGroup.LayoutParams.MATCH_PARENT;
  final int type=WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM;
  WindowManager.LayoutParams lp=new WindowManager.LayoutParams(stretch,stretch,type,flags,PixelFormat.TRANSLUCENT);
  lp.softInputMode=WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
  lp.screenOrientation=ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
  lp.setTitle("String_Node_Str");
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(view,lp);
  view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_RECENT| View.STATUS_BAR_DISABLE_EXPAND| View.STATUS_BAR_DISABLE_SEARCH);
  return view;
}

Fixed version (ground truth):
private static final View createScrim(Context context){
  View view=new View(context);
  int flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN| WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
  final int stretch=ViewGroup.LayoutParams.MATCH_PARENT;
  final int type=WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM;
  WindowManager.LayoutParams lp=new WindowManager.LayoutParams(stretch,stretch,type,flags,PixelFormat.TRANSLUCENT);
  lp.softInputMode=WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
  lp.screenOrientation=ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
  lp.setTitle("String_Node_Str");
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(view,lp);
  view.setVisibility(View.GONE);
  view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_RECENT| View.STATUS_BAR_DISABLE_EXPAND| View.STATUS_BAR_DISABLE_SEARCH);
  return view;
}
Program: 195728
Project: 195728
Buggy source:
public void onScreenTurnedOn(final ShowListener showListener){
  if (mKeyguardService != null) {
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showListener + "String_Node_Str");
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
  }
 else {
    Slog.w(TAG,"String_Node_Str");
    mShowListenerWhenConnect=showListener;
    showScrim();
  }
  mKeyguardState.screenIsOn=true;
}

Fixed version (ground truth):
public void onScreenTurnedOn(final ShowListener showListener){
  if (mKeyguardService != null) {
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showListener + "String_Node_Str");
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
  }
 else {
    Slog.w(TAG,"String_Node_Str");
    showListener.onShown(null);
  }
  mKeyguardState.screenIsOn=true;
}
Program: 195729
Project: 195729
Buggy source:
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mKeyguardService=new KeyguardServiceWrapper(mContext,IKeyguardService.Stub.asInterface(service));
  if (mKeyguardState.systemIsReady) {
    mKeyguardService.onSystemReady();
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(mShowListenerWhenConnect));
    if (mShowListenerWhenConnect != null) {
      Log.v(TAG,"String_Node_Str");
      mShowListenerWhenConnect=null;
      hideScrim();
    }
  }
  if (mKeyguardState.bootCompleted) {
    mKeyguardService.onBootCompleted();
  }
}

Fixed version (ground truth):
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mKeyguardService=new KeyguardServiceWrapper(mContext,IKeyguardService.Stub.asInterface(service));
  if (mKeyguardState.systemIsReady) {
    mKeyguardService.onSystemReady();
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(null));
  }
  if (mKeyguardState.bootCompleted) {
    mKeyguardService.onBootCompleted();
  }
}
Program: 195730
Project: 195730
Buggy source:
private static final View createScrim(Context context){
  View view=new View(context);
  int flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN| WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
  final int stretch=ViewGroup.LayoutParams.MATCH_PARENT;
  final int type=WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM;
  WindowManager.LayoutParams lp=new WindowManager.LayoutParams(stretch,stretch,type,flags,PixelFormat.TRANSLUCENT);
  lp.softInputMode=WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
  lp.screenOrientation=ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
  lp.setTitle("String_Node_Str");
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(view,lp);
  view.setVisibility(View.GONE);
  view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_RECENT| View.STATUS_BAR_DISABLE_EXPAND| View.STATUS_BAR_DISABLE_SEARCH);
  return view;
}

Fixed version (ground truth):
private static final View createScrim(Context context){
  View view=new View(context);
  int flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN| WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
  final int stretch=ViewGroup.LayoutParams.MATCH_PARENT;
  final int type=WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM;
  WindowManager.LayoutParams lp=new WindowManager.LayoutParams(stretch,stretch,type,flags,PixelFormat.TRANSLUCENT);
  lp.softInputMode=WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
  lp.screenOrientation=ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
  lp.setTitle("String_Node_Str");
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(view,lp);
  view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_RECENT| View.STATUS_BAR_DISABLE_EXPAND| View.STATUS_BAR_DISABLE_SEARCH);
  return view;
}
Program: 195731
Project: 195731
Buggy source:
public void onScreenTurnedOn(final ShowListener showListener){
  if (mKeyguardService != null) {
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showListener + "String_Node_Str");
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
  }
 else {
    Slog.w(TAG,"String_Node_Str");
    showListener.onShown(null);
  }
  mKeyguardState.screenIsOn=true;
}

Fixed version (ground truth):
public void onScreenTurnedOn(final ShowListener showListener){
  if (mKeyguardService != null) {
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showListener + "String_Node_Str");
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
  }
 else {
    Slog.w(TAG,"String_Node_Str");
    mShowListenerWhenConnect=showListener;
    showScrim();
  }
  mKeyguardState.screenIsOn=true;
}
Program: 195732
Project: 195732
Buggy source:
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mKeyguardService=new KeyguardServiceWrapper(mContext,IKeyguardService.Stub.asInterface(service));
  if (mKeyguardState.systemIsReady) {
    mKeyguardService.onSystemReady();
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(null));
  }
  if (mKeyguardState.bootCompleted) {
    mKeyguardService.onBootCompleted();
  }
}

Fixed version (ground truth):
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mKeyguardService=new KeyguardServiceWrapper(mContext,IKeyguardService.Stub.asInterface(service));
  if (mKeyguardState.systemIsReady) {
    mKeyguardService.onSystemReady();
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(mShowListenerWhenConnect));
    if (mShowListenerWhenConnect != null) {
      Log.v(TAG,"String_Node_Str");
      mShowListenerWhenConnect=null;
      hideScrim();
    }
  }
  if (mKeyguardState.bootCompleted) {
    mKeyguardService.onBootCompleted();
  }
}
Program: 195733
Project: 195733
Buggy source:
boolean checkAllowNonWakeupDelayLocked(long nowELAPSED){
  if (mInteractive) {
    return false;
  }
  if (mLastAlarmDeliveryTime <= 0) {
    return false;
  }
  if (mPendingNonWakeupAlarms.size() > 0 && mNextNonWakeupDeliveryTime > nowELAPSED) {
    return false;
  }
  long timeSinceLast=nowELAPSED - mLastAlarmDeliveryTime;
  return timeSinceLast <= currentNonWakeupFuzzLocked(nowELAPSED);
}

Fixed version (ground truth):
boolean checkAllowNonWakeupDelayLocked(long nowELAPSED){
  if (mInteractive) {
    return false;
  }
  if (mLastAlarmDeliveryTime <= 0) {
    return false;
  }
  if (mPendingNonWakeupAlarms.size() > 0 && mNextNonWakeupDeliveryTime < nowELAPSED) {
    return false;
  }
  long timeSinceLast=nowELAPSED - mLastAlarmDeliveryTime;
  return timeSinceLast <= currentNonWakeupFuzzLocked(nowELAPSED);
}
Program: 195734
Project: 195734
Buggy source:
private static final View createScrim(Context context){
  View view=new View(context);
  int flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN| WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
  final int stretch=ViewGroup.LayoutParams.MATCH_PARENT;
  final int type=WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM;
  WindowManager.LayoutParams lp=new WindowManager.LayoutParams(stretch,stretch,type,flags,PixelFormat.TRANSLUCENT);
  lp.softInputMode=WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
  lp.screenOrientation=ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
  lp.setTitle("String_Node_Str");
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(view,lp);
  view.setVisibility(View.GONE);
  view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_RECENT| View.STATUS_BAR_DISABLE_EXPAND| View.STATUS_BAR_DISABLE_SEARCH);
  return view;
}

Fixed version (ground truth):
private static final View createScrim(Context context){
  View view=new View(context);
  int flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN| WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
  final int stretch=ViewGroup.LayoutParams.MATCH_PARENT;
  final int type=WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM;
  WindowManager.LayoutParams lp=new WindowManager.LayoutParams(stretch,stretch,type,flags,PixelFormat.TRANSLUCENT);
  lp.softInputMode=WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
  lp.screenOrientation=ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
  lp.setTitle("String_Node_Str");
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(view,lp);
  view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_RECENT| View.STATUS_BAR_DISABLE_EXPAND| View.STATUS_BAR_DISABLE_SEARCH);
  return view;
}
Program: 195735
Project: 195735
Buggy source:
public void onScreenTurnedOn(final ShowListener showListener){
  if (mKeyguardService != null) {
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showListener + "String_Node_Str");
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
  }
 else {
    Slog.w(TAG,"String_Node_Str");
    showListener.onShown(null);
  }
  mKeyguardState.screenIsOn=true;
}

Fixed version (ground truth):
public void onScreenTurnedOn(final ShowListener showListener){
  if (mKeyguardService != null) {
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showListener + "String_Node_Str");
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
  }
 else {
    Slog.w(TAG,"String_Node_Str");
    mShowListenerWhenConnect=showListener;
    showScrim();
  }
  mKeyguardState.screenIsOn=true;
}
Program: 195736
Project: 195736
Buggy source:
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mKeyguardService=new KeyguardServiceWrapper(mContext,IKeyguardService.Stub.asInterface(service));
  if (mKeyguardState.systemIsReady) {
    mKeyguardService.onSystemReady();
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(null));
  }
  if (mKeyguardState.bootCompleted) {
    mKeyguardService.onBootCompleted();
  }
}

Fixed version (ground truth):
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mKeyguardService=new KeyguardServiceWrapper(mContext,IKeyguardService.Stub.asInterface(service));
  if (mKeyguardState.systemIsReady) {
    mKeyguardService.onSystemReady();
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(mShowListenerWhenConnect));
    if (mShowListenerWhenConnect != null) {
      Log.v(TAG,"String_Node_Str");
      mShowListenerWhenConnect=null;
      hideScrim();
    }
  }
  if (mKeyguardState.bootCompleted) {
    mKeyguardService.onBootCompleted();
  }
}
Program: 195743
Project: 195743
Buggy source:
private static final View createScrim(Context context){
  View view=new View(context);
  int flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN| WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
  final int stretch=ViewGroup.LayoutParams.MATCH_PARENT;
  final int type=WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM;
  WindowManager.LayoutParams lp=new WindowManager.LayoutParams(stretch,stretch,type,flags,PixelFormat.TRANSLUCENT);
  lp.softInputMode=WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
  lp.screenOrientation=ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
  lp.setTitle("String_Node_Str");
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(view,lp);
  view.setVisibility(View.GONE);
  view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_RECENT| View.STATUS_BAR_DISABLE_EXPAND| View.STATUS_BAR_DISABLE_SEARCH);
  return view;
}

Fixed version (ground truth):
private static final View createScrim(Context context){
  View view=new View(context);
  int flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN| WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
  final int stretch=ViewGroup.LayoutParams.MATCH_PARENT;
  final int type=WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM;
  WindowManager.LayoutParams lp=new WindowManager.LayoutParams(stretch,stretch,type,flags,PixelFormat.TRANSLUCENT);
  lp.softInputMode=WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
  lp.screenOrientation=ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
  lp.setTitle("String_Node_Str");
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(view,lp);
  view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_RECENT| View.STATUS_BAR_DISABLE_EXPAND| View.STATUS_BAR_DISABLE_SEARCH);
  return view;
}
Program: 195744
Project: 195744
Buggy source:
public void onScreenTurnedOn(final ShowListener showListener){
  if (mKeyguardService != null) {
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showListener + "String_Node_Str");
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
  }
 else {
    Slog.w(TAG,"String_Node_Str");
    showListener.onShown(null);
  }
  mKeyguardState.screenIsOn=true;
}

Fixed version (ground truth):
public void onScreenTurnedOn(final ShowListener showListener){
  if (mKeyguardService != null) {
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showListener + "String_Node_Str");
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
  }
 else {
    Slog.w(TAG,"String_Node_Str");
    mShowListenerWhenConnect=showListener;
    showScrim();
  }
  mKeyguardState.screenIsOn=true;
}
Program: 195745
Project: 195745
Buggy source:
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mKeyguardService=new KeyguardServiceWrapper(mContext,IKeyguardService.Stub.asInterface(service));
  if (mKeyguardState.systemIsReady) {
    mKeyguardService.onSystemReady();
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(null));
  }
  if (mKeyguardState.bootCompleted) {
    mKeyguardService.onBootCompleted();
  }
}

Fixed version (ground truth):
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mKeyguardService=new KeyguardServiceWrapper(mContext,IKeyguardService.Stub.asInterface(service));
  if (mKeyguardState.systemIsReady) {
    mKeyguardService.onSystemReady();
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(mShowListenerWhenConnect));
    if (mShowListenerWhenConnect != null) {
      Log.v(TAG,"String_Node_Str");
      mShowListenerWhenConnect=null;
      hideScrim();
    }
  }
  if (mKeyguardState.bootCompleted) {
    mKeyguardService.onBootCompleted();
  }
}
Program: 195748
Project: 195748
Buggy source:
private static final View createScrim(Context context){
  View view=new View(context);
  int flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN| WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
  final int stretch=ViewGroup.LayoutParams.MATCH_PARENT;
  final int type=WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM;
  WindowManager.LayoutParams lp=new WindowManager.LayoutParams(stretch,stretch,type,flags,PixelFormat.TRANSLUCENT);
  lp.softInputMode=WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
  lp.screenOrientation=ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
  lp.setTitle("String_Node_Str");
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(view,lp);
  view.setVisibility(View.GONE);
  view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_RECENT| View.STATUS_BAR_DISABLE_EXPAND| View.STATUS_BAR_DISABLE_SEARCH);
  return view;
}

Fixed version (ground truth):
private static final View createScrim(Context context){
  View view=new View(context);
  int flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN| WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
  final int stretch=ViewGroup.LayoutParams.MATCH_PARENT;
  final int type=WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM;
  WindowManager.LayoutParams lp=new WindowManager.LayoutParams(stretch,stretch,type,flags,PixelFormat.TRANSLUCENT);
  lp.softInputMode=WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
  lp.screenOrientation=ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
  lp.setTitle("String_Node_Str");
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  wm.addView(view,lp);
  view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_RECENT| View.STATUS_BAR_DISABLE_EXPAND| View.STATUS_BAR_DISABLE_SEARCH);
  return view;
}
Program: 195749
Project: 195749
Buggy source:
public void onScreenTurnedOn(final ShowListener showListener){
  if (mKeyguardService != null) {
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showListener + "String_Node_Str");
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
  }
 else {
    Slog.w(TAG,"String_Node_Str");
    showListener.onShown(null);
  }
  mKeyguardState.screenIsOn=true;
}

Fixed version (ground truth):
public void onScreenTurnedOn(final ShowListener showListener){
  if (mKeyguardService != null) {
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + showListener + "String_Node_Str");
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
  }
 else {
    Slog.w(TAG,"String_Node_Str");
    mShowListenerWhenConnect=showListener;
    showScrim();
  }
  mKeyguardState.screenIsOn=true;
}
Program: 195750
Project: 195750
Buggy source:
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mKeyguardService=new KeyguardServiceWrapper(mContext,IKeyguardService.Stub.asInterface(service));
  if (mKeyguardState.systemIsReady) {
    mKeyguardService.onSystemReady();
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(null));
  }
  if (mKeyguardState.bootCompleted) {
    mKeyguardService.onBootCompleted();
  }
}

Fixed version (ground truth):
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  mKeyguardService=new KeyguardServiceWrapper(mContext,IKeyguardService.Stub.asInterface(service));
  if (mKeyguardState.systemIsReady) {
    mKeyguardService.onSystemReady();
    mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(mShowListenerWhenConnect));
    if (mShowListenerWhenConnect != null) {
      Log.v(TAG,"String_Node_Str");
      mShowListenerWhenConnect=null;
      hideScrim();
    }
  }
  if (mKeyguardState.bootCompleted) {
    mKeyguardService.onBootCompleted();
  }
}
Program: 195753
Project: 195753
Buggy source:
@Override public void createAnimation(final LockPatternView.CellState animatedCell,long delay,long duration,float translationY,final boolean appearing,Interpolator interpolator,final Runnable finishListener){
  if (appearing) {
    animatedCell.scale=0.0f;
  }
  animatedCell.translateY=appearing ? translationY : 0;
  ValueAnimator animator=ValueAnimator.ofFloat(animatedCell.translateY,appearing ? 0 : translationY);
  animator.setInterpolator(interpolator);
  animator.setDuration(duration);
  animator.setStartDelay(delay);
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      float animatedFraction=animation.getAnimatedFraction();
      if (appearing) {
        animatedCell.scale=animatedFraction;
      }
 else {
        animatedCell.alpha=1 - animatedFraction;
      }
      animatedCell.translateY=(float)animation.getAnimatedValue();
      mLockPatternView.invalidate();
    }
  }
);
  if (finishListener != null) {
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        finishListener.run();
      }
    }
);
    mAppearAnimationUtils.createAnimation(mEcaView,delay,duration,translationY,appearing,interpolator,null);
  }
  animator.start();
  mLockPatternView.invalidate();
}

Fixed version (ground truth):
@Override public void createAnimation(final LockPatternView.CellState animatedCell,long delay,long duration,float translationY,final boolean appearing,Interpolator interpolator,final Runnable finishListener){
  if (appearing) {
    animatedCell.scale=0.0f;
    animatedCell.alpha=1.0f;
  }
  animatedCell.translateY=appearing ? translationY : 0;
  ValueAnimator animator=ValueAnimator.ofFloat(animatedCell.translateY,appearing ? 0 : translationY);
  animator.setInterpolator(interpolator);
  animator.setDuration(duration);
  animator.setStartDelay(delay);
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      float animatedFraction=animation.getAnimatedFraction();
      if (appearing) {
        animatedCell.scale=animatedFraction;
      }
 else {
        animatedCell.alpha=1 - animatedFraction;
      }
      animatedCell.translateY=(float)animation.getAnimatedValue();
      mLockPatternView.invalidate();
    }
  }
);
  if (finishListener != null) {
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        finishListener.run();
      }
    }
);
    mAppearAnimationUtils.createAnimation(mEcaView,delay,duration,translationY,appearing,interpolator,null);
  }
  animator.start();
  mLockPatternView.invalidate();
}
Program: 195754
Project: 195754
Buggy source:
public void setDark(boolean dark,boolean fade,long delay){
  super.setDark(dark,fade,delay);
  if (mDark == dark) {
    return;
  }
  mDark=dark;
  if (!dark && fade) {
    if (mActivated) {
      mBackgroundDimmed.setVisibility(View.VISIBLE);
      mBackgroundNormal.setVisibility(View.VISIBLE);
    }
 else {
      mBackgroundDimmed.setVisibility(View.VISIBLE);
      mBackgroundNormal.setVisibility(View.INVISIBLE);
    }
    fadeDarkToDimmed(delay);
  }
 else {
    updateBackground();
  }
}

Fixed version (ground truth):
public void setDark(boolean dark,boolean fade,long delay){
  super.setDark(dark,fade,delay);
  if (mDark == dark) {
    return;
  }
  mDark=dark;
  if (!dark && fade) {
    if (mActivated) {
      mBackgroundDimmed.setVisibility(View.VISIBLE);
      mBackgroundNormal.setVisibility(View.VISIBLE);
    }
 else     if (mDimmed) {
      mBackgroundDimmed.setVisibility(View.VISIBLE);
      mBackgroundNormal.setVisibility(View.INVISIBLE);
    }
 else {
      mBackgroundDimmed.setVisibility(View.INVISIBLE);
      mBackgroundNormal.setVisibility(View.VISIBLE);
    }
    fadeInFromDark(delay);
  }
 else {
    updateBackground();
  }
}
Program: 195755
Project: 195755
Buggy source:
public void updateDismissView(boolean visible){
  int oldVisibility=mDismissView.willBeGone() ? GONE : mDismissView.getVisibility();
  int newVisibility=visible ? VISIBLE : GONE;
  if (oldVisibility != newVisibility) {
    if (newVisibility != GONE) {
      if (mDismissView.willBeGone()) {
        mDismissView.cancelAnimation();
      }
 else {
        mDismissView.setInvisible();
      }
      mDismissView.setVisibility(newVisibility);
      mDismissView.setWillBeGone(false);
      updateContentHeight();
      notifyHeightChangeListener(mDismissView);
    }
 else {
      Runnable dimissHideFinishRunnable=new Runnable(){
        @Override public void run(){
          mDismissView.setVisibility(GONE);
          mDismissView.setWillBeGone(false);
          updateContentHeight();
          notifyHeightChangeListener(mDismissView);
        }
      }
;
      if (mDismissView.isButtonVisible() && mIsExpanded) {
        mDismissView.setWillBeGone(true);
        mDismissView.performVisibilityAnimation(false,dimissHideFinishRunnable);
      }
 else {
        dimissHideFinishRunnable.run();
        mDismissView.showClearButton();
      }
    }
  }
}

Fixed version (ground truth):
public void updateDismissView(boolean visible){
  int oldVisibility=mDismissView.willBeGone() ? GONE : mDismissView.getVisibility();
  int newVisibility=visible ? VISIBLE : GONE;
  if (oldVisibility != newVisibility) {
    if (newVisibility != GONE) {
      if (mDismissView.willBeGone()) {
        mDismissView.cancelAnimation();
      }
 else {
        mDismissView.setInvisible();
      }
      mDismissView.setVisibility(newVisibility);
      mDismissView.setWillBeGone(false);
      updateContentHeight();
      notifyHeightChangeListener(mDismissView);
    }
 else {
      Runnable dimissHideFinishRunnable=new Runnable(){
        @Override public void run(){
          mDismissView.setVisibility(GONE);
          mDismissView.setWillBeGone(false);
          updateContentHeight();
          notifyHeightChangeListener(mDismissView);
        }
      }
;
      if (mDismissView.isButtonVisible() && mIsExpanded && mAnimationsEnabled) {
        mDismissView.setWillBeGone(true);
        mDismissView.performVisibilityAnimation(false,dimissHideFinishRunnable);
      }
 else {
        dimissHideFinishRunnable.run();
        mDismissView.showClearButton();
      }
    }
  }
}
Program: 195756
Project: 195756
Buggy source:
public void updateEmptyShadeView(boolean visible){
  int oldVisibility=mEmptyShadeView.willBeGone() ? GONE : mEmptyShadeView.getVisibility();
  int newVisibility=visible ? VISIBLE : GONE;
  if (oldVisibility != newVisibility) {
    if (newVisibility != GONE) {
      if (mEmptyShadeView.willBeGone()) {
        mEmptyShadeView.cancelAnimation();
      }
 else {
        mEmptyShadeView.setInvisible();
      }
      mEmptyShadeView.setVisibility(newVisibility);
      mEmptyShadeView.setWillBeGone(false);
      updateContentHeight();
      notifyHeightChangeListener(mDismissView);
    }
 else {
      mEmptyShadeView.setWillBeGone(true);
      mEmptyShadeView.performVisibilityAnimation(false,new Runnable(){
        @Override public void run(){
          mEmptyShadeView.setVisibility(GONE);
          mEmptyShadeView.setWillBeGone(false);
          updateContentHeight();
          notifyHeightChangeListener(mDismissView);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
public void updateEmptyShadeView(boolean visible){
  int oldVisibility=mEmptyShadeView.willBeGone() ? GONE : mEmptyShadeView.getVisibility();
  int newVisibility=visible ? VISIBLE : GONE;
  if (oldVisibility != newVisibility) {
    if (newVisibility != GONE) {
      if (mEmptyShadeView.willBeGone()) {
        mEmptyShadeView.cancelAnimation();
      }
 else {
        mEmptyShadeView.setInvisible();
      }
      mEmptyShadeView.setVisibility(newVisibility);
      mEmptyShadeView.setWillBeGone(false);
      updateContentHeight();
      notifyHeightChangeListener(mDismissView);
    }
 else {
      Runnable onFinishedRunnable=new Runnable(){
        @Override public void run(){
          mEmptyShadeView.setVisibility(GONE);
          mEmptyShadeView.setWillBeGone(false);
          updateContentHeight();
          notifyHeightChangeListener(mDismissView);
        }
      }
;
      if (mAnimationsEnabled) {
        mEmptyShadeView.setWillBeGone(true);
        mEmptyShadeView.performVisibilityAnimation(false,onFinishedRunnable);
      }
 else {
        mEmptyShadeView.setInvisible();
        onFinishedRunnable.run();
      }
    }
  }
}
Program: 195757
Project: 195757
Buggy source:
public void setDark(boolean dark,boolean fade,long delay){
  super.setDark(dark,fade,delay);
  if (mDark == dark) {
    return;
  }
  mDark=dark;
  if (!dark && fade) {
    if (mActivated) {
      mBackgroundDimmed.setVisibility(View.VISIBLE);
      mBackgroundNormal.setVisibility(View.VISIBLE);
    }
 else {
      mBackgroundDimmed.setVisibility(View.VISIBLE);
      mBackgroundNormal.setVisibility(View.INVISIBLE);
    }
    fadeDarkToDimmed(delay);
  }
 else {
    updateBackground();
  }
}

Fixed version (ground truth):
public void setDark(boolean dark,boolean fade,long delay){
  super.setDark(dark,fade,delay);
  if (mDark == dark) {
    return;
  }
  mDark=dark;
  if (!dark && fade) {
    if (mActivated) {
      mBackgroundDimmed.setVisibility(View.VISIBLE);
      mBackgroundNormal.setVisibility(View.VISIBLE);
    }
 else     if (mDimmed) {
      mBackgroundDimmed.setVisibility(View.VISIBLE);
      mBackgroundNormal.setVisibility(View.INVISIBLE);
    }
 else {
      mBackgroundDimmed.setVisibility(View.INVISIBLE);
      mBackgroundNormal.setVisibility(View.VISIBLE);
    }
    fadeInFromDark(delay);
  }
 else {
    updateBackground();
  }
}
Program: 195759
Project: 195759
Buggy source:
public void setHttpProxy(String host,String port,String exclList,Uri pacFileUrl){
  Proxy.setHttpProxySystemProperty(host,port,exclList,pacFileUrl);
}

Fixed version (ground truth):
public void setHttpProxy(String host,String port,String exclList,Uri pacFileUrl){
  final Network network=ConnectivityManager.getProcessDefaultNetwork();
  if (network != null) {
    Proxy.setHttpProxySystemProperty(ConnectivityManager.from(getSystemContext()).getDefaultProxy());
  }
 else {
    Proxy.setHttpProxySystemProperty(host,port,exclList,pacFileUrl);
  }
}
Program: 195760
Project: 195760
Buggy source:
/** 
 * Binds the current process to   {@code network}.  All Sockets created in the future (and not explicitly bound via a bound SocketFactory from  {@link Network#getSocketFactory() Network.getSocketFactory()}) will be bound to  {@code network}.  All host name resolutions will be limited to   {@code network} as well.Note that if  {@code network} ever disconnects, all Sockets created in this way will cease towork and all host name resolutions will fail.  This is by design so an application doesn't accidentally use Sockets it thinks are still bound to a particular  {@link Network}. To clear binding pass   {@code null} for {@code network}.  Using individually bound Sockets created by Network.getSocketFactory().createSocket() and performing network-specific host name resolutions via  {@link Network#getAllByName Network.getAllByName} is preferred to calling{@code setProcessDefaultNetwork}.
 * @param network The {@link Network} to bind the current process to, or {@code null} to clearthe current binding.
 * @return {@code true} on success, {@code false} if the {@link Network} is no longer valid.
 */
public static boolean setProcessDefaultNetwork(Network network){
  int netId=(network == null) ? NETID_UNSET : network.netId;
  if (netId == NetworkUtils.getNetworkBoundToProcess()) {
    return true;
  }
  if (NetworkUtils.bindProcessToNetwork(netId)) {
    InetAddress.clearDnsCache();
    NetworkEventDispatcher.getInstance().onNetworkConfigurationChanged();
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Binds the current process to   {@code network}.  All Sockets created in the future (and not explicitly bound via a bound SocketFactory from  {@link Network#getSocketFactory() Network.getSocketFactory()}) will be bound to  {@code network}.  All host name resolutions will be limited to   {@code network} as well.Note that if  {@code network} ever disconnects, all Sockets created in this way will cease towork and all host name resolutions will fail.  This is by design so an application doesn't accidentally use Sockets it thinks are still bound to a particular  {@link Network}. To clear binding pass   {@code null} for {@code network}.  Using individually bound Sockets created by Network.getSocketFactory().createSocket() and performing network-specific host name resolutions via  {@link Network#getAllByName Network.getAllByName} is preferred to calling{@code setProcessDefaultNetwork}.
 * @param network The {@link Network} to bind the current process to, or {@code null} to clearthe current binding.
 * @return {@code true} on success, {@code false} if the {@link Network} is no longer valid.
 */
public static boolean setProcessDefaultNetwork(Network network){
  int netId=(network == null) ? NETID_UNSET : network.netId;
  if (netId == NetworkUtils.getNetworkBoundToProcess()) {
    return true;
  }
  if (NetworkUtils.bindProcessToNetwork(netId)) {
    Proxy.setHttpProxySystemProperty(getInstance().getDefaultProxy());
    InetAddress.clearDnsCache();
    NetworkEventDispatcher.getInstance().onNetworkConfigurationChanged();
    return true;
  }
 else {
    return false;
  }
}
Program: 195761
Project: 195761
Buggy source:
/** 
 * {@hide}
 */
public ConnectivityManager(IConnectivityManager service){
  mService=checkNotNull(service,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@hide}
 */
public ConnectivityManager(IConnectivityManager service){
  mService=checkNotNull(service,"String_Node_Str");
  sInstance=this;
}
Program: 195762
Project: 195762
Buggy source:
public void updateDismissView(boolean visible){
  int oldVisibility=mDismissView.willBeGone() ? GONE : mDismissView.getVisibility();
  int newVisibility=visible ? VISIBLE : GONE;
  if (oldVisibility != newVisibility) {
    if (newVisibility != GONE) {
      if (mDismissView.willBeGone()) {
        mDismissView.cancelAnimation();
      }
 else {
        mDismissView.setInvisible();
      }
      mDismissView.setVisibility(newVisibility);
      mDismissView.setWillBeGone(false);
      updateContentHeight();
      notifyHeightChangeListener(mDismissView);
    }
 else {
      Runnable dimissHideFinishRunnable=new Runnable(){
        @Override public void run(){
          mDismissView.setVisibility(GONE);
          mDismissView.setWillBeGone(false);
          updateContentHeight();
          notifyHeightChangeListener(mDismissView);
        }
      }
;
      if (mDismissView.isButtonVisible() && mIsExpanded) {
        mDismissView.setWillBeGone(true);
        mDismissView.performVisibilityAnimation(false,dimissHideFinishRunnable);
      }
 else {
        dimissHideFinishRunnable.run();
        mDismissView.showClearButton();
      }
    }
  }
}

Fixed version (ground truth):
public void updateDismissView(boolean visible){
  int oldVisibility=mDismissView.willBeGone() ? GONE : mDismissView.getVisibility();
  int newVisibility=visible ? VISIBLE : GONE;
  if (oldVisibility != newVisibility) {
    if (newVisibility != GONE) {
      if (mDismissView.willBeGone()) {
        mDismissView.cancelAnimation();
      }
 else {
        mDismissView.setInvisible();
      }
      mDismissView.setVisibility(newVisibility);
      mDismissView.setWillBeGone(false);
      updateContentHeight();
      notifyHeightChangeListener(mDismissView);
    }
 else {
      Runnable dimissHideFinishRunnable=new Runnable(){
        @Override public void run(){
          mDismissView.setVisibility(GONE);
          mDismissView.setWillBeGone(false);
          updateContentHeight();
          notifyHeightChangeListener(mDismissView);
        }
      }
;
      if (mDismissView.isButtonVisible() && mIsExpanded && mAnimationsEnabled) {
        mDismissView.setWillBeGone(true);
        mDismissView.performVisibilityAnimation(false,dimissHideFinishRunnable);
      }
 else {
        dimissHideFinishRunnable.run();
        mDismissView.showClearButton();
      }
    }
  }
}
Program: 195763
Project: 195763
Buggy source:
public void updateEmptyShadeView(boolean visible){
  int oldVisibility=mEmptyShadeView.willBeGone() ? GONE : mEmptyShadeView.getVisibility();
  int newVisibility=visible ? VISIBLE : GONE;
  if (oldVisibility != newVisibility) {
    if (newVisibility != GONE) {
      if (mEmptyShadeView.willBeGone()) {
        mEmptyShadeView.cancelAnimation();
      }
 else {
        mEmptyShadeView.setInvisible();
      }
      mEmptyShadeView.setVisibility(newVisibility);
      mEmptyShadeView.setWillBeGone(false);
      updateContentHeight();
      notifyHeightChangeListener(mDismissView);
    }
 else {
      mEmptyShadeView.setWillBeGone(true);
      mEmptyShadeView.performVisibilityAnimation(false,new Runnable(){
        @Override public void run(){
          mEmptyShadeView.setVisibility(GONE);
          mEmptyShadeView.setWillBeGone(false);
          updateContentHeight();
          notifyHeightChangeListener(mDismissView);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
public void updateEmptyShadeView(boolean visible){
  int oldVisibility=mEmptyShadeView.willBeGone() ? GONE : mEmptyShadeView.getVisibility();
  int newVisibility=visible ? VISIBLE : GONE;
  if (oldVisibility != newVisibility) {
    if (newVisibility != GONE) {
      if (mEmptyShadeView.willBeGone()) {
        mEmptyShadeView.cancelAnimation();
      }
 else {
        mEmptyShadeView.setInvisible();
      }
      mEmptyShadeView.setVisibility(newVisibility);
      mEmptyShadeView.setWillBeGone(false);
      updateContentHeight();
      notifyHeightChangeListener(mDismissView);
    }
 else {
      Runnable onFinishedRunnable=new Runnable(){
        @Override public void run(){
          mEmptyShadeView.setVisibility(GONE);
          mEmptyShadeView.setWillBeGone(false);
          updateContentHeight();
          notifyHeightChangeListener(mDismissView);
        }
      }
;
      if (mAnimationsEnabled) {
        mEmptyShadeView.setWillBeGone(true);
        mEmptyShadeView.performVisibilityAnimation(false,onFinishedRunnable);
      }
 else {
        mEmptyShadeView.setInvisible();
        onFinishedRunnable.run();
      }
    }
  }
}
Program: 195764
Project: 195764
Buggy source:
@Override public void createAnimation(final LockPatternView.CellState animatedCell,long delay,long duration,float translationY,final boolean appearing,Interpolator interpolator,final Runnable finishListener){
  if (appearing) {
    animatedCell.scale=0.0f;
  }
  animatedCell.translateY=appearing ? translationY : 0;
  ValueAnimator animator=ValueAnimator.ofFloat(animatedCell.translateY,appearing ? 0 : translationY);
  animator.setInterpolator(interpolator);
  animator.setDuration(duration);
  animator.setStartDelay(delay);
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      float animatedFraction=animation.getAnimatedFraction();
      if (appearing) {
        animatedCell.scale=animatedFraction;
      }
 else {
        animatedCell.alpha=1 - animatedFraction;
      }
      animatedCell.translateY=(float)animation.getAnimatedValue();
      mLockPatternView.invalidate();
    }
  }
);
  if (finishListener != null) {
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        finishListener.run();
      }
    }
);
    mAppearAnimationUtils.createAnimation(mEcaView,delay,duration,translationY,appearing,interpolator,null);
  }
  animator.start();
  mLockPatternView.invalidate();
}

Fixed version (ground truth):
@Override public void createAnimation(final LockPatternView.CellState animatedCell,long delay,long duration,float translationY,final boolean appearing,Interpolator interpolator,final Runnable finishListener){
  if (appearing) {
    animatedCell.scale=0.0f;
    animatedCell.alpha=1.0f;
  }
  animatedCell.translateY=appearing ? translationY : 0;
  ValueAnimator animator=ValueAnimator.ofFloat(animatedCell.translateY,appearing ? 0 : translationY);
  animator.setInterpolator(interpolator);
  animator.setDuration(duration);
  animator.setStartDelay(delay);
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      float animatedFraction=animation.getAnimatedFraction();
      if (appearing) {
        animatedCell.scale=animatedFraction;
      }
 else {
        animatedCell.alpha=1 - animatedFraction;
      }
      animatedCell.translateY=(float)animation.getAnimatedValue();
      mLockPatternView.invalidate();
    }
  }
);
  if (finishListener != null) {
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        finishListener.run();
      }
    }
);
    mAppearAnimationUtils.createAnimation(mEcaView,delay,duration,translationY,appearing,interpolator,null);
  }
  animator.start();
  mLockPatternView.invalidate();
}