Program: 195527
Project: 195527
Buggy source:
private void runStackSplit() throws Exception {
  final int stackId=Integer.valueOf(nextArgRequired());
  final String splitDirection=nextArgRequired();
  Intent intent=null;
  try {
    intent=makeIntent(UserHandle.USER_CURRENT);
  }
 catch (  IllegalArgumentException e) {
  }
  try {
    final StackInfo currentStackInfo=mAm.getStackInfo(stackId);
    final Rect currentStackBounds=new Rect(currentStackInfo.bounds);
    final Rect newStackBounds=new Rect(currentStackInfo.bounds);
    if ("String_Node_Str".equals(splitDirection)) {
      currentStackBounds.right=newStackBounds.left=currentStackInfo.bounds.centerX();
    }
 else     if ("String_Node_Str".equals(splitDirection)) {
      currentStackBounds.bottom=newStackBounds.top=currentStackInfo.bounds.centerY();
    }
 else {
      showError("String_Node_Str" + splitDirection + "String_Node_Str");
      return;
    }
    IActivityContainer container=mAm.createStackOnDisplay(currentStackInfo.displayId);
    if (container == null) {
      showError("String_Node_Str");
    }
    final StackInfo newStackInfo=mAm.getStackInfo(container.getStackId());
    if (intent != null) {
      container.startActivity(intent);
    }
 else     if (currentStackInfo.taskIds != null && currentStackInfo.taskIds.length > 1) {
      mAm.moveTaskToStack(currentStackInfo.taskIds[currentStackInfo.taskIds.length - 1],newStackInfo.stackId,true);
    }
    for (    int taskId : currentStackInfo.taskIds) {
      mAm.setTaskResizeable(taskId,true);
    }
    for (    int taskId : newStackInfo.taskIds) {
      mAm.setTaskResizeable(taskId,true);
    }
    mAm.resizeStack(currentStackInfo.stackId,currentStackBounds);
    mAm.resizeStack(newStackInfo.stackId,newStackBounds);
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
private void runStackSplit() throws Exception {
  final int stackId=Integer.valueOf(nextArgRequired());
  final String splitDirection=nextArgRequired();
  Intent intent=null;
  try {
    intent=makeIntent(UserHandle.USER_CURRENT);
  }
 catch (  IllegalArgumentException e) {
  }
  try {
    final StackInfo currentStackInfo=mAm.getStackInfo(stackId);
    final Rect currentStackBounds=new Rect(currentStackInfo.bounds);
    final Rect newStackBounds=new Rect(currentStackInfo.bounds);
    if ("String_Node_Str".equals(splitDirection)) {
      currentStackBounds.right=newStackBounds.left=currentStackInfo.bounds.centerX();
    }
 else     if ("String_Node_Str".equals(splitDirection)) {
      currentStackBounds.bottom=newStackBounds.top=currentStackInfo.bounds.centerY();
    }
 else {
      showError("String_Node_Str" + splitDirection + "String_Node_Str");
      return;
    }
    IActivityContainer container=mAm.createStackOnDisplay(currentStackInfo.displayId);
    if (container == null) {
      showError("String_Node_Str");
    }
    final int newStackId=container.getStackId();
    if (intent != null) {
      container.startActivity(intent);
    }
 else     if (currentStackInfo.taskIds != null && currentStackInfo.taskIds.length > 1) {
      mAm.moveTaskToStack(currentStackInfo.taskIds[currentStackInfo.taskIds.length - 1],newStackId,true);
    }
    final StackInfo newStackInfo=mAm.getStackInfo(newStackId);
    for (    int taskId : currentStackInfo.taskIds) {
      mAm.setTaskResizeable(taskId,true);
    }
    for (    int taskId : newStackInfo.taskIds) {
      mAm.setTaskResizeable(taskId,true);
    }
    mAm.resizeStack(currentStackInfo.stackId,currentStackBounds);
    mAm.resizeStack(newStackInfo.stackId,newStackBounds);
  }
 catch (  RemoteException e) {
  }
}