nus-yam/ex-repair huggingface dataset:
Program: 588
Project: 588
Buggy source:
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    Object key=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.append(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  while (N > 0) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    Object key=readValue(loader);
    Object value=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString((key != null ? key.hashCode() : 0))+ "String_Node_Str"+ key);
    outVal.append(key,value);
    N--;
  }
}
Program: 589
Project: 589
Buggy source:
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
  }
}

Fixed version (ground truth):
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString(val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
  }
}
Program: 590
Project: 590
Buggy source:
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      int length=mParcelledData.dataSize();
      parcel.writeInt(length);
      parcel.writeInt(BUNDLE_MAGIC);
      parcel.appendFrom(mParcelledData,0,length);
    }
 else {
      int lengthPos=parcel.dataPosition();
      parcel.writeInt(-1);
      parcel.writeInt(BUNDLE_MAGIC);
      int startPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int endPos=parcel.dataPosition();
      parcel.setDataPosition(lengthPos);
      int length=endPos - startPos;
      parcel.writeInt(length);
      parcel.setDataPosition(endPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}

Fixed version (ground truth):
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      if (mParcelledData == EMPTY_PARCEL) {
        parcel.writeInt(0);
      }
 else {
        int length=mParcelledData.dataSize();
        parcel.writeInt(length);
        parcel.writeInt(BUNDLE_MAGIC);
        parcel.appendFrom(mParcelledData,0,length);
      }
    }
 else {
      if (mMap == null || mMap.size() <= 0) {
        parcel.writeInt(0);
        return;
      }
      int lengthPos=parcel.dataPosition();
      parcel.writeInt(-1);
      parcel.writeInt(BUNDLE_MAGIC);
      int startPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int endPos=parcel.dataPosition();
      parcel.setDataPosition(lengthPos);
      int length=endPos - startPos;
      parcel.writeInt(length);
      parcel.setDataPosition(endPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}
Program: 591
Project: 591
Buggy source:
/** 
 * If the underlying data are stored as a Parcel, unparcel them using the currently assigned class loader.
 */
synchronized void unparcel(){
  if (mParcelledData == null) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str");
    return;
  }
  int N=mParcelledData.readInt();
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str"+ N+ "String_Node_Str");
  if (N < 0) {
    return;
  }
  if (mMap == null) {
    mMap=new ArrayMap<String,Object>(N);
  }
 else {
    mMap.erase();
    mMap.ensureCapacity(N);
  }
  mParcelledData.readArrayMapInternal(mMap,N,mClassLoader);
  mParcelledData.recycle();
  mParcelledData=null;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str"+ mMap);
}

Fixed version (ground truth):
/** 
 * If the underlying data are stored as a Parcel, unparcel them using the currently assigned class loader.
 */
synchronized void unparcel(){
  if (mParcelledData == null) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str");
    return;
  }
  if (mParcelledData == EMPTY_PARCEL) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str");
    if (mMap == null) {
      mMap=new ArrayMap<String,Object>(1);
    }
 else {
      mMap.erase();
    }
    mParcelledData=null;
    return;
  }
  int N=mParcelledData.readInt();
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str"+ N+ "String_Node_Str");
  if (N < 0) {
    return;
  }
  if (mMap == null) {
    mMap=new ArrayMap<String,Object>(N);
  }
 else {
    mMap.erase();
    mMap.ensureCapacity(N);
  }
  mParcelledData.readArrayMapInternal(mMap,N,mClassLoader);
  mParcelledData.recycle();
  mParcelledData=null;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str"+ mMap);
}
Program: 592
Project: 592
Buggy source:
void readFromParcelInner(Parcel parcel,int length){
  int magic=parcel.readInt();
  if (magic != BUNDLE_MAGIC) {
    throw new IllegalStateException("String_Node_Str" + Integer.toHexString(magic));
  }
  int offset=parcel.dataPosition();
  parcel.setDataPosition(offset + length);
  Parcel p=Parcel.obtain();
  p.setDataPosition(0);
  p.appendFrom(parcel,offset,length);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str"+ length+ "String_Node_Str"+ offset);
  p.setDataPosition(0);
  mParcelledData=p;
  mHasFds=p.hasFileDescriptors();
  mFdsKnown=true;
}

Fixed version (ground truth):
void readFromParcelInner(Parcel parcel,int length){
  if (length == 0) {
    mParcelledData=EMPTY_PARCEL;
    mHasFds=false;
    mFdsKnown=true;
    return;
  }
  int magic=parcel.readInt();
  if (magic != BUNDLE_MAGIC) {
    throw new IllegalStateException("String_Node_Str" + Integer.toHexString(magic));
  }
  int offset=parcel.dataPosition();
  parcel.setDataPosition(offset + length);
  Parcel p=Parcel.obtain();
  p.setDataPosition(0);
  p.appendFrom(parcel,offset,length);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str"+ length+ "String_Node_Str"+ offset);
  p.setDataPosition(0);
  mParcelledData=p;
  mHasFds=p.hasFileDescriptors();
  mFdsKnown=true;
}
Program: 593
Project: 593
Buggy source:
/** 
 * Constructs a Bundle containing a copy of the mappings from the given Bundle.
 * @param b a Bundle to be copied.
 */
public Bundle(Bundle b){
  if (b.mParcelledData != null) {
    mParcelledData=Parcel.obtain();
    mParcelledData.appendFrom(b.mParcelledData,0,b.mParcelledData.dataSize());
    mParcelledData.setDataPosition(0);
  }
 else {
    mParcelledData=null;
  }
  if (b.mMap != null) {
    mMap=new ArrayMap<String,Object>(b.mMap);
  }
 else {
    mMap=null;
  }
  mHasFds=b.mHasFds;
  mFdsKnown=b.mFdsKnown;
  mClassLoader=b.mClassLoader;
}

Fixed version (ground truth):
/** 
 * Constructs a Bundle containing a copy of the mappings from the given Bundle.
 * @param b a Bundle to be copied.
 */
public Bundle(Bundle b){
  if (b.mParcelledData != null) {
    if (b.mParcelledData == EMPTY_PARCEL) {
      mParcelledData=EMPTY_PARCEL;
    }
 else {
      mParcelledData=Parcel.obtain();
      mParcelledData.appendFrom(b.mParcelledData,0,b.mParcelledData.dataSize());
      mParcelledData.setDataPosition(0);
    }
  }
 else {
    mParcelledData=null;
  }
  if (b.mMap != null) {
    mMap=new ArrayMap<String,Object>(b.mMap);
  }
 else {
    mMap=null;
  }
  mHasFds=b.mHasFds;
  mFdsKnown=b.mFdsKnown;
  mClassLoader=b.mClassLoader;
}
Program: 594
Project: 594
Buggy source:
@Override public synchronized String toString(){
  if (mParcelledData != null) {
    return "String_Node_Str" + mParcelledData.dataSize() + "String_Node_Str";
  }
  return "String_Node_Str" + mMap.toString() + "String_Node_Str";
}

Fixed version (ground truth):
@Override public synchronized String toString(){
  if (mParcelledData != null) {
    if (mParcelledData == EMPTY_PARCEL) {
      return "String_Node_Str";
    }
 else {
      return "String_Node_Str" + mParcelledData.dataSize() + "String_Node_Str";
    }
  }
  return "String_Node_Str" + mMap.toString() + "String_Node_Str";
}
Program: 595
Project: 595
Buggy source:
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    Object key=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.append(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  while (N > 0) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    Object key=readValue(loader);
    Object value=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString((key != null ? key.hashCode() : 0))+ "String_Node_Str"+ key);
    outVal.append(key,value);
    N--;
  }
}
Program: 596
Project: 596
Buggy source:
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
  }
}

Fixed version (ground truth):
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString(val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
  }
}
Program: 597
Project: 597
Buggy source:
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created for the given <code>sceneRoot</code>, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager}XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return The scene for the given root and layout id
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=(SparseArray<Scene>)sceneRoot.getTag(com.android.internal.R.id.scene_layoutid_cache);
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sceneRoot.setTag(com.android.internal.R.id.scene_layoutid_cache,scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}

Fixed version (ground truth):
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created for the given <code>sceneRoot</code>, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager}XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return The scene for the given root and layout id
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=(SparseArray<Scene>)sceneRoot.getTag(com.android.internal.R.id.scene_layoutid_cache);
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sceneRoot.setTagInternal(com.android.internal.R.id.scene_layoutid_cache,scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}
Program: 598
Project: 598
Buggy source:
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created for the given <code>sceneRoot</code>, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager}XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return The scene for the given root and layout id
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=(SparseArray<Scene>)sceneRoot.getTag(com.android.internal.R.id.scene_layoutid_cache);
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sceneRoot.setTag(com.android.internal.R.id.scene_layoutid_cache,scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}

Fixed version (ground truth):
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created for the given <code>sceneRoot</code>, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager}XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return The scene for the given root and layout id
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=(SparseArray<Scene>)sceneRoot.getTag(com.android.internal.R.id.scene_layoutid_cache);
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sceneRoot.setTagInternal(com.android.internal.R.id.scene_layoutid_cache,scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}
Program: 599
Project: 599
Buggy source:
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created for the given <code>sceneRoot</code>, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager}XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return The scene for the given root and layout id
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=(SparseArray<Scene>)sceneRoot.getTag(com.android.internal.R.id.scene_layoutid_cache);
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sceneRoot.setTag(com.android.internal.R.id.scene_layoutid_cache,scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}

Fixed version (ground truth):
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created for the given <code>sceneRoot</code>, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager}XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return The scene for the given root and layout id
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=(SparseArray<Scene>)sceneRoot.getTag(com.android.internal.R.id.scene_layoutid_cache);
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sceneRoot.setTagInternal(com.android.internal.R.id.scene_layoutid_cache,scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}
Program: 600
Project: 600
Buggy source:
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created for the given <code>sceneRoot</code>, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager}XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return The scene for the given root and layout id
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=(SparseArray<Scene>)sceneRoot.getTag(com.android.internal.R.id.scene_layoutid_cache);
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sceneRoot.setTag(com.android.internal.R.id.scene_layoutid_cache,scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}

Fixed version (ground truth):
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created for the given <code>sceneRoot</code>, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager}XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return The scene for the given root and layout id
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=(SparseArray<Scene>)sceneRoot.getTag(com.android.internal.R.id.scene_layoutid_cache);
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sceneRoot.setTagInternal(com.android.internal.R.id.scene_layoutid_cache,scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}
Program: 601
Project: 601
Buggy source:
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created for the given <code>sceneRoot</code>, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager}XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return The scene for the given root and layout id
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=(SparseArray<Scene>)sceneRoot.getTag(com.android.internal.R.id.scene_layoutid_cache);
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sceneRoot.setTag(com.android.internal.R.id.scene_layoutid_cache,scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}

Fixed version (ground truth):
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created for the given <code>sceneRoot</code>, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager}XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return The scene for the given root and layout id
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=(SparseArray<Scene>)sceneRoot.getTag(com.android.internal.R.id.scene_layoutid_cache);
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sceneRoot.setTagInternal(com.android.internal.R.id.scene_layoutid_cache,scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}
Program: 602
Project: 602
Buggy source:
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created for the given <code>sceneRoot</code>, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager}XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return The scene for the given root and layout id
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=(SparseArray<Scene>)sceneRoot.getTag(com.android.internal.R.id.scene_layoutid_cache);
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sceneRoot.setTag(com.android.internal.R.id.scene_layoutid_cache,scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}

Fixed version (ground truth):
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created for the given <code>sceneRoot</code>, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager}XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return The scene for the given root and layout id
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=(SparseArray<Scene>)sceneRoot.getTag(com.android.internal.R.id.scene_layoutid_cache);
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sceneRoot.setTagInternal(com.android.internal.R.id.scene_layoutid_cache,scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}
Program: 603
Project: 603
Buggy source:
public static long dumpSingleTime(PrintWriter pw,String prefix,long[] durations,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=durations[state];
      String running="String_Node_Str";
      if (curState == state) {
        time+=now - curStartTime;
        if (pw != null) {
          running="String_Node_Str";
        }
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING);
          printedMem=imem;
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    printScreenLabel(pw,STATE_NOTHING);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}

Fixed version (ground truth):
public static long dumpSingleTime(PrintWriter pw,String prefix,long[] durations,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=durations[state];
      String running="String_Node_Str";
      if (curState == state) {
        time+=now - curStartTime;
        if (pw != null) {
          running="String_Node_Str";
        }
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING,(char)0);
          printedMem=imem;
          pw.print("String_Node_Str");
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}
Program: 604
Project: 604
Buggy source:
private static void printMemLabel(PrintWriter pw,int offset){
switch (offset) {
case ADJ_NOTHING:
    pw.print("String_Node_Str");
  break;
case ADJ_MEM_FACTOR_NORMAL:
pw.print("String_Node_Str");
break;
case ADJ_MEM_FACTOR_MODERATE:
pw.print("String_Node_Str");
break;
case ADJ_MEM_FACTOR_LOW:
pw.print("String_Node_Str");
break;
case ADJ_MEM_FACTOR_CRITICAL:
pw.print("String_Node_Str");
break;
default :
pw.print("String_Node_Str");
break;
}
}

Fixed version (ground truth):
private static void printMemLabel(PrintWriter pw,int offset,char sep){
switch (offset) {
case ADJ_NOTHING:
    pw.print("String_Node_Str");
  if (sep != 0)   pw.print(' ');
break;
case ADJ_MEM_FACTOR_NORMAL:
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
case ADJ_MEM_FACTOR_MODERATE:
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
case ADJ_MEM_FACTOR_LOW:
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
case ADJ_MEM_FACTOR_CRITICAL:
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
default :
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
}
}
Program: 605
Project: 605
Buggy source:
public static long dumpSingleServiceTime(PrintWriter pw,String prefix,ServiceState service,int serviceType,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=service.getDuration(serviceType,curState,curStartTime,state,now);
      String running="String_Node_Str";
      if (curState == state && pw != null) {
        running="String_Node_Str";
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING);
          printedMem=imem;
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    printScreenLabel(pw,STATE_NOTHING);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}

Fixed version (ground truth):
public static long dumpSingleServiceTime(PrintWriter pw,String prefix,ServiceState service,int serviceType,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=service.getDuration(serviceType,curState,curStartTime,state,now);
      String running="String_Node_Str";
      if (curState == state && pw != null) {
        running="String_Node_Str";
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING,(char)0);
          printedMem=imem;
          pw.print("String_Node_Str");
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}
Program: 607
Project: 607
Buggy source:
private void dumpProcessInternalLocked(PrintWriter pw,String prefix,ProcessState proc,boolean dumpAll){
  if (dumpAll) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(Integer.toHexString(System.identityHashCode(proc)));
    pw.print("String_Node_Str");
    pw.print(Integer.toHexString(System.identityHashCode(proc.mCommonProcess)));
    pw.print("String_Node_Str");
    pw.println(proc.mPackage);
    if (proc.mMultiPackage) {
      pw.print(prefix);
      pw.print("String_Node_Str");
      pw.println(proc.mMultiPackage);
    }
    if (proc != proc.mCommonProcess) {
      pw.print(prefix);
      pw.print("String_Node_Str");
      pw.print(proc.mCommonProcess.mName);
      pw.print("String_Node_Str");
      pw.print(proc.mCommonProcess.mUid);
      pw.print("String_Node_Str");
      pw.println(proc.mCommonProcess.mPackage);
    }
  }
  pw.print(prefix);
  pw.print("String_Node_Str");
  pw.println(proc.mActive);
  if (proc.mDead) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.println(proc.mDead);
  }
  pw.print(prefix);
  pw.print("String_Node_Str");
  pw.print(proc.mNumActiveServices);
  pw.print("String_Node_Str");
  pw.println(proc.mNumStartedServices);
}

Fixed version (ground truth):
private void dumpProcessInternalLocked(PrintWriter pw,String prefix,ProcessState proc,boolean dumpAll){
  if (dumpAll) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(Integer.toHexString(System.identityHashCode(proc)));
    pw.print("String_Node_Str");
    pw.print(Integer.toHexString(System.identityHashCode(proc.mCommonProcess)));
    pw.print("String_Node_Str");
    pw.println(proc.mPackage);
    if (proc.mMultiPackage) {
      pw.print(prefix);
      pw.print("String_Node_Str");
      pw.println(proc.mMultiPackage);
    }
    if (proc != proc.mCommonProcess) {
      pw.print(prefix);
      pw.print("String_Node_Str");
      pw.print(proc.mCommonProcess.mName);
      pw.print("String_Node_Str");
      pw.print(proc.mCommonProcess.mUid);
      pw.print("String_Node_Str");
      pw.println(proc.mCommonProcess.mPackage);
    }
  }
  if (proc.mActive) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.println(proc.mActive);
  }
  if (proc.mDead) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.println(proc.mDead);
  }
  if (proc.mNumActiveServices != 0 || proc.mNumStartedServices != 0) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(proc.mNumActiveServices);
    pw.print("String_Node_Str");
    pw.println(proc.mNumStartedServices);
  }
}
Program: 609
Project: 609
Buggy source:
private final List<ProviderInfo> generateApplicationProvidersLocked(ProcessRecord app){
  List<ProviderInfo> providers=null;
  try {
    providers=AppGlobals.getPackageManager().queryContentProviders(app.processName,app.uid,STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS);
  }
 catch (  RemoteException ex) {
  }
  if (DEBUG_MU)   Slog.v(TAG_MU,"String_Node_Str" + app.uid);
  int userId=app.userId;
  if (providers != null) {
    int N=providers.size();
    app.pubProviders.ensureCapacity(N + app.pubProviders.size());
    for (int i=0; i < N; i++) {
      ProviderInfo cpi=(ProviderInfo)providers.get(i);
      boolean singleton=isSingleton(cpi.processName,cpi.applicationInfo,cpi.name,cpi.flags);
      if (singleton && UserHandle.getUserId(app.uid) != 0) {
        providers.remove(i);
        N--;
        i--;
        continue;
      }
      ComponentName comp=new ComponentName(cpi.packageName,cpi.name);
      ContentProviderRecord cpr=mProviderMap.getProviderByClass(comp,userId);
      if (cpr == null) {
        cpr=new ContentProviderRecord(this,cpi,app.info,comp,singleton);
        mProviderMap.putProviderByClass(comp,cpr);
      }
      if (DEBUG_MU)       Slog.v(TAG_MU,"String_Node_Str" + cpr.uid);
      app.pubProviders.put(cpi.name,cpr);
      app.addPackage(cpi.applicationInfo.packageName,mProcessStats);
      ensurePackageDexOpt(cpi.applicationInfo.packageName);
    }
  }
  return providers;
}

Fixed version (ground truth):
private final List<ProviderInfo> generateApplicationProvidersLocked(ProcessRecord app){
  List<ProviderInfo> providers=null;
  try {
    providers=AppGlobals.getPackageManager().queryContentProviders(app.processName,app.uid,STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS);
  }
 catch (  RemoteException ex) {
  }
  if (DEBUG_MU)   Slog.v(TAG_MU,"String_Node_Str" + app.uid);
  int userId=app.userId;
  if (providers != null) {
    int N=providers.size();
    app.pubProviders.ensureCapacity(N + app.pubProviders.size());
    for (int i=0; i < N; i++) {
      ProviderInfo cpi=(ProviderInfo)providers.get(i);
      boolean singleton=isSingleton(cpi.processName,cpi.applicationInfo,cpi.name,cpi.flags);
      if (singleton && UserHandle.getUserId(app.uid) != 0) {
        providers.remove(i);
        N--;
        i--;
        continue;
      }
      ComponentName comp=new ComponentName(cpi.packageName,cpi.name);
      ContentProviderRecord cpr=mProviderMap.getProviderByClass(comp,userId);
      if (cpr == null) {
        cpr=new ContentProviderRecord(this,cpi,app.info,comp,singleton);
        mProviderMap.putProviderByClass(comp,cpr);
      }
      if (DEBUG_MU)       Slog.v(TAG_MU,"String_Node_Str" + cpr.uid);
      app.pubProviders.put(cpi.name,cpr);
      if (!cpi.multiprocess || !"String_Node_Str".equals(cpi.packageName)) {
        app.addPackage(cpi.applicationInfo.packageName,mProcessStats);
      }
      ensurePackageDexOpt(cpi.applicationInfo.packageName);
    }
  }
  return providers;
}
Program: 611
Project: 611
Buggy source:
void startSpecificActivityLocked(ActivityRecord r,boolean andResume,boolean checkConfig){
  ProcessRecord app=mService.getProcessRecordLocked(r.processName,r.info.applicationInfo.uid,true);
  r.task.stack.setLaunchTime(r);
  if (app != null && app.thread != null) {
    try {
      app.addPackage(r.info.packageName,mService.mProcessStats);
      realStartActivityLocked(r,app,andResume,checkConfig);
      return;
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str" + r.intent.getComponent().flattenToShortString(),e);
    }
  }
  mService.startProcessLocked(r.processName,r.info.applicationInfo,true,0,"String_Node_Str",r.intent.getComponent(),false,false,true);
}

Fixed version (ground truth):
void startSpecificActivityLocked(ActivityRecord r,boolean andResume,boolean checkConfig){
  ProcessRecord app=mService.getProcessRecordLocked(r.processName,r.info.applicationInfo.uid,true);
  r.task.stack.setLaunchTime(r);
  if (app != null && app.thread != null) {
    try {
      if ((r.info.flags & ActivityInfo.FLAG_MULTIPROCESS) == 0 || !"String_Node_Str".equals(r.info.packageName)) {
        app.addPackage(r.info.packageName,mService.mProcessStats);
      }
      realStartActivityLocked(r,app,andResume,checkConfig);
      return;
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str" + r.intent.getComponent().flattenToShortString(),e);
    }
  }
  mService.startProcessLocked(r.processName,r.info.applicationInfo,true,0,"String_Node_Str",r.intent.getComponent(),false,false,true);
}
Program: 613
Project: 613
Buggy source:
@Override public void setForcedDisplayDensity(int displayId,int density){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      setForcedDisplayDensityLocked(displayContent,density);
      Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_DENSITY_FORCED,Integer.toString(density));
    }
  }
}

Fixed version (ground truth):
@Override public void setForcedDisplayDensity(int displayId,int density){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      final DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        setForcedDisplayDensityLocked(displayContent,density);
        Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_DENSITY_FORCED,Integer.toString(density));
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 614
Project: 614
Buggy source:
@Override public void setForcedDisplaySize(int displayId,int width,int height){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final int MIN_WIDTH=200;
    final int MIN_HEIGHT=200;
    final int MAX_SCALE=2;
    final DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      width=Math.min(Math.max(width,MIN_WIDTH),displayContent.mInitialDisplayWidth * MAX_SCALE);
      height=Math.min(Math.max(height,MIN_HEIGHT),displayContent.mInitialDisplayHeight * MAX_SCALE);
      setForcedDisplaySizeLocked(displayContent,width,height);
      Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_SIZE_FORCED,width + "String_Node_Str" + height);
    }
  }
}

Fixed version (ground truth):
@Override public void setForcedDisplaySize(int displayId,int width,int height){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      final int MIN_WIDTH=200;
      final int MIN_HEIGHT=200;
      final int MAX_SCALE=2;
      final DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        width=Math.min(Math.max(width,MIN_WIDTH),displayContent.mInitialDisplayWidth * MAX_SCALE);
        height=Math.min(Math.max(height,MIN_HEIGHT),displayContent.mInitialDisplayHeight * MAX_SCALE);
        setForcedDisplaySizeLocked(displayContent,width,height);
        Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_SIZE_FORCED,width + "String_Node_Str" + height);
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 615
Project: 615
Buggy source:
@Override public void clearForcedDisplaySize(int displayId){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      setForcedDisplaySizeLocked(displayContent,displayContent.mInitialDisplayWidth,displayContent.mInitialDisplayHeight);
      Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_SIZE_FORCED,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void clearForcedDisplaySize(int displayId){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      final DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        setForcedDisplaySizeLocked(displayContent,displayContent.mInitialDisplayWidth,displayContent.mInitialDisplayHeight);
        Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_SIZE_FORCED,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}