nus-yam/ex-repair huggingface dataset:
Program: 42484
Project: 42484
Buggy source:
/** 
 * Gets a value and converts it to a Long.
 * @param key the value to get
 * @return the Long value, or null if the value is missing or cannot be converted
 */
public Long getAsLong(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).longValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Long.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Long.
 * @param key the value to get
 * @return the Long value, or null if the value is missing or cannot be converted
 */
public Long getAsLong(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).longValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Long.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 42485
Project: 42485
Buggy source:
/** 
 * Returns true if this object has the named value.
 * @param key the value to check for
 * @return {@code true} if the value is present, {@code false} otherwise 
 */
public boolean containsKey(String key){
  return mValues.containsKey(key);
}

Fixed version (ground truth):
/** 
 * Returns true if this object has the named value.
 * @param key the value to check for
 * @return {@code true} if the value is present, {@code false} otherwise
 */
public boolean containsKey(String key){
  return mValues.containsKey(key);
}
Program: 42486
Project: 42486
Buggy source:
/** 
 * Gets a value and converts it to a Double.
 * @param key the value to get
 * @return the Double value, or null if the value is missing or cannot be converted
 */
public Double getAsDouble(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).doubleValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Double.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Double.
 * @param key the value to get
 * @return the Double value, or null if the value is missing or cannot be converted
 */
public Double getAsDouble(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).doubleValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Double.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 42487
Project: 42487
Buggy source:
/** 
 * Gets a value and converts it to a Boolean.
 * @param key the value to get
 * @return the Boolean value, or null if the value is missing or cannot be converted
 */
public Boolean getAsBoolean(String key){
  Object value=mValues.get(key);
  try {
    return (Boolean)value;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      return Boolean.valueOf(value.toString());
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Boolean.
 * @param key the value to get
 * @return the Boolean value, or null if the value is missing or cannot be converted
 */
public Boolean getAsBoolean(String key){
  Object value=mValues.get(key);
  try {
    return (Boolean)value;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      return Boolean.valueOf(value.toString());
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 42488
Project: 42488
Buggy source:
/** 
 * Gets a value and converts it to a Short.
 * @param key the value to get
 * @return the Short value, or null if the value is missing or cannot be converted
 */
public Short getAsShort(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).shortValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Short.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Short.
 * @param key the value to get
 * @return the Short value, or null if the value is missing or cannot be converted
 */
public Short getAsShort(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).shortValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Short.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 42489
Project: 42489
Buggy source:
public void onPress(int primaryCode){
}

Fixed version (ground truth):
public void onPress(int primaryCode){
  if (mVibratePattern != null) {
    mVibrator.vibrate(mVibratePattern,-1);
  }
}
Program: 42490
Project: 42490
Buggy source:
public PasswordEntryKeyboardHelper(Context context,KeyboardView keyboardView,View targetView){
  mContext=context;
  mTargetView=targetView;
  mKeyboardView=keyboardView;
  createKeyboards();
  mKeyboardView.setOnKeyboardActionListener(this);
}

Fixed version (ground truth):
public PasswordEntryKeyboardHelper(Context context,KeyboardView keyboardView,View targetView){
  mContext=context;
  mTargetView=targetView;
  mKeyboardView=keyboardView;
  createKeyboards();
  mKeyboardView.setOnKeyboardActionListener(this);
  mVibrator=new Vibrator();
}
Program: 42491
Project: 42491
Buggy source:
public PasswordUnlockScreen(Context context,LockPatternUtils lockPatternUtils,KeyguardUpdateMonitor updateMonitor,KeyguardScreenCallback callback){
  super(context);
  mUpdateMonitor=updateMonitor;
  mCallback=callback;
  mCreatedWithKeyboardOpen=mUpdateMonitor.isKeyboardOpen();
  LayoutInflater layoutInflater=LayoutInflater.from(context);
  if (mUpdateMonitor.isInPortrait()) {
    layoutInflater.inflate(R.layout.keyguard_screen_password_portrait,this,true);
  }
 else {
    layoutInflater.inflate(R.layout.keyguard_screen_password_landscape,this,true);
  }
  boolean isAlpha=lockPatternUtils.getPasswordMode() == LockPatternUtils.MODE_PASSWORD;
  mKeyboardView=(PasswordEntryKeyboardView)findViewById(R.id.keyboard);
  mPasswordEntry=(EditText)findViewById(R.id.passwordEntry);
  mPasswordEntry.setOnEditorActionListener(this);
  mEmergencyCallButton=(TextView)findViewById(R.id.emergencyCall);
  mEmergencyCallButton.setOnClickListener(this);
  mUpdateMonitor.registerConfigurationChangeCallback(this);
  mLockPatternUtils=lockPatternUtils;
  mKeyboardHelper=new PasswordEntryKeyboardHelper(context,mKeyboardView,this);
  mKeyboardHelper.setKeyboardMode(isAlpha ? PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA : PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);
  mKeyboardView.setVisibility(mCreatedWithKeyboardOpen ? View.INVISIBLE : View.VISIBLE);
  mPasswordEntry.requestFocus();
}

Fixed version (ground truth):
public PasswordUnlockScreen(Context context,LockPatternUtils lockPatternUtils,KeyguardUpdateMonitor updateMonitor,KeyguardScreenCallback callback){
  super(context);
  mUpdateMonitor=updateMonitor;
  mCallback=callback;
  mCreatedWithKeyboardOpen=mUpdateMonitor.isKeyboardOpen();
  LayoutInflater layoutInflater=LayoutInflater.from(context);
  if (mUpdateMonitor.isInPortrait()) {
    layoutInflater.inflate(R.layout.keyguard_screen_password_portrait,this,true);
  }
 else {
    layoutInflater.inflate(R.layout.keyguard_screen_password_landscape,this,true);
  }
  boolean isAlpha=lockPatternUtils.getPasswordMode() == LockPatternUtils.MODE_PASSWORD;
  mKeyboardView=(PasswordEntryKeyboardView)findViewById(R.id.keyboard);
  mPasswordEntry=(EditText)findViewById(R.id.passwordEntry);
  mPasswordEntry.setOnEditorActionListener(this);
  mEmergencyCallButton=(TextView)findViewById(R.id.emergencyCall);
  mEmergencyCallButton.setOnClickListener(this);
  mUpdateMonitor.registerConfigurationChangeCallback(this);
  mLockPatternUtils=lockPatternUtils;
  mKeyboardHelper=new PasswordEntryKeyboardHelper(context,mKeyboardView,this);
  mKeyboardHelper.setKeyboardMode(isAlpha ? PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA : PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);
  mKeyboardView.setVisibility(mCreatedWithKeyboardOpen ? View.INVISIBLE : View.VISIBLE);
  mPasswordEntry.requestFocus();
  mKeyboardHelper.setVibratePattern(mLockPatternUtils.isTactileFeedbackEnabled() ? com.android.internal.R.array.config_virtualKeyVibePattern : 0);
}
Program: 42492
Project: 42492
Buggy source:
/** 
 * Gets a value and converts it to a Float.
 * @param key the value to get
 * @return the Float value, or null if the value is missing or cannot be converted
 */
public Float getAsFloat(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).floatValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Float.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Float.
 * @param key the value to get
 * @return the Float value, or null if the value is missing or cannot be converted
 */
public Float getAsFloat(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).floatValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Float.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 42493
Project: 42493
Buggy source:
/** 
 * Gets a value and converts it to a Byte.
 * @param key the value to get
 * @return the Byte value, or null if the value is missing or cannot be converted
 */
public Byte getAsByte(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).byteValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Byte.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Byte.
 * @param key the value to get
 * @return the Byte value, or null if the value is missing or cannot be converted
 */
public Byte getAsByte(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).byteValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Byte.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 42494
Project: 42494
Buggy source:
/** 
 * Gets a value and converts it to an Integer.
 * @param key the value to get
 * @return the Integer value, or null if the value is missing or cannot be converted
 */
public Integer getAsInteger(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).intValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Integer.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to an Integer.
 * @param key the value to get
 * @return the Integer value, or null if the value is missing or cannot be converted
 */
public Integer getAsInteger(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).intValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Integer.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 42495
Project: 42495
Buggy source:
/** 
 * Gets a value and converts it to a Long.
 * @param key the value to get
 * @return the Long value, or null if the value is missing or cannot be converted
 */
public Long getAsLong(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).longValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Long.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Long.
 * @param key the value to get
 * @return the Long value, or null if the value is missing or cannot be converted
 */
public Long getAsLong(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).longValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Long.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 42496
Project: 42496
Buggy source:
/** 
 * Returns true if this object has the named value.
 * @param key the value to check for
 * @return {@code true} if the value is present, {@code false} otherwise 
 */
public boolean containsKey(String key){
  return mValues.containsKey(key);
}

Fixed version (ground truth):
/** 
 * Returns true if this object has the named value.
 * @param key the value to check for
 * @return {@code true} if the value is present, {@code false} otherwise
 */
public boolean containsKey(String key){
  return mValues.containsKey(key);
}
Program: 42497
Project: 42497
Buggy source:
/** 
 * Gets a value and converts it to a Double.
 * @param key the value to get
 * @return the Double value, or null if the value is missing or cannot be converted
 */
public Double getAsDouble(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).doubleValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Double.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Double.
 * @param key the value to get
 * @return the Double value, or null if the value is missing or cannot be converted
 */
public Double getAsDouble(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).doubleValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Double.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 42498
Project: 42498
Buggy source:
/** 
 * Gets a value and converts it to a Boolean.
 * @param key the value to get
 * @return the Boolean value, or null if the value is missing or cannot be converted
 */
public Boolean getAsBoolean(String key){
  Object value=mValues.get(key);
  try {
    return (Boolean)value;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      return Boolean.valueOf(value.toString());
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Boolean.
 * @param key the value to get
 * @return the Boolean value, or null if the value is missing or cannot be converted
 */
public Boolean getAsBoolean(String key){
  Object value=mValues.get(key);
  try {
    return (Boolean)value;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      return Boolean.valueOf(value.toString());
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 42499
Project: 42499
Buggy source:
/** 
 * Gets a value and converts it to a Short.
 * @param key the value to get
 * @return the Short value, or null if the value is missing or cannot be converted
 */
public Short getAsShort(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).shortValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Short.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Short.
 * @param key the value to get
 * @return the Short value, or null if the value is missing or cannot be converted
 */
public Short getAsShort(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).shortValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Short.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 42500
Project: 42500
Buggy source:
public void onPress(int primaryCode){
}

Fixed version (ground truth):
public void onPress(int primaryCode){
  if (mVibratePattern != null) {
    mVibrator.vibrate(mVibratePattern,-1);
  }
}
Program: 42501
Project: 42501
Buggy source:
public PasswordEntryKeyboardHelper(Context context,KeyboardView keyboardView,View targetView){
  mContext=context;
  mTargetView=targetView;
  mKeyboardView=keyboardView;
  createKeyboards();
  mKeyboardView.setOnKeyboardActionListener(this);
}

Fixed version (ground truth):
public PasswordEntryKeyboardHelper(Context context,KeyboardView keyboardView,View targetView){
  mContext=context;
  mTargetView=targetView;
  mKeyboardView=keyboardView;
  createKeyboards();
  mKeyboardView.setOnKeyboardActionListener(this);
  mVibrator=new Vibrator();
}
Program: 42502
Project: 42502
Buggy source:
/** 
 * Updates the state of   {@link android.view.accessibility.AccessibilityManager} clients.
 */
private void updateClientsLocked(){
  for (int i=0, count=mClients.size(); i < count; i++) {
    try {
      mClients.get(i).setEnabled(mIsEnabled);
    }
 catch (    RemoteException re) {
      mClients.remove(i);
      count--;
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the state of   {@link android.view.accessibility.AccessibilityManager} clients.
 */
private void updateClientsLocked(){
  for (int i=0, count=mClients.size(); i < count; i++) {
    try {
      mClients.get(i).setEnabled(mIsEnabled);
    }
 catch (    RemoteException re) {
      mClients.remove(i);
      count--;
      i--;
    }
  }
}
Program: 42503
Project: 42503
Buggy source:
public PasswordUnlockScreen(Context context,LockPatternUtils lockPatternUtils,KeyguardUpdateMonitor updateMonitor,KeyguardScreenCallback callback){
  super(context);
  mUpdateMonitor=updateMonitor;
  mCallback=callback;
  mCreatedWithKeyboardOpen=mUpdateMonitor.isKeyboardOpen();
  LayoutInflater layoutInflater=LayoutInflater.from(context);
  if (mUpdateMonitor.isInPortrait()) {
    layoutInflater.inflate(R.layout.keyguard_screen_password_portrait,this,true);
  }
 else {
    layoutInflater.inflate(R.layout.keyguard_screen_password_landscape,this,true);
  }
  boolean isAlpha=lockPatternUtils.getPasswordMode() == LockPatternUtils.MODE_PASSWORD;
  mKeyboardView=(PasswordEntryKeyboardView)findViewById(R.id.keyboard);
  mPasswordEntry=(EditText)findViewById(R.id.passwordEntry);
  mPasswordEntry.setOnEditorActionListener(this);
  mEmergencyCallButton=(TextView)findViewById(R.id.emergencyCall);
  mEmergencyCallButton.setOnClickListener(this);
  mUpdateMonitor.registerConfigurationChangeCallback(this);
  mLockPatternUtils=lockPatternUtils;
  mKeyboardHelper=new PasswordEntryKeyboardHelper(context,mKeyboardView,this);
  mKeyboardHelper.setKeyboardMode(isAlpha ? PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA : PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);
  mKeyboardView.setVisibility(mCreatedWithKeyboardOpen ? View.INVISIBLE : View.VISIBLE);
  mPasswordEntry.requestFocus();
}

Fixed version (ground truth):
public PasswordUnlockScreen(Context context,LockPatternUtils lockPatternUtils,KeyguardUpdateMonitor updateMonitor,KeyguardScreenCallback callback){
  super(context);
  mUpdateMonitor=updateMonitor;
  mCallback=callback;
  mCreatedWithKeyboardOpen=mUpdateMonitor.isKeyboardOpen();
  LayoutInflater layoutInflater=LayoutInflater.from(context);
  if (mUpdateMonitor.isInPortrait()) {
    layoutInflater.inflate(R.layout.keyguard_screen_password_portrait,this,true);
  }
 else {
    layoutInflater.inflate(R.layout.keyguard_screen_password_landscape,this,true);
  }
  boolean isAlpha=lockPatternUtils.getPasswordMode() == LockPatternUtils.MODE_PASSWORD;
  mKeyboardView=(PasswordEntryKeyboardView)findViewById(R.id.keyboard);
  mPasswordEntry=(EditText)findViewById(R.id.passwordEntry);
  mPasswordEntry.setOnEditorActionListener(this);
  mEmergencyCallButton=(TextView)findViewById(R.id.emergencyCall);
  mEmergencyCallButton.setOnClickListener(this);
  mUpdateMonitor.registerConfigurationChangeCallback(this);
  mLockPatternUtils=lockPatternUtils;
  mKeyboardHelper=new PasswordEntryKeyboardHelper(context,mKeyboardView,this);
  mKeyboardHelper.setKeyboardMode(isAlpha ? PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA : PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);
  mKeyboardView.setVisibility(mCreatedWithKeyboardOpen ? View.INVISIBLE : View.VISIBLE);
  mPasswordEntry.requestFocus();
  mKeyboardHelper.setVibratePattern(mLockPatternUtils.isTactileFeedbackEnabled() ? com.android.internal.R.array.config_virtualKeyVibePattern : 0);
}
Program: 42504
Project: 42504
Buggy source:
SQLiteProgram(SQLiteDatabase db,String sql){
  mDatabase=db;
  mSql=sql;
  db.acquireReference();
  db.addSQLiteClosable(this);
  this.nHandle=db.mNativeHandle;
  mCompiledSql=db.getCompiledStatementForSql(sql);
  if (mCompiledSql == null) {
    mCompiledSql=new SQLiteCompiledSql(db,sql);
    db.addToCompiledQueries(sql,mCompiledSql);
  }
  nStatement=mCompiledSql.nStatement;
}

Fixed version (ground truth):
SQLiteProgram(SQLiteDatabase db,String sql){
  mDatabase=db;
  mSql=sql;
  db.acquireReference();
  db.addSQLiteClosable(this);
  this.nHandle=db.mNativeHandle;
  mCompiledSql=db.getCompiledStatementForSql(sql);
  if (mCompiledSql == null) {
    mCompiledSql=new SQLiteCompiledSql(db,sql);
    db.addToCompiledQueries(sql,mCompiledSql);
    mCompiledSql.acquire();
  }
 else {
    if (mCompiledSql.isInUse()) {
      mCompiledSql=new SQLiteCompiledSql(db,sql);
    }
 else {
      mCompiledSql.acquire();
    }
  }
  nStatement=mCompiledSql.nStatement;
}
Program: 42505
Project: 42505
Buggy source:
@Override protected void onAllReferencesReleasedFromContainer(){
  releaseCompiledSqlIfInCache();
  mDatabase.releaseReference();
}

Fixed version (ground truth):
@Override protected void onAllReferencesReleasedFromContainer(){
  releaseCompiledSqlIfNotInCache();
  mDatabase.releaseReference();
}
Program: 42506
Project: 42506
Buggy source:
@Override protected void onAllReferencesReleased(){
  releaseCompiledSqlIfInCache();
  mDatabase.releaseReference();
  mDatabase.removeSQLiteClosable(this);
}

Fixed version (ground truth):
@Override protected void onAllReferencesReleased(){
  releaseCompiledSqlIfNotInCache();
  mDatabase.releaseReference();
  mDatabase.removeSQLiteClosable(this);
}
Program: 42508
Project: 42508
Buggy source:
/** 
 * Updates the state of   {@link android.view.accessibility.AccessibilityManager} clients.
 */
private void updateClientsLocked(){
  for (int i=0, count=mClients.size(); i < count; i++) {
    try {
      mClients.get(i).setEnabled(mIsEnabled);
    }
 catch (    RemoteException re) {
      mClients.remove(i);
      count--;
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the state of   {@link android.view.accessibility.AccessibilityManager} clients.
 */
private void updateClientsLocked(){
  for (int i=0, count=mClients.size(); i < count; i++) {
    try {
      mClients.get(i).setEnabled(mIsEnabled);
    }
 catch (    RemoteException re) {
      mClients.remove(i);
      count--;
      i--;
    }
  }
}
Program: 42509
Project: 42509
Buggy source:
/** 
 * Removes a dead service.
 * @param service The service.
 * @return True if the service was removed, false otherwise.
 */
private boolean removeDeadServiceLocked(Service service){
  mServices.remove(service);
  mHandler.removeMessages(service.mId);
  if (LOGV) {
    Log.i(LOG_TAG,"String_Node_Str" + service.mService + "String_Node_Str");
  }
  if (mServices.isEmpty()) {
    mIsEnabled=false;
    updateClientsLocked();
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Removes a dead service.
 * @param service The service.
 * @return True if the service was removed, false otherwise.
 */
private boolean removeDeadServiceLocked(Service service){
  mServices.remove(service);
  mHandler.removeMessages(service.mId);
  if (Config.DEBUG) {
    Log.i(LOG_TAG,"String_Node_Str" + service.mService + "String_Node_Str");
  }
  if (mServices.isEmpty()) {
    mIsEnabled=false;
    updateClientsLocked();
  }
  return true;
}
Program: 42510
Project: 42510
Buggy source:
/** 
 * Creates a new instance.
 * @param context A {@link Context} instance.
 */
AccessibilityManagerService(Context context){
  mContext=context;
  mPackageManager=mContext.getPackageManager();
  mCaller=new HandlerCaller(context,this);
  registerPackageChangeAndBootCompletedBroadcastReceiver();
  registerSettingsContentObservers();
synchronized (mLock) {
    populateAccessibilityServiceListLocked();
  }
}

Fixed version (ground truth):
/** 
 * Creates a new instance.
 * @param context A {@link Context} instance.
 */
AccessibilityManagerService(Context context){
  mContext=context;
  mPackageManager=mContext.getPackageManager();
  mCaller=new HandlerCaller(context,this);
  registerPackageChangeAndBootCompletedBroadcastReceiver();
  registerSettingsContentObservers();
}
Program: 42511
Project: 42511
Buggy source:
/** 
 * Registers a   {@link BroadcastReceiver} for the events ofadding/changing/removing/restarting a package and boot completion.
 */
private void registerPackageChangeAndBootCompletedBroadcastReceiver(){
  Context context=mContext;
  BroadcastReceiver broadcastReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
synchronized (mLock) {
        populateAccessibilityServiceListLocked();
        manageServicesLocked();
        if (intent.getAction() == Intent.ACTION_BOOT_COMPLETED) {
          mIsEnabled=Settings.Secure.getInt(mContext.getContentResolver(),Settings.Secure.ACCESSIBILITY_ENABLED,0) == 1;
          updateClientsLocked();
        }
      }
    }
  }
;
  IntentFilter packageFilter=new IntentFilter();
  packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
  packageFilter.addAction(Intent.ACTION_PACKAGE_CHANGED);
  packageFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
  packageFilter.addAction(Intent.ACTION_PACKAGE_RESTARTED);
  packageFilter.addDataScheme("String_Node_Str");
  context.registerReceiver(broadcastReceiver,packageFilter);
  IntentFilter sdFilter=new IntentFilter();
  sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE);
  sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE);
  mContext.registerReceiver(broadcastReceiver,sdFilter);
  IntentFilter bootFiler=new IntentFilter(Intent.ACTION_BOOT_COMPLETED);
  mContext.registerReceiver(broadcastReceiver,bootFiler);
}

Fixed version (ground truth):
/** 
 * Registers a   {@link BroadcastReceiver} for the events ofadding/changing/removing/restarting a package and boot completion.
 */
private void registerPackageChangeAndBootCompletedBroadcastReceiver(){
  Context context=mContext;
  BroadcastReceiver broadcastReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
synchronized (mLock) {
        populateAccessibilityServiceListLocked();
        if (intent.getAction() == Intent.ACTION_BOOT_COMPLETED) {
          mIsEnabled=Settings.Secure.getInt(mContext.getContentResolver(),Settings.Secure.ACCESSIBILITY_ENABLED,0) == 1;
          if (mIsEnabled) {
            updateClientsLocked();
          }
        }
        manageServicesLocked();
      }
    }
  }
;
  IntentFilter packageFilter=new IntentFilter();
  packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
  packageFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
  packageFilter.addAction(Intent.ACTION_PACKAGE_RESTARTED);
  packageFilter.addDataScheme("String_Node_Str");
  context.registerReceiver(broadcastReceiver,packageFilter);
  IntentFilter sdFilter=new IntentFilter();
  sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE);
  sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE);
  mContext.registerReceiver(broadcastReceiver,sdFilter);
  IntentFilter bootFiler=new IntentFilter(Intent.ACTION_BOOT_COMPLETED);
  mContext.registerReceiver(broadcastReceiver,bootFiler);
}
Program: 42512
Project: 42512
Buggy source:
@Override public void onReceive(Context context,Intent intent){
synchronized (mLock) {
    populateAccessibilityServiceListLocked();
    manageServicesLocked();
    if (intent.getAction() == Intent.ACTION_BOOT_COMPLETED) {
      mIsEnabled=Settings.Secure.getInt(mContext.getContentResolver(),Settings.Secure.ACCESSIBILITY_ENABLED,0) == 1;
      updateClientsLocked();
    }
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
synchronized (mLock) {
    populateAccessibilityServiceListLocked();
    if (intent.getAction() == Intent.ACTION_BOOT_COMPLETED) {
      mIsEnabled=Settings.Secure.getInt(mContext.getContentResolver(),Settings.Secure.ACCESSIBILITY_ENABLED,0) == 1;
      if (mIsEnabled) {
        updateClientsLocked();
      }
    }
    manageServicesLocked();
  }
}
Program: 42513
Project: 42513
Buggy source:
/** 
 * Updates the state of each service by starting (or keeping running) enabled ones and stopping the rest.
 * @param installedServices All installed {@link AccessibilityService}s.
 * @param enabledServices The {@link ComponentName}s of the enabled services.
 */
private void updateServicesStateLocked(List<ServiceInfo> installedServices,Set<ComponentName> enabledServices){
  Map<ComponentName,Service> componentNameToServiceMap=mComponentNameToServiceMap;
  List<Service> services=mServices;
  for (int i=0, count=installedServices.size(); i < count; i++) {
    ServiceInfo intalledService=installedServices.get(i);
    ComponentName componentName=new ComponentName(intalledService.packageName,intalledService.name);
    Service service=componentNameToServiceMap.get(componentName);
    if (enabledServices.contains(componentName)) {
      if (service == null) {
        new Service(componentName).bind();
      }
    }
 else {
      if (service != null) {
        service.unbind();
        componentNameToServiceMap.remove(componentName);
        services.remove(service);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the state of each service by starting (or keeping running) enabled ones and stopping the rest.
 * @param installedServices All installed {@link AccessibilityService}s.
 * @param enabledServices The {@link ComponentName}s of the enabled services.
 */
private void updateServicesStateLocked(List<ServiceInfo> installedServices,Set<ComponentName> enabledServices){
  Map<ComponentName,Service> componentNameToServiceMap=mComponentNameToServiceMap;
  List<Service> services=mServices;
  boolean isEnabled=mIsEnabled;
  for (int i=0, count=installedServices.size(); i < count; i++) {
    ServiceInfo intalledService=installedServices.get(i);
    ComponentName componentName=new ComponentName(intalledService.packageName,intalledService.name);
    Service service=componentNameToServiceMap.get(componentName);
    if (isEnabled && enabledServices.contains(componentName)) {
      if (service == null) {
        new Service(componentName).bind();
      }
    }
 else {
      if (service != null) {
        service.unbind();
        componentNameToServiceMap.remove(componentName);
        services.remove(service);
      }
    }
  }
}
Program: 42514
Project: 42514
Buggy source:
/** 
 * Notifies a service for a scheduled event given the event type.
 * @param service The service.
 * @param eventType The type of the event to dispatch.
 */
private void notifyEventListenerLocked(Service service,int eventType){
  IEventListener listener=service.mServiceInterface;
  AccessibilityEvent event=service.mPendingEvents.get(eventType);
  try {
    listener.onAccessibilityEvent(event);
    if (LOGV) {
      Log.i(LOG_TAG,"String_Node_Str" + event + "String_Node_Str"+ listener);
    }
  }
 catch (  RemoteException re) {
    if (re instanceof DeadObjectException) {
      Log.w(LOG_TAG,"String_Node_Str" + service.mService + "String_Node_Str");
synchronized (mLock) {
        removeDeadServiceLocked(service);
      }
    }
 else {
      Log.e(LOG_TAG,"String_Node_Str" + event + "String_Node_Str"+ service.mService,re);
    }
  }
}

Fixed version (ground truth):
/** 
 * Notifies a service for a scheduled event given the event type.
 * @param service The service.
 * @param eventType The type of the event to dispatch.
 */
private void notifyEventListenerLocked(Service service,int eventType){
  IEventListener listener=service.mServiceInterface;
  AccessibilityEvent event=service.mPendingEvents.get(eventType);
  try {
    listener.onAccessibilityEvent(event);
    if (Config.DEBUG) {
      Log.i(LOG_TAG,"String_Node_Str" + event + "String_Node_Str"+ listener);
    }
  }
 catch (  RemoteException re) {
    if (re instanceof DeadObjectException) {
      Log.w(LOG_TAG,"String_Node_Str" + service.mService + "String_Node_Str");
synchronized (mLock) {
        removeDeadServiceLocked(service);
      }
    }
 else {
      Log.e(LOG_TAG,"String_Node_Str" + event + "String_Node_Str"+ service.mService,re);
    }
  }
}
Program: 42515
Project: 42515
Buggy source:
private void init(String rruleStr,String rdateStr,String exruleStr,String exdateStr){
  if (!TextUtils.isEmpty(rruleStr) || !TextUtils.isEmpty(rdateStr)) {
    if (!TextUtils.isEmpty(rruleStr)) {
      String[] rruleStrs=rruleStr.split(RULE_SEPARATOR);
      rrules=new EventRecurrence[rruleStrs.length];
      for (int i=0; i < rruleStrs.length; ++i) {
        EventRecurrence rrule=new EventRecurrence();
        rrule.parse(rruleStrs[i]);
        rrules[i]=rrule;
      }
    }
    if (!TextUtils.isEmpty(rdateStr)) {
      rdates=parseRecurrenceDates(rdateStr);
    }
    if (!TextUtils.isEmpty(exruleStr)) {
      String[] exruleStrs=exruleStr.split(RULE_SEPARATOR);
      exrules=new EventRecurrence[exruleStrs.length];
      for (int i=0; i < exruleStrs.length; ++i) {
        EventRecurrence exrule=new EventRecurrence();
        exrule.parse(exruleStr);
        exrules[i]=exrule;
      }
    }
    if (!TextUtils.isEmpty(exdateStr)) {
      exdates=parseRecurrenceDates(exdateStr);
    }
  }
}

Fixed version (ground truth):
private void init(String rruleStr,String rdateStr,String exruleStr,String exdateStr) throws EventRecurrence.InvalidFormatException {
  if (!TextUtils.isEmpty(rruleStr) || !TextUtils.isEmpty(rdateStr)) {
    if (!TextUtils.isEmpty(rruleStr)) {
      String[] rruleStrs=rruleStr.split(RULE_SEPARATOR);
      rrules=new EventRecurrence[rruleStrs.length];
      for (int i=0; i < rruleStrs.length; ++i) {
        EventRecurrence rrule=new EventRecurrence();
        rrule.parse(rruleStrs[i]);
        rrules[i]=rrule;
      }
    }
    if (!TextUtils.isEmpty(rdateStr)) {
      rdates=parseRecurrenceDates(rdateStr);
    }
    if (!TextUtils.isEmpty(exruleStr)) {
      String[] exruleStrs=exruleStr.split(RULE_SEPARATOR);
      exrules=new EventRecurrence[exruleStrs.length];
      for (int i=0; i < exruleStrs.length; ++i) {
        EventRecurrence exrule=new EventRecurrence();
        exrule.parse(exruleStr);
        exrules[i]=exrule;
      }
    }
    if (!TextUtils.isEmpty(exdateStr)) {
      exdates=parseRecurrenceDates(exdateStr);
    }
  }
}
Program: 42516
Project: 42516
Buggy source:
public RecurrenceSet(String rruleStr,String rdateStr,String exruleStr,String exdateStr){
  init(rruleStr,rdateStr,exruleStr,exdateStr);
}

Fixed version (ground truth):
public RecurrenceSet(String rruleStr,String rdateStr,String exruleStr,String exdateStr) throws EventRecurrence.InvalidFormatException {
  init(rruleStr,rdateStr,exruleStr,exdateStr);
}
Program: 42517
Project: 42517
Buggy source:
public void writeToParcel(Parcel parcel,int flags){
  parcel.writeInt(eventTypes);
  parcel.writeStringArray(packageNames);
  parcel.writeInt(feedbackType);
  parcel.writeLong(notificationTimeout);
  parcel.writeInt(flags);
}

Fixed version (ground truth):
public void writeToParcel(Parcel parcel,int flagz){
  parcel.writeInt(eventTypes);
  parcel.writeStringArray(packageNames);
  parcel.writeInt(feedbackType);
  parcel.writeLong(notificationTimeout);
  parcel.writeInt(flags);
}
Program: 42518
Project: 42518
Buggy source:
private void init(String rruleStr,String rdateStr,String exruleStr,String exdateStr){
  if (!TextUtils.isEmpty(rruleStr) || !TextUtils.isEmpty(rdateStr)) {
    if (!TextUtils.isEmpty(rruleStr)) {
      String[] rruleStrs=rruleStr.split(RULE_SEPARATOR);
      rrules=new EventRecurrence[rruleStrs.length];
      for (int i=0; i < rruleStrs.length; ++i) {
        EventRecurrence rrule=new EventRecurrence();
        rrule.parse(rruleStrs[i]);
        rrules[i]=rrule;
      }
    }
    if (!TextUtils.isEmpty(rdateStr)) {
      rdates=parseRecurrenceDates(rdateStr);
    }
    if (!TextUtils.isEmpty(exruleStr)) {
      String[] exruleStrs=exruleStr.split(RULE_SEPARATOR);
      exrules=new EventRecurrence[exruleStrs.length];
      for (int i=0; i < exruleStrs.length; ++i) {
        EventRecurrence exrule=new EventRecurrence();
        exrule.parse(exruleStr);
        exrules[i]=exrule;
      }
    }
    if (!TextUtils.isEmpty(exdateStr)) {
      exdates=parseRecurrenceDates(exdateStr);
    }
  }
}

Fixed version (ground truth):
private void init(String rruleStr,String rdateStr,String exruleStr,String exdateStr) throws EventRecurrence.InvalidFormatException {
  if (!TextUtils.isEmpty(rruleStr) || !TextUtils.isEmpty(rdateStr)) {
    if (!TextUtils.isEmpty(rruleStr)) {
      String[] rruleStrs=rruleStr.split(RULE_SEPARATOR);
      rrules=new EventRecurrence[rruleStrs.length];
      for (int i=0; i < rruleStrs.length; ++i) {
        EventRecurrence rrule=new EventRecurrence();
        rrule.parse(rruleStrs[i]);
        rrules[i]=rrule;
      }
    }
    if (!TextUtils.isEmpty(rdateStr)) {
      rdates=parseRecurrenceDates(rdateStr);
    }
    if (!TextUtils.isEmpty(exruleStr)) {
      String[] exruleStrs=exruleStr.split(RULE_SEPARATOR);
      exrules=new EventRecurrence[exruleStrs.length];
      for (int i=0; i < exruleStrs.length; ++i) {
        EventRecurrence exrule=new EventRecurrence();
        exrule.parse(exruleStr);
        exrules[i]=exrule;
      }
    }
    if (!TextUtils.isEmpty(exdateStr)) {
      exdates=parseRecurrenceDates(exdateStr);
    }
  }
}
Program: 42519
Project: 42519
Buggy source:
public RecurrenceSet(String rruleStr,String rdateStr,String exruleStr,String exdateStr){
  init(rruleStr,rdateStr,exruleStr,exdateStr);
}

Fixed version (ground truth):
public RecurrenceSet(String rruleStr,String rdateStr,String exruleStr,String exdateStr) throws EventRecurrence.InvalidFormatException {
  init(rruleStr,rdateStr,exruleStr,exdateStr);
}
Program: 42520
Project: 42520
Buggy source:
/** 
 * Removes a dead service.
 * @param service The service.
 * @return True if the service was removed, false otherwise.
 */
private boolean removeDeadServiceLocked(Service service){
  mServices.remove(service);
  mHandler.removeMessages(service.mId);
  if (LOGV) {
    Log.i(LOG_TAG,"String_Node_Str" + service.mService + "String_Node_Str");
  }
  if (mServices.isEmpty()) {
    mIsEnabled=false;
    updateClientsLocked();
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Removes a dead service.
 * @param service The service.
 * @return True if the service was removed, false otherwise.
 */
private boolean removeDeadServiceLocked(Service service){
  mServices.remove(service);
  mHandler.removeMessages(service.mId);
  if (Config.DEBUG) {
    Log.i(LOG_TAG,"String_Node_Str" + service.mService + "String_Node_Str");
  }
  if (mServices.isEmpty()) {
    mIsEnabled=false;
    updateClientsLocked();
  }
  return true;
}
Program: 42521
Project: 42521
Buggy source:
/** 
 * Creates a new instance.
 * @param context A {@link Context} instance.
 */
AccessibilityManagerService(Context context){
  mContext=context;
  mPackageManager=mContext.getPackageManager();
  mCaller=new HandlerCaller(context,this);
  registerPackageChangeAndBootCompletedBroadcastReceiver();
  registerSettingsContentObservers();
synchronized (mLock) {
    populateAccessibilityServiceListLocked();
  }
}

Fixed version (ground truth):
/** 
 * Creates a new instance.
 * @param context A {@link Context} instance.
 */
AccessibilityManagerService(Context context){
  mContext=context;
  mPackageManager=mContext.getPackageManager();
  mCaller=new HandlerCaller(context,this);
  registerPackageChangeAndBootCompletedBroadcastReceiver();
  registerSettingsContentObservers();
}
Program: 42522
Project: 42522
Buggy source:
/** 
 * Registers a   {@link BroadcastReceiver} for the events ofadding/changing/removing/restarting a package and boot completion.
 */
private void registerPackageChangeAndBootCompletedBroadcastReceiver(){
  Context context=mContext;
  BroadcastReceiver broadcastReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
synchronized (mLock) {
        populateAccessibilityServiceListLocked();
        manageServicesLocked();
        if (intent.getAction() == Intent.ACTION_BOOT_COMPLETED) {
          mIsEnabled=Settings.Secure.getInt(mContext.getContentResolver(),Settings.Secure.ACCESSIBILITY_ENABLED,0) == 1;
          updateClientsLocked();
        }
      }
    }
  }
;
  IntentFilter packageFilter=new IntentFilter();
  packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
  packageFilter.addAction(Intent.ACTION_PACKAGE_CHANGED);
  packageFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
  packageFilter.addAction(Intent.ACTION_PACKAGE_RESTARTED);
  packageFilter.addDataScheme("String_Node_Str");
  context.registerReceiver(broadcastReceiver,packageFilter);
  IntentFilter sdFilter=new IntentFilter();
  sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE);
  sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE);
  mContext.registerReceiver(broadcastReceiver,sdFilter);
  IntentFilter bootFiler=new IntentFilter(Intent.ACTION_BOOT_COMPLETED);
  mContext.registerReceiver(broadcastReceiver,bootFiler);
}

Fixed version (ground truth):
/** 
 * Registers a   {@link BroadcastReceiver} for the events ofadding/changing/removing/restarting a package and boot completion.
 */
private void registerPackageChangeAndBootCompletedBroadcastReceiver(){
  Context context=mContext;
  BroadcastReceiver broadcastReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
synchronized (mLock) {
        populateAccessibilityServiceListLocked();
        if (intent.getAction() == Intent.ACTION_BOOT_COMPLETED) {
          mIsEnabled=Settings.Secure.getInt(mContext.getContentResolver(),Settings.Secure.ACCESSIBILITY_ENABLED,0) == 1;
          if (mIsEnabled) {
            updateClientsLocked();
          }
        }
        manageServicesLocked();
      }
    }
  }
;
  IntentFilter packageFilter=new IntentFilter();
  packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
  packageFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
  packageFilter.addAction(Intent.ACTION_PACKAGE_RESTARTED);
  packageFilter.addDataScheme("String_Node_Str");
  context.registerReceiver(broadcastReceiver,packageFilter);
  IntentFilter sdFilter=new IntentFilter();
  sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE);
  sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE);
  mContext.registerReceiver(broadcastReceiver,sdFilter);
  IntentFilter bootFiler=new IntentFilter(Intent.ACTION_BOOT_COMPLETED);
  mContext.registerReceiver(broadcastReceiver,bootFiler);
}
Program: 42523
Project: 42523
Buggy source:
@Override public void onReceive(Context context,Intent intent){
synchronized (mLock) {
    populateAccessibilityServiceListLocked();
    manageServicesLocked();
    if (intent.getAction() == Intent.ACTION_BOOT_COMPLETED) {
      mIsEnabled=Settings.Secure.getInt(mContext.getContentResolver(),Settings.Secure.ACCESSIBILITY_ENABLED,0) == 1;
      updateClientsLocked();
    }
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
synchronized (mLock) {
    populateAccessibilityServiceListLocked();
    if (intent.getAction() == Intent.ACTION_BOOT_COMPLETED) {
      mIsEnabled=Settings.Secure.getInt(mContext.getContentResolver(),Settings.Secure.ACCESSIBILITY_ENABLED,0) == 1;
      if (mIsEnabled) {
        updateClientsLocked();
      }
    }
    manageServicesLocked();
  }
}