nus-yam/ex-repair huggingface dataset:
Program: 194911
Project: 194911
Buggy source:
/** 
 * Computes the device's orientation based on the rotation matrix. <p> When it returns, the array values is filled with the result: <ul> <li>values[0]: <i>azimuth</i>, rotation around the Z axis.</li> <li>values[1]: <i>pitch</i>, rotation around the X axis.</li> <li>values[2]: <i>roll</i>, rotation around the Y axis.</li> </ul> <p>The reference coordinate-system used is different from the world coordinate-system defined for the rotation matrix:</p> <ul> <li>X is defined as the vector product <b>Y.Z</b> (It is tangential to the ground at the device's current location and roughly points West).</li> <li>Y is tangential to the ground at the device's current location and points towards the magnetic North Pole.</li> <li>Z points towards the center of the Earth and is perpendicular to the ground.</li> </ul> <p> <center><img src="../../../images/axis_globe_inverted.png" alt="Inverted world coordinate-system diagram." border="0" /></center> </p> <p> All three angles above are in <b>radians</b> and <b>positive</b> in the <b>counter-clockwise</b> direction.
 * @param R rotation matrix see  {@link #getRotationMatrix}.
 * @param values an array of 3 floats to hold the result.
 * @return The array values passed as argument.
 * @see #getRotationMatrix(float[],float[],float[],float[])
 * @see GeomagneticField
 */
public static float[] getOrientation(float[] R,float values[]){
  if (R.length == 9) {
    values[0]=(float)Math.atan2(R[1],R[4]);
    values[1]=(float)Math.asin(-R[7]);
    values[2]=(float)Math.atan2(-R[6],R[8]);
  }
 else {
    values[0]=(float)Math.atan2(R[1],R[5]);
    values[1]=(float)Math.asin(-R[9]);
    values[2]=(float)Math.atan2(-R[8],R[10]);
  }
  return values;
}

Fixed version (ground truth):
/** 
 * Computes the device's orientation based on the rotation matrix. <p> When it returns, the array values is filled with the result: <ul> <li>values[0]: <i>azimuth</i>, rotation around the -Z axis, i.e. the opposite direction of Z axis.</li> <li>values[1]: <i>pitch</i>, rotation around the -X axis, i.e the opposite direction of X axis.</li> <li>values[2]: <i>roll</i>, rotation around the Y axis.</li> </ul> <p> Applying these three intrinsic rotations in azimuth, pitch and roll order transforms identity matrix to the rotation matrix given in input R. All three angles above are in <b>radians</b> and <b>positive</b> in the <b>counter-clockwise</b> direction. Range of output is: azimuth from -&pi; to &pi;, pitch from -&pi;/2 to &pi;/2 and roll from -&pi; to &pi;.
 * @param R rotation matrix see  {@link #getRotationMatrix}.
 * @param values an array of 3 floats to hold the result.
 * @return The array values passed as argument.
 * @see #getRotationMatrix(float[],float[],float[],float[])
 * @see GeomagneticField
 */
public static float[] getOrientation(float[] R,float values[]){
  if (R.length == 9) {
    values[0]=(float)Math.atan2(R[1],R[4]);
    values[1]=(float)Math.asin(-R[7]);
    values[2]=(float)Math.atan2(-R[6],R[8]);
  }
 else {
    values[0]=(float)Math.atan2(R[1],R[5]);
    values[1]=(float)Math.asin(-R[9]);
    values[2]=(float)Math.atan2(-R[8],R[10]);
  }
  return values;
}
Program: 194915
Project: 194915
Buggy source:
/** 
 * Computes the device's orientation based on the rotation matrix. <p> When it returns, the array values is filled with the result: <ul> <li>values[0]: <i>azimuth</i>, rotation around the Z axis.</li> <li>values[1]: <i>pitch</i>, rotation around the X axis.</li> <li>values[2]: <i>roll</i>, rotation around the Y axis.</li> </ul> <p>The reference coordinate-system used is different from the world coordinate-system defined for the rotation matrix:</p> <ul> <li>X is defined as the vector product <b>Y.Z</b> (It is tangential to the ground at the device's current location and roughly points West).</li> <li>Y is tangential to the ground at the device's current location and points towards the magnetic North Pole.</li> <li>Z points towards the center of the Earth and is perpendicular to the ground.</li> </ul> <p> <center><img src="../../../images/axis_globe_inverted.png" alt="Inverted world coordinate-system diagram." border="0" /></center> </p> <p> All three angles above are in <b>radians</b> and <b>positive</b> in the <b>counter-clockwise</b> direction.
 * @param R rotation matrix see  {@link #getRotationMatrix}.
 * @param values an array of 3 floats to hold the result.
 * @return The array values passed as argument.
 * @see #getRotationMatrix(float[],float[],float[],float[])
 * @see GeomagneticField
 */
public static float[] getOrientation(float[] R,float values[]){
  if (R.length == 9) {
    values[0]=(float)Math.atan2(R[1],R[4]);
    values[1]=(float)Math.asin(-R[7]);
    values[2]=(float)Math.atan2(-R[6],R[8]);
  }
 else {
    values[0]=(float)Math.atan2(R[1],R[5]);
    values[1]=(float)Math.asin(-R[9]);
    values[2]=(float)Math.atan2(-R[8],R[10]);
  }
  return values;
}

Fixed version (ground truth):
/** 
 * Computes the device's orientation based on the rotation matrix. <p> When it returns, the array values is filled with the result: <ul> <li>values[0]: <i>azimuth</i>, rotation around the -Z axis, i.e. the opposite direction of Z axis.</li> <li>values[1]: <i>pitch</i>, rotation around the -X axis, i.e the opposite direction of X axis.</li> <li>values[2]: <i>roll</i>, rotation around the Y axis.</li> </ul> <p> Applying these three intrinsic rotations in azimuth, pitch and roll order transforms identity matrix to the rotation matrix given in input R. All three angles above are in <b>radians</b> and <b>positive</b> in the <b>counter-clockwise</b> direction. Range of output is: azimuth from -&pi; to &pi;, pitch from -&pi;/2 to &pi;/2 and roll from -&pi; to &pi;.
 * @param R rotation matrix see  {@link #getRotationMatrix}.
 * @param values an array of 3 floats to hold the result.
 * @return The array values passed as argument.
 * @see #getRotationMatrix(float[],float[],float[],float[])
 * @see GeomagneticField
 */
public static float[] getOrientation(float[] R,float values[]){
  if (R.length == 9) {
    values[0]=(float)Math.atan2(R[1],R[4]);
    values[1]=(float)Math.asin(-R[7]);
    values[2]=(float)Math.atan2(-R[6],R[8]);
  }
 else {
    values[0]=(float)Math.atan2(R[1],R[5]);
    values[1]=(float)Math.asin(-R[9]);
    values[2]=(float)Math.atan2(-R[8],R[10]);
  }
  return values;
}
Program: 194919
Project: 194919
Buggy source:
/** 
 * Computes the device's orientation based on the rotation matrix. <p> When it returns, the array values is filled with the result: <ul> <li>values[0]: <i>azimuth</i>, rotation around the Z axis.</li> <li>values[1]: <i>pitch</i>, rotation around the X axis.</li> <li>values[2]: <i>roll</i>, rotation around the Y axis.</li> </ul> <p>The reference coordinate-system used is different from the world coordinate-system defined for the rotation matrix:</p> <ul> <li>X is defined as the vector product <b>Y.Z</b> (It is tangential to the ground at the device's current location and roughly points West).</li> <li>Y is tangential to the ground at the device's current location and points towards the magnetic North Pole.</li> <li>Z points towards the center of the Earth and is perpendicular to the ground.</li> </ul> <p> <center><img src="../../../images/axis_globe_inverted.png" alt="Inverted world coordinate-system diagram." border="0" /></center> </p> <p> All three angles above are in <b>radians</b> and <b>positive</b> in the <b>counter-clockwise</b> direction.
 * @param R rotation matrix see  {@link #getRotationMatrix}.
 * @param values an array of 3 floats to hold the result.
 * @return The array values passed as argument.
 * @see #getRotationMatrix(float[],float[],float[],float[])
 * @see GeomagneticField
 */
public static float[] getOrientation(float[] R,float values[]){
  if (R.length == 9) {
    values[0]=(float)Math.atan2(R[1],R[4]);
    values[1]=(float)Math.asin(-R[7]);
    values[2]=(float)Math.atan2(-R[6],R[8]);
  }
 else {
    values[0]=(float)Math.atan2(R[1],R[5]);
    values[1]=(float)Math.asin(-R[9]);
    values[2]=(float)Math.atan2(-R[8],R[10]);
  }
  return values;
}

Fixed version (ground truth):
/** 
 * Computes the device's orientation based on the rotation matrix. <p> When it returns, the array values is filled with the result: <ul> <li>values[0]: <i>azimuth</i>, rotation around the -Z axis, i.e. the opposite direction of Z axis.</li> <li>values[1]: <i>pitch</i>, rotation around the -X axis, i.e the opposite direction of X axis.</li> <li>values[2]: <i>roll</i>, rotation around the Y axis.</li> </ul> <p> Applying these three intrinsic rotations in azimuth, pitch and roll order transforms identity matrix to the rotation matrix given in input R. All three angles above are in <b>radians</b> and <b>positive</b> in the <b>counter-clockwise</b> direction. Range of output is: azimuth from -&pi; to &pi;, pitch from -&pi;/2 to &pi;/2 and roll from -&pi; to &pi;.
 * @param R rotation matrix see  {@link #getRotationMatrix}.
 * @param values an array of 3 floats to hold the result.
 * @return The array values passed as argument.
 * @see #getRotationMatrix(float[],float[],float[],float[])
 * @see GeomagneticField
 */
public static float[] getOrientation(float[] R,float values[]){
  if (R.length == 9) {
    values[0]=(float)Math.atan2(R[1],R[4]);
    values[1]=(float)Math.asin(-R[7]);
    values[2]=(float)Math.atan2(-R[6],R[8]);
  }
 else {
    values[0]=(float)Math.atan2(R[1],R[5]);
    values[1]=(float)Math.asin(-R[9]);
    values[2]=(float)Math.atan2(-R[8],R[10]);
  }
  return values;
}
Program: 194923
Project: 194923
Buggy source:
/** 
 * Computes the device's orientation based on the rotation matrix. <p> When it returns, the array values is filled with the result: <ul> <li>values[0]: <i>azimuth</i>, rotation around the Z axis.</li> <li>values[1]: <i>pitch</i>, rotation around the X axis.</li> <li>values[2]: <i>roll</i>, rotation around the Y axis.</li> </ul> <p>The reference coordinate-system used is different from the world coordinate-system defined for the rotation matrix:</p> <ul> <li>X is defined as the vector product <b>Y.Z</b> (It is tangential to the ground at the device's current location and roughly points West).</li> <li>Y is tangential to the ground at the device's current location and points towards the magnetic North Pole.</li> <li>Z points towards the center of the Earth and is perpendicular to the ground.</li> </ul> <p> <center><img src="../../../images/axis_globe_inverted.png" alt="Inverted world coordinate-system diagram." border="0" /></center> </p> <p> All three angles above are in <b>radians</b> and <b>positive</b> in the <b>counter-clockwise</b> direction.
 * @param R rotation matrix see  {@link #getRotationMatrix}.
 * @param values an array of 3 floats to hold the result.
 * @return The array values passed as argument.
 * @see #getRotationMatrix(float[],float[],float[],float[])
 * @see GeomagneticField
 */
public static float[] getOrientation(float[] R,float values[]){
  if (R.length == 9) {
    values[0]=(float)Math.atan2(R[1],R[4]);
    values[1]=(float)Math.asin(-R[7]);
    values[2]=(float)Math.atan2(-R[6],R[8]);
  }
 else {
    values[0]=(float)Math.atan2(R[1],R[5]);
    values[1]=(float)Math.asin(-R[9]);
    values[2]=(float)Math.atan2(-R[8],R[10]);
  }
  return values;
}

Fixed version (ground truth):
/** 
 * Computes the device's orientation based on the rotation matrix. <p> When it returns, the array values is filled with the result: <ul> <li>values[0]: <i>azimuth</i>, rotation around the -Z axis, i.e. the opposite direction of Z axis.</li> <li>values[1]: <i>pitch</i>, rotation around the -X axis, i.e the opposite direction of X axis.</li> <li>values[2]: <i>roll</i>, rotation around the Y axis.</li> </ul> <p> Applying these three intrinsic rotations in azimuth, pitch and roll order transforms identity matrix to the rotation matrix given in input R. All three angles above are in <b>radians</b> and <b>positive</b> in the <b>counter-clockwise</b> direction. Range of output is: azimuth from -&pi; to &pi;, pitch from -&pi;/2 to &pi;/2 and roll from -&pi; to &pi;.
 * @param R rotation matrix see  {@link #getRotationMatrix}.
 * @param values an array of 3 floats to hold the result.
 * @return The array values passed as argument.
 * @see #getRotationMatrix(float[],float[],float[],float[])
 * @see GeomagneticField
 */
public static float[] getOrientation(float[] R,float values[]){
  if (R.length == 9) {
    values[0]=(float)Math.atan2(R[1],R[4]);
    values[1]=(float)Math.asin(-R[7]);
    values[2]=(float)Math.atan2(-R[6],R[8]);
  }
 else {
    values[0]=(float)Math.atan2(R[1],R[5]);
    values[1]=(float)Math.asin(-R[9]);
    values[2]=(float)Math.atan2(-R[8],R[10]);
  }
  return values;
}
Program: 194925
Project: 194925
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.when;
  long when2=a2.when;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}
Program: 194926
Project: 194926
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.when;
  long when2=a2.when;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}
Program: 194927
Project: 194927
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.when;
  long when2=a2.when;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}
Program: 194928
Project: 194928
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.when;
  long when2=a2.when;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}
Program: 194935
Project: 194935
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.when;
  long when2=a2.when;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}
Program: 194938
Project: 194938
Buggy source:
/** 
 * Return a set of account types speficied by the intent as well as supported by the AccountManager.
 */
private Set<String> getReleventAccountTypes(final Intent intent){
  Set<String> setOfRelevantAccountTypes=null;
  final String[] allowedAccountTypes=intent.getStringArrayExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY);
  if (allowedAccountTypes != null) {
    setOfRelevantAccountTypes=Sets.newHashSet(allowedAccountTypes);
    AuthenticatorDescription[] descs=AccountManager.get(this).getAuthenticatorTypes();
    Set<String> supportedAccountTypes=new HashSet<String>(descs.length);
    for (    AuthenticatorDescription desc : descs) {
      supportedAccountTypes.add(desc.type);
    }
    setOfRelevantAccountTypes.retainAll(supportedAccountTypes);
  }
  return setOfRelevantAccountTypes;
}

Fixed version (ground truth):
/** 
 * Return a set of account types specified by the intent as well as supported by the AccountManager.
 */
private Set<String> getReleventAccountTypes(final Intent intent){
  Set<String> setOfRelevantAccountTypes=null;
  final String[] allowedAccountTypes=intent.getStringArrayExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY);
  AuthenticatorDescription[] descs=AccountManager.get(this).getAuthenticatorTypes();
  Set<String> supportedAccountTypes=new HashSet<String>(descs.length);
  for (  AuthenticatorDescription desc : descs) {
    supportedAccountTypes.add(desc.type);
  }
  if (allowedAccountTypes != null) {
    setOfRelevantAccountTypes=Sets.newHashSet(allowedAccountTypes);
    setOfRelevantAccountTypes.retainAll(supportedAccountTypes);
  }
 else {
    setOfRelevantAccountTypes=supportedAccountTypes;
  }
  return setOfRelevantAccountTypes;
}
Program: 194941
Project: 194941
Buggy source:
/** 
 * Return a set of account types speficied by the intent as well as supported by the AccountManager.
 */
private Set<String> getReleventAccountTypes(final Intent intent){
  Set<String> setOfRelevantAccountTypes=null;
  final String[] allowedAccountTypes=intent.getStringArrayExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY);
  if (allowedAccountTypes != null) {
    setOfRelevantAccountTypes=Sets.newHashSet(allowedAccountTypes);
    AuthenticatorDescription[] descs=AccountManager.get(this).getAuthenticatorTypes();
    Set<String> supportedAccountTypes=new HashSet<String>(descs.length);
    for (    AuthenticatorDescription desc : descs) {
      supportedAccountTypes.add(desc.type);
    }
    setOfRelevantAccountTypes.retainAll(supportedAccountTypes);
  }
  return setOfRelevantAccountTypes;
}

Fixed version (ground truth):
/** 
 * Return a set of account types specified by the intent as well as supported by the AccountManager.
 */
private Set<String> getReleventAccountTypes(final Intent intent){
  Set<String> setOfRelevantAccountTypes=null;
  final String[] allowedAccountTypes=intent.getStringArrayExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY);
  AuthenticatorDescription[] descs=AccountManager.get(this).getAuthenticatorTypes();
  Set<String> supportedAccountTypes=new HashSet<String>(descs.length);
  for (  AuthenticatorDescription desc : descs) {
    supportedAccountTypes.add(desc.type);
  }
  if (allowedAccountTypes != null) {
    setOfRelevantAccountTypes=Sets.newHashSet(allowedAccountTypes);
    setOfRelevantAccountTypes.retainAll(supportedAccountTypes);
  }
 else {
    setOfRelevantAccountTypes=supportedAccountTypes;
  }
  return setOfRelevantAccountTypes;
}
Program: 194942
Project: 194942
Buggy source:
private void updateActiveGroup(int userId){
  IFingerprintDaemon daemon=getFingerprintDaemon();
  if (daemon != null) {
    try {
      final File systemDir=Environment.getUserSystemDirectory(userId);
      final File fpDir=new File(systemDir,FP_DATA_DIR);
      if (!fpDir.exists()) {
        if (!fpDir.mkdir()) {
          Slog.v(TAG,"String_Node_Str" + fpDir.getAbsolutePath());
          return;
        }
      }
      daemon.setActiveGroup(userId,fpDir.getAbsolutePath().getBytes());
    }
 catch (    RemoteException e) {
      Slog.e(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void updateActiveGroup(int userId){
  IFingerprintDaemon daemon=getFingerprintDaemon();
  if (daemon != null) {
    try {
      final File systemDir=Environment.getUserSystemDirectory(userId);
      final File fpDir=new File(systemDir,FP_DATA_DIR);
      if (!fpDir.exists()) {
        if (!fpDir.mkdir()) {
          Slog.v(TAG,"String_Node_Str" + fpDir.getAbsolutePath());
          return;
        }
        if (!SELinux.restorecon(fpDir)) {
          Slog.w(TAG,"String_Node_Str");
          return;
        }
      }
      daemon.setActiveGroup(userId,fpDir.getAbsolutePath().getBytes());
    }
 catch (    RemoteException e) {
      Slog.e(TAG,"String_Node_Str",e);
    }
  }
}
Program: 194943
Project: 194943
Buggy source:
public void destroy(){
  if (token != null) {
    token.unlinkToDeath(this,0);
    token=null;
  }
  receiver=null;
}

Fixed version (ground truth):
public void destroy(){
  if (token != null) {
    try {
      token.unlinkToDeath(this,0);
    }
 catch (    NoSuchElementException e) {
      Slog.e(TAG,"String_Node_Str" + this + "String_Node_Str",new Exception("String_Node_Str"));
    }
    token=null;
  }
  receiver=null;
}
Program: 194944
Project: 194944
Buggy source:
private void updateActiveGroup(int userId){
  IFingerprintDaemon daemon=getFingerprintDaemon();
  if (daemon != null) {
    try {
      final File systemDir=Environment.getUserSystemDirectory(userId);
      final File fpDir=new File(systemDir,FP_DATA_DIR);
      if (!fpDir.exists()) {
        if (!fpDir.mkdir()) {
          Slog.v(TAG,"String_Node_Str" + fpDir.getAbsolutePath());
          return;
        }
      }
      daemon.setActiveGroup(userId,fpDir.getAbsolutePath().getBytes());
    }
 catch (    RemoteException e) {
      Slog.e(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void updateActiveGroup(int userId){
  IFingerprintDaemon daemon=getFingerprintDaemon();
  if (daemon != null) {
    try {
      final File systemDir=Environment.getUserSystemDirectory(userId);
      final File fpDir=new File(systemDir,FP_DATA_DIR);
      if (!fpDir.exists()) {
        if (!fpDir.mkdir()) {
          Slog.v(TAG,"String_Node_Str" + fpDir.getAbsolutePath());
          return;
        }
        if (!SELinux.restorecon(fpDir)) {
          Slog.w(TAG,"String_Node_Str");
          return;
        }
      }
      daemon.setActiveGroup(userId,fpDir.getAbsolutePath().getBytes());
    }
 catch (    RemoteException e) {
      Slog.e(TAG,"String_Node_Str",e);
    }
  }
}
Program: 194945
Project: 194945
Buggy source:
public void destroy(){
  if (token != null) {
    token.unlinkToDeath(this,0);
    token=null;
  }
  receiver=null;
}

Fixed version (ground truth):
public void destroy(){
  if (token != null) {
    try {
      token.unlinkToDeath(this,0);
    }
 catch (    NoSuchElementException e) {
      Slog.e(TAG,"String_Node_Str" + this + "String_Node_Str",new Exception("String_Node_Str"));
    }
    token=null;
  }
  receiver=null;
}
Program: 194946
Project: 194946
Buggy source:
private void updateActiveGroup(int userId){
  IFingerprintDaemon daemon=getFingerprintDaemon();
  if (daemon != null) {
    try {
      final File systemDir=Environment.getUserSystemDirectory(userId);
      final File fpDir=new File(systemDir,FP_DATA_DIR);
      if (!fpDir.exists()) {
        if (!fpDir.mkdir()) {
          Slog.v(TAG,"String_Node_Str" + fpDir.getAbsolutePath());
          return;
        }
      }
      daemon.setActiveGroup(userId,fpDir.getAbsolutePath().getBytes());
    }
 catch (    RemoteException e) {
      Slog.e(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void updateActiveGroup(int userId){
  IFingerprintDaemon daemon=getFingerprintDaemon();
  if (daemon != null) {
    try {
      final File systemDir=Environment.getUserSystemDirectory(userId);
      final File fpDir=new File(systemDir,FP_DATA_DIR);
      if (!fpDir.exists()) {
        if (!fpDir.mkdir()) {
          Slog.v(TAG,"String_Node_Str" + fpDir.getAbsolutePath());
          return;
        }
        if (!SELinux.restorecon(fpDir)) {
          Slog.w(TAG,"String_Node_Str");
          return;
        }
      }
      daemon.setActiveGroup(userId,fpDir.getAbsolutePath().getBytes());
    }
 catch (    RemoteException e) {
      Slog.e(TAG,"String_Node_Str",e);
    }
  }
}
Program: 194947
Project: 194947
Buggy source:
public void destroy(){
  if (token != null) {
    token.unlinkToDeath(this,0);
    token=null;
  }
  receiver=null;
}

Fixed version (ground truth):
public void destroy(){
  if (token != null) {
    try {
      token.unlinkToDeath(this,0);
    }
 catch (    NoSuchElementException e) {
      Slog.e(TAG,"String_Node_Str" + this + "String_Node_Str",new Exception("String_Node_Str"));
    }
    token=null;
  }
  receiver=null;
}
Program: 194948
Project: 194948
Buggy source:
private void updateActiveGroup(int userId){
  IFingerprintDaemon daemon=getFingerprintDaemon();
  if (daemon != null) {
    try {
      final File systemDir=Environment.getUserSystemDirectory(userId);
      final File fpDir=new File(systemDir,FP_DATA_DIR);
      if (!fpDir.exists()) {
        if (!fpDir.mkdir()) {
          Slog.v(TAG,"String_Node_Str" + fpDir.getAbsolutePath());
          return;
        }
      }
      daemon.setActiveGroup(userId,fpDir.getAbsolutePath().getBytes());
    }
 catch (    RemoteException e) {
      Slog.e(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void updateActiveGroup(int userId){
  IFingerprintDaemon daemon=getFingerprintDaemon();
  if (daemon != null) {
    try {
      final File systemDir=Environment.getUserSystemDirectory(userId);
      final File fpDir=new File(systemDir,FP_DATA_DIR);
      if (!fpDir.exists()) {
        if (!fpDir.mkdir()) {
          Slog.v(TAG,"String_Node_Str" + fpDir.getAbsolutePath());
          return;
        }
        if (!SELinux.restorecon(fpDir)) {
          Slog.w(TAG,"String_Node_Str");
          return;
        }
      }
      daemon.setActiveGroup(userId,fpDir.getAbsolutePath().getBytes());
    }
 catch (    RemoteException e) {
      Slog.e(TAG,"String_Node_Str",e);
    }
  }
}
Program: 194949
Project: 194949
Buggy source:
public void destroy(){
  if (token != null) {
    token.unlinkToDeath(this,0);
    token=null;
  }
  receiver=null;
}

Fixed version (ground truth):
public void destroy(){
  if (token != null) {
    try {
      token.unlinkToDeath(this,0);
    }
 catch (    NoSuchElementException e) {
      Slog.e(TAG,"String_Node_Str" + this + "String_Node_Str",new Exception("String_Node_Str"));
    }
    token=null;
  }
  receiver=null;
}
Program: 194950
Project: 194950
Buggy source:
private void updateActiveGroup(int userId){
  IFingerprintDaemon daemon=getFingerprintDaemon();
  if (daemon != null) {
    try {
      final File systemDir=Environment.getUserSystemDirectory(userId);
      final File fpDir=new File(systemDir,FP_DATA_DIR);
      if (!fpDir.exists()) {
        if (!fpDir.mkdir()) {
          Slog.v(TAG,"String_Node_Str" + fpDir.getAbsolutePath());
          return;
        }
      }
      daemon.setActiveGroup(userId,fpDir.getAbsolutePath().getBytes());
    }
 catch (    RemoteException e) {
      Slog.e(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void updateActiveGroup(int userId){
  IFingerprintDaemon daemon=getFingerprintDaemon();
  if (daemon != null) {
    try {
      final File systemDir=Environment.getUserSystemDirectory(userId);
      final File fpDir=new File(systemDir,FP_DATA_DIR);
      if (!fpDir.exists()) {
        if (!fpDir.mkdir()) {
          Slog.v(TAG,"String_Node_Str" + fpDir.getAbsolutePath());
          return;
        }
        if (!SELinux.restorecon(fpDir)) {
          Slog.w(TAG,"String_Node_Str");
          return;
        }
      }
      daemon.setActiveGroup(userId,fpDir.getAbsolutePath().getBytes());
    }
 catch (    RemoteException e) {
      Slog.e(TAG,"String_Node_Str",e);
    }
  }
}
Program: 194951
Project: 194951
Buggy source:
public void destroy(){
  if (token != null) {
    token.unlinkToDeath(this,0);
    token=null;
  }
  receiver=null;
}

Fixed version (ground truth):
public void destroy(){
  if (token != null) {
    try {
      token.unlinkToDeath(this,0);
    }
 catch (    NoSuchElementException e) {
      Slog.e(TAG,"String_Node_Str" + this + "String_Node_Str",new Exception("String_Node_Str"));
    }
    token=null;
  }
  receiver=null;
}
Program: 194954
Project: 194954
Buggy source:
/** 
 * Computes the device's orientation based on the rotation matrix. <p> When it returns, the array values is filled with the result: <ul> <li>values[0]: <i>azimuth</i>, rotation around the Z axis.</li> <li>values[1]: <i>pitch</i>, rotation around the X axis.</li> <li>values[2]: <i>roll</i>, rotation around the Y axis.</li> </ul> <p>The reference coordinate-system used is different from the world coordinate-system defined for the rotation matrix:</p> <ul> <li>X is defined as the vector product <b>Y.Z</b> (It is tangential to the ground at the device's current location and roughly points West).</li> <li>Y is tangential to the ground at the device's current location and points towards the magnetic North Pole.</li> <li>Z points towards the center of the Earth and is perpendicular to the ground.</li> </ul> <p> <center><img src="../../../images/axis_globe_inverted.png" alt="Inverted world coordinate-system diagram." border="0" /></center> </p> <p> All three angles above are in <b>radians</b> and <b>positive</b> in the <b>counter-clockwise</b> direction.
 * @param R rotation matrix see  {@link #getRotationMatrix}.
 * @param values an array of 3 floats to hold the result.
 * @return The array values passed as argument.
 * @see #getRotationMatrix(float[],float[],float[],float[])
 * @see GeomagneticField
 */
public static float[] getOrientation(float[] R,float values[]){
  if (R.length == 9) {
    values[0]=(float)Math.atan2(R[1],R[4]);
    values[1]=(float)Math.asin(-R[7]);
    values[2]=(float)Math.atan2(-R[6],R[8]);
  }
 else {
    values[0]=(float)Math.atan2(R[1],R[5]);
    values[1]=(float)Math.asin(-R[9]);
    values[2]=(float)Math.atan2(-R[8],R[10]);
  }
  return values;
}

Fixed version (ground truth):
/** 
 * Computes the device's orientation based on the rotation matrix. <p> When it returns, the array values is filled with the result: <ul> <li>values[0]: <i>azimuth</i>, rotation around the -Z axis, i.e. the opposite direction of Z axis.</li> <li>values[1]: <i>pitch</i>, rotation around the -X axis, i.e the opposite direction of X axis.</li> <li>values[2]: <i>roll</i>, rotation around the Y axis.</li> </ul> <p> Applying these three intrinsic rotations in azimuth, pitch and roll order transforms identity matrix to the rotation matrix given in input R. All three angles above are in <b>radians</b> and <b>positive</b> in the <b>counter-clockwise</b> direction. Range of output is: azimuth from -&pi; to &pi;, pitch from -&pi;/2 to &pi;/2 and roll from -&pi; to &pi;.
 * @param R rotation matrix see  {@link #getRotationMatrix}.
 * @param values an array of 3 floats to hold the result.
 * @return The array values passed as argument.
 * @see #getRotationMatrix(float[],float[],float[],float[])
 * @see GeomagneticField
 */
public static float[] getOrientation(float[] R,float values[]){
  if (R.length == 9) {
    values[0]=(float)Math.atan2(R[1],R[4]);
    values[1]=(float)Math.asin(-R[7]);
    values[2]=(float)Math.atan2(-R[6],R[8]);
  }
 else {
    values[0]=(float)Math.atan2(R[1],R[5]);
    values[1]=(float)Math.asin(-R[9]);
    values[2]=(float)Math.atan2(-R[8],R[10]);
  }
  return values;
}
Program: 194966
Project: 194966
Buggy source:
private Account[] getAccountsAsUser(String type,int userId,String callingPackage,int packageUid){
  int callingUid=Binder.getCallingUid();
  if (userId != UserHandle.getCallingUserId() && callingUid != Process.myUid() && mContext.checkCallingOrSelfPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + UserHandle.getCallingUserId() + "String_Node_Str"+ userId);
  }
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + type + "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ Binder.getCallingPid());
  }
  if (packageUid != -1 && UserHandle.isSameApp(callingUid,Process.myUid())) {
    callingUid=packageUid;
  }
  checkReadAccountsPermission();
  UserAccounts accounts=getUserAccounts(userId);
  long identityToken=clearCallingIdentity();
  try {
synchronized (accounts.cacheLock) {
      return getAccountsFromCacheLocked(accounts,type,callingUid,callingPackage);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
private Account[] getAccountsAsUser(String type,int userId,String callingPackage,int packageUid){
  int callingUid=Binder.getCallingUid();
  if (userId != UserHandle.getCallingUserId() && callingUid != Process.myUid() && mContext.checkCallingOrSelfPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + UserHandle.getCallingUserId() + "String_Node_Str"+ userId);
  }
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + type + "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ Binder.getCallingPid());
  }
  if (packageUid != -1 && UserHandle.isSameApp(callingUid,Process.myUid())) {
    callingUid=packageUid;
  }
  checkReadAccountsPermission();
  long identityToken=clearCallingIdentity();
  try {
    UserAccounts accounts=getUserAccounts(userId);
synchronized (accounts.cacheLock) {
      return getAccountsFromCacheLocked(accounts,type,callingUid,callingPackage);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 194967
Project: 194967
Buggy source:
private Account[] getAccountsAsUser(String type,int userId,String callingPackage,int packageUid){
  int callingUid=Binder.getCallingUid();
  if (userId != UserHandle.getCallingUserId() && callingUid != Process.myUid() && mContext.checkCallingOrSelfPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + UserHandle.getCallingUserId() + "String_Node_Str"+ userId);
  }
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + type + "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ Binder.getCallingPid());
  }
  if (packageUid != -1 && UserHandle.isSameApp(callingUid,Process.myUid())) {
    callingUid=packageUid;
  }
  checkReadAccountsPermission();
  UserAccounts accounts=getUserAccounts(userId);
  long identityToken=clearCallingIdentity();
  try {
synchronized (accounts.cacheLock) {
      return getAccountsFromCacheLocked(accounts,type,callingUid,callingPackage);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
private Account[] getAccountsAsUser(String type,int userId,String callingPackage,int packageUid){
  int callingUid=Binder.getCallingUid();
  if (userId != UserHandle.getCallingUserId() && callingUid != Process.myUid() && mContext.checkCallingOrSelfPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + UserHandle.getCallingUserId() + "String_Node_Str"+ userId);
  }
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + type + "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ Binder.getCallingPid());
  }
  if (packageUid != -1 && UserHandle.isSameApp(callingUid,Process.myUid())) {
    callingUid=packageUid;
  }
  checkReadAccountsPermission();
  long identityToken=clearCallingIdentity();
  try {
    UserAccounts accounts=getUserAccounts(userId);
synchronized (accounts.cacheLock) {
      return getAccountsFromCacheLocked(accounts,type,callingUid,callingPackage);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 194968
Project: 194968
Buggy source:
private Account[] getAccountsAsUser(String type,int userId,String callingPackage,int packageUid){
  int callingUid=Binder.getCallingUid();
  if (userId != UserHandle.getCallingUserId() && callingUid != Process.myUid() && mContext.checkCallingOrSelfPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + UserHandle.getCallingUserId() + "String_Node_Str"+ userId);
  }
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + type + "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ Binder.getCallingPid());
  }
  if (packageUid != -1 && UserHandle.isSameApp(callingUid,Process.myUid())) {
    callingUid=packageUid;
  }
  checkReadAccountsPermission();
  UserAccounts accounts=getUserAccounts(userId);
  long identityToken=clearCallingIdentity();
  try {
synchronized (accounts.cacheLock) {
      return getAccountsFromCacheLocked(accounts,type,callingUid,callingPackage);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
private Account[] getAccountsAsUser(String type,int userId,String callingPackage,int packageUid){
  int callingUid=Binder.getCallingUid();
  if (userId != UserHandle.getCallingUserId() && callingUid != Process.myUid() && mContext.checkCallingOrSelfPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + UserHandle.getCallingUserId() + "String_Node_Str"+ userId);
  }
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + type + "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ Binder.getCallingPid());
  }
  if (packageUid != -1 && UserHandle.isSameApp(callingUid,Process.myUid())) {
    callingUid=packageUid;
  }
  checkReadAccountsPermission();
  long identityToken=clearCallingIdentity();
  try {
    UserAccounts accounts=getUserAccounts(userId);
synchronized (accounts.cacheLock) {
      return getAccountsFromCacheLocked(accounts,type,callingUid,callingPackage);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 194969
Project: 194969
Buggy source:
private Account[] getAccountsAsUser(String type,int userId,String callingPackage,int packageUid){
  int callingUid=Binder.getCallingUid();
  if (userId != UserHandle.getCallingUserId() && callingUid != Process.myUid() && mContext.checkCallingOrSelfPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + UserHandle.getCallingUserId() + "String_Node_Str"+ userId);
  }
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + type + "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ Binder.getCallingPid());
  }
  if (packageUid != -1 && UserHandle.isSameApp(callingUid,Process.myUid())) {
    callingUid=packageUid;
  }
  checkReadAccountsPermission();
  UserAccounts accounts=getUserAccounts(userId);
  long identityToken=clearCallingIdentity();
  try {
synchronized (accounts.cacheLock) {
      return getAccountsFromCacheLocked(accounts,type,callingUid,callingPackage);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
private Account[] getAccountsAsUser(String type,int userId,String callingPackage,int packageUid){
  int callingUid=Binder.getCallingUid();
  if (userId != UserHandle.getCallingUserId() && callingUid != Process.myUid() && mContext.checkCallingOrSelfPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + UserHandle.getCallingUserId() + "String_Node_Str"+ userId);
  }
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + type + "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ Binder.getCallingPid());
  }
  if (packageUid != -1 && UserHandle.isSameApp(callingUid,Process.myUid())) {
    callingUid=packageUid;
  }
  checkReadAccountsPermission();
  long identityToken=clearCallingIdentity();
  try {
    UserAccounts accounts=getUserAccounts(userId);
synchronized (accounts.cacheLock) {
      return getAccountsFromCacheLocked(accounts,type,callingUid,callingPackage);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 194970
Project: 194970
Buggy source:
private Account[] getAccountsAsUser(String type,int userId,String callingPackage,int packageUid){
  int callingUid=Binder.getCallingUid();
  if (userId != UserHandle.getCallingUserId() && callingUid != Process.myUid() && mContext.checkCallingOrSelfPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + UserHandle.getCallingUserId() + "String_Node_Str"+ userId);
  }
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + type + "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ Binder.getCallingPid());
  }
  if (packageUid != -1 && UserHandle.isSameApp(callingUid,Process.myUid())) {
    callingUid=packageUid;
  }
  checkReadAccountsPermission();
  UserAccounts accounts=getUserAccounts(userId);
  long identityToken=clearCallingIdentity();
  try {
synchronized (accounts.cacheLock) {
      return getAccountsFromCacheLocked(accounts,type,callingUid,callingPackage);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
private Account[] getAccountsAsUser(String type,int userId,String callingPackage,int packageUid){
  int callingUid=Binder.getCallingUid();
  if (userId != UserHandle.getCallingUserId() && callingUid != Process.myUid() && mContext.checkCallingOrSelfPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + UserHandle.getCallingUserId() + "String_Node_Str"+ userId);
  }
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + type + "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ Binder.getCallingPid());
  }
  if (packageUid != -1 && UserHandle.isSameApp(callingUid,Process.myUid())) {
    callingUid=packageUid;
  }
  checkReadAccountsPermission();
  long identityToken=clearCallingIdentity();
  try {
    UserAccounts accounts=getUserAccounts(userId);
synchronized (accounts.cacheLock) {
      return getAccountsFromCacheLocked(accounts,type,callingUid,callingPackage);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 194971
Project: 194971
Buggy source:
private Account[] getAccountsAsUser(String type,int userId,String callingPackage,int packageUid){
  int callingUid=Binder.getCallingUid();
  if (userId != UserHandle.getCallingUserId() && callingUid != Process.myUid() && mContext.checkCallingOrSelfPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + UserHandle.getCallingUserId() + "String_Node_Str"+ userId);
  }
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + type + "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ Binder.getCallingPid());
  }
  if (packageUid != -1 && UserHandle.isSameApp(callingUid,Process.myUid())) {
    callingUid=packageUid;
  }
  checkReadAccountsPermission();
  UserAccounts accounts=getUserAccounts(userId);
  long identityToken=clearCallingIdentity();
  try {
synchronized (accounts.cacheLock) {
      return getAccountsFromCacheLocked(accounts,type,callingUid,callingPackage);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}

Fixed version (ground truth):
private Account[] getAccountsAsUser(String type,int userId,String callingPackage,int packageUid){
  int callingUid=Binder.getCallingUid();
  if (userId != UserHandle.getCallingUserId() && callingUid != Process.myUid() && mContext.checkCallingOrSelfPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + UserHandle.getCallingUserId() + "String_Node_Str"+ userId);
  }
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + type + "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ Binder.getCallingPid());
  }
  if (packageUid != -1 && UserHandle.isSameApp(callingUid,Process.myUid())) {
    callingUid=packageUid;
  }
  checkReadAccountsPermission();
  long identityToken=clearCallingIdentity();
  try {
    UserAccounts accounts=getUserAccounts(userId);
synchronized (accounts.cacheLock) {
      return getAccountsFromCacheLocked(accounts,type,callingUid,callingPackage);
    }
  }
  finally {
    restoreCallingIdentity(identityToken);
  }
}
Program: 194972
Project: 194972
Buggy source:
@Override protected void onHeightUpdated(float expandedHeight){
  if (!mQsExpanded || mQsExpandImmediate || mIsExpanding && mQsExpandedWhenExpandingStarted) {
    positionClockAndNotifications();
  }
  if (mQsExpandImmediate || mQsExpanded && !mQsTracking && mQsExpansionAnimator == null && !mQsExpansionFromOverscroll) {
    float t;
    if (mKeyguardShowing) {
      t=expandedHeight / getMaxPanelHeight();
    }
 else {
      float panelHeightQsCollapsed=mNotificationStackScroller.getIntrinsicPadding() + mNotificationStackScroller.getMinStackHeight();
      float panelHeightQsExpanded=calculatePanelHeightQsExpanded();
      t=(expandedHeight - panelHeightQsCollapsed) / (panelHeightQsExpanded - panelHeightQsCollapsed);
    }
    setQsExpansion(mQsMinExpansionHeight + t * (getTempQsMaxExpansion() - mQsMinExpansionHeight));
  }
  updateStackHeight(expandedHeight);
  updateHeader();
  updateUnlockIcon();
  updateNotificationTranslucency();
  mHeadsUpManager.setIsExpanded(!isFullyCollapsed());
  mNotificationStackScroller.setShadeExpanded(!isFullyCollapsed());
  if (DEBUG) {
    invalidate();
  }
}

Fixed version (ground truth):
@Override protected void onHeightUpdated(float expandedHeight){
  if (!mQsExpanded || mQsExpandImmediate || mIsExpanding && mQsExpandedWhenExpandingStarted) {
    positionClockAndNotifications();
  }
  if (mQsExpandImmediate || mQsExpanded && !mQsTracking && mQsExpansionAnimator == null && !mQsExpansionFromOverscroll) {
    float t;
    if (mKeyguardShowing) {
      t=expandedHeight / getMaxPanelHeight();
    }
 else {
      float panelHeightQsCollapsed=mNotificationStackScroller.getIntrinsicPadding() + mNotificationStackScroller.getMinStackHeight();
      float panelHeightQsExpanded=calculatePanelHeightQsExpanded();
      t=(expandedHeight - panelHeightQsCollapsed) / (panelHeightQsExpanded - panelHeightQsCollapsed);
    }
    setQsExpansion(mQsMinExpansionHeight + t * (getTempQsMaxExpansion() - mQsMinExpansionHeight));
  }
  updateStackHeight(expandedHeight);
  updateHeader();
  updateUnlockIcon();
  updateNotificationTranslucency();
  updatePanelExpanded();
  mNotificationStackScroller.setShadeExpanded(!isFullyCollapsed());
  if (DEBUG) {
    invalidate();
  }
}
Program: 194973
Project: 194973
Buggy source:
void makeExpandedVisible(boolean force){
  if (SPEW)   Log.d(TAG,"String_Node_Str" + mExpandedVisible);
  if (!force && (mExpandedVisible || !panelsEnabled())) {
    return;
  }
  mExpandedVisible=true;
  if (mNavigationBarView != null)   mNavigationBarView.setSlippery(true);
  mStatusBarWindowManager.setStatusBarExpanded(true);
  mStatusBarView.setFocusable(false);
  visibilityChanged(true);
  mWaitingForKeyguardExit=false;
  disable(mDisabledUnmodified1,mDisabledUnmodified2,!force);
  setInteracting(StatusBarManager.WINDOW_STATUS_BAR,true);
}

Fixed version (ground truth):
void makeExpandedVisible(boolean force){
  if (SPEW)   Log.d(TAG,"String_Node_Str" + mExpandedVisible);
  if (!force && (mExpandedVisible || !panelsEnabled())) {
    return;
  }
  mExpandedVisible=true;
  if (mNavigationBarView != null)   mNavigationBarView.setSlippery(true);
  mStatusBarWindowManager.setPanelVisible(true);
  mStatusBarView.setFocusable(false);
  visibilityChanged(true);
  mWaitingForKeyguardExit=false;
  disable(mDisabledUnmodified1,mDisabledUnmodified2,!force);
  setInteracting(StatusBarManager.WINDOW_STATUS_BAR,true);
}