nus-yam/ex-repair huggingface dataset:
Program: 182534
Project: 182534
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: 182535
Project: 182535
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: 182536
Project: 182536
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: 182537
Project: 182537
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: 182538
Project: 182538
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: 182539
Project: 182539
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: 182540
Project: 182540
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: 182541
Project: 182541
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: 182542
Project: 182542
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: 182543
Project: 182543
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: 182544
Project: 182544
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: 182545
Project: 182545
Buggy source:
public void onPress(int primaryCode){
}

Fixed version (ground truth):
public void onPress(int primaryCode){
  if (mVibratePattern != null) {
    mVibrator.vibrate(mVibratePattern,-1);
  }
}
Program: 182546
Project: 182546
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: 182547
Project: 182547
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: 182548
Project: 182548
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: 182549
Project: 182549
Buggy source:
public void onPress(int primaryCode){
}

Fixed version (ground truth):
public void onPress(int primaryCode){
  if (mVibratePattern != null) {
    mVibrator.vibrate(mVibratePattern,-1);
  }
}
Program: 182550
Project: 182550
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: 182551
Project: 182551
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: 182552
Project: 182552
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: 182553
Project: 182553
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: 182554
Project: 182554
Buggy source:
@Override protected void onAllReferencesReleasedFromContainer(){
  releaseCompiledSqlIfInCache();
  mDatabase.releaseReference();
}

Fixed version (ground truth):
@Override protected void onAllReferencesReleasedFromContainer(){
  releaseCompiledSqlIfNotInCache();
  mDatabase.releaseReference();
}
Program: 182555
Project: 182555
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: 182557
Project: 182557
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: 182558
Project: 182558
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: 182559
Project: 182559
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: 182560
Project: 182560
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: 182561
Project: 182561
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: 182562
Project: 182562
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: 182563
Project: 182563
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: 182564
Project: 182564
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: 182565
Project: 182565
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: 182566
Project: 182566
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: 182567
Project: 182567
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: 182568
Project: 182568
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: 182569
Project: 182569
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: 182570
Project: 182570
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: 182571
Project: 182571
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: 182572
Project: 182572
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();
  }
}