nus-yam/ex-repair huggingface dataset:
Program: 21728
Project: 21728
Buggy source:
@Override public Parcelable onSaveInstanceState(){
  dismissPopup();
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  boolean haveChildren=getChildCount() > 0 && mItemCount > 0;
  long selectedId=getSelectedItemId();
  ss.selectedId=selectedId;
  ss.height=getHeight();
  if (selectedId >= 0) {
    ss.viewTop=mSelectedTop;
    ss.position=getSelectedItemPosition();
    ss.firstId=INVALID_POSITION;
  }
 else {
    if (haveChildren) {
      View v=getChildAt(0);
      ss.viewTop=v.getTop();
      int firstPos=mFirstPosition;
      if (firstPos >= mItemCount) {
        firstPos=mItemCount - 1;
      }
      ss.position=firstPos;
      ss.firstId=mAdapter.getItemId(firstPos);
    }
 else {
      ss.viewTop=0;
      ss.firstId=INVALID_POSITION;
      ss.position=0;
    }
  }
  ss.filter=null;
  if (mFiltered) {
    final EditText textFilter=mTextFilter;
    if (textFilter != null) {
      Editable filterText=textFilter.getText();
      if (filterText != null) {
        ss.filter=filterText.toString();
      }
    }
  }
  return ss;
}

Fixed version (ground truth):
@Override public Parcelable onSaveInstanceState(){
  dismissPopup();
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  boolean haveChildren=getChildCount() > 0 && mItemCount > 0;
  long selectedId=getSelectedItemId();
  ss.selectedId=selectedId;
  ss.height=getHeight();
  if (selectedId >= 0) {
    ss.viewTop=mSelectedTop;
    ss.position=getSelectedItemPosition();
    ss.firstId=INVALID_POSITION;
  }
 else {
    if (haveChildren && mFirstPosition > 0) {
      View v=getChildAt(0);
      ss.viewTop=v.getTop();
      int firstPos=mFirstPosition;
      if (firstPos >= mItemCount) {
        firstPos=mItemCount - 1;
      }
      ss.position=firstPos;
      ss.firstId=mAdapter.getItemId(firstPos);
    }
 else {
      ss.viewTop=0;
      ss.firstId=INVALID_POSITION;
      ss.position=0;
    }
  }
  ss.filter=null;
  if (mFiltered) {
    final EditText textFilter=mTextFilter;
    if (textFilter != null) {
      Editable filterText=textFilter.getText();
      if (filterText != null) {
        ss.filter=filterText.toString();
      }
    }
  }
  return ss;
}
Program: 21729
Project: 21729
Buggy source:
@Override public Parcelable onSaveInstanceState(){
  dismissPopup();
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  boolean haveChildren=getChildCount() > 0 && mItemCount > 0;
  long selectedId=getSelectedItemId();
  ss.selectedId=selectedId;
  ss.height=getHeight();
  if (selectedId >= 0) {
    ss.viewTop=mSelectedTop;
    ss.position=getSelectedItemPosition();
    ss.firstId=INVALID_POSITION;
  }
 else {
    if (haveChildren) {
      View v=getChildAt(0);
      ss.viewTop=v.getTop();
      int firstPos=mFirstPosition;
      if (firstPos >= mItemCount) {
        firstPos=mItemCount - 1;
      }
      ss.position=firstPos;
      ss.firstId=mAdapter.getItemId(firstPos);
    }
 else {
      ss.viewTop=0;
      ss.firstId=INVALID_POSITION;
      ss.position=0;
    }
  }
  ss.filter=null;
  if (mFiltered) {
    final EditText textFilter=mTextFilter;
    if (textFilter != null) {
      Editable filterText=textFilter.getText();
      if (filterText != null) {
        ss.filter=filterText.toString();
      }
    }
  }
  return ss;
}

Fixed version (ground truth):
@Override public Parcelable onSaveInstanceState(){
  dismissPopup();
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  boolean haveChildren=getChildCount() > 0 && mItemCount > 0;
  long selectedId=getSelectedItemId();
  ss.selectedId=selectedId;
  ss.height=getHeight();
  if (selectedId >= 0) {
    ss.viewTop=mSelectedTop;
    ss.position=getSelectedItemPosition();
    ss.firstId=INVALID_POSITION;
  }
 else {
    if (haveChildren && mFirstPosition > 0) {
      View v=getChildAt(0);
      ss.viewTop=v.getTop();
      int firstPos=mFirstPosition;
      if (firstPos >= mItemCount) {
        firstPos=mItemCount - 1;
      }
      ss.position=firstPos;
      ss.firstId=mAdapter.getItemId(firstPos);
    }
 else {
      ss.viewTop=0;
      ss.firstId=INVALID_POSITION;
      ss.position=0;
    }
  }
  ss.filter=null;
  if (mFiltered) {
    final EditText textFilter=mTextFilter;
    if (textFilter != null) {
      Editable filterText=textFilter.getText();
      if (filterText != null) {
        ss.filter=filterText.toString();
      }
    }
  }
  return ss;
}
Program: 21730
Project: 21730
Buggy source:
/** 
 * Called from the input dispatcher thread before a key is dispatched to a window. <p>Allows you to define behavior for keys that can not be overridden by applications or redirect key events to a different window.  This method is called from the input thread, with no locks held. <p>Note that if you change the window a key is dispatched to, the new target window will receive the key event without having input focus.
 * @param win The window that currently has focus.  This is where the keyevent will normally go.
 * @param action The key event action.
 * @param flags The key event flags.
 * @param keyCode The key code.
 * @param metaState bit mask of meta keys that are held.
 * @param repeatCount Number of times a key down has repeated.
 * @param policyFlags The policy flags associated with the key.
 * @return Returns true if the policy consumed the event and it shouldnot be further dispatched.
 */
public boolean interceptKeyBeforeDispatching(WindowState win,int action,int flags,int keyCode,int metaState,int repeatCount,int policyFlags);

Fixed version (ground truth):
/** 
 * Called from the input dispatcher thread before a key is dispatched to a window. <p>Allows you to define behavior for keys that can not be overridden by applications or redirect key events to a different window.  This method is called from the input thread, with no locks held. <p>Note that if you change the window a key is dispatched to, the new target window will receive the key event without having input focus.
 * @param win The window that currently has focus.  This is where the keyevent will normally go.
 * @param action The key event action.
 * @param flags The key event flags.
 * @param keyCode The key code.
 * @param scanCode The key's scan code.
 * @param metaState bit mask of meta keys that are held.
 * @param repeatCount Number of times a key down has repeated.
 * @param policyFlags The policy flags associated with the key.
 * @return Returns true if the policy consumed the event and it shouldnot be further dispatched.
 */
public boolean interceptKeyBeforeDispatching(WindowState win,int action,int flags,int keyCode,int scanCode,int metaState,int repeatCount,int policyFlags);
Program: 21731
Project: 21731
Buggy source:
/** 
 * Called from the input reader thread before a key is enqueued. <p>There are some actions that need to be handled here because they affect the power state of the device, for example, the power keys. Generally, it's best to keep as little as possible in the queue thread because it's the most fragile.
 * @param whenNanos The event time in uptime nanoseconds.
 * @param keyCode The key code.
 * @param down True if the key is down.
 * @param policyFlags The policy flags associated with the key.
 * @param isScreenOn True if the screen is already on
 * @return The bitwise or of the {@link #ACTION_PASS_TO_USER},  {@link #ACTION_POKE_USER_ACTIVITY} and {@link #ACTION_GO_TO_SLEEP} flags.
 */
public int interceptKeyBeforeQueueing(long whenNanos,int keyCode,boolean down,int policyFlags,boolean isScreenOn);

Fixed version (ground truth):
/** 
 * Called from the input reader thread before a key is enqueued. <p>There are some actions that need to be handled here because they affect the power state of the device, for example, the power keys. Generally, it's best to keep as little as possible in the queue thread because it's the most fragile.
 * @param whenNanos The event time in uptime nanoseconds.
 * @param action The key event action.
 * @param flags The key event flags.
 * @param keyCode The key code.
 * @param scanCode The key's scan code.
 * @param policyFlags The policy flags associated with the key.
 * @param isScreenOn True if the screen is already on
 * @return The bitwise or of the {@link #ACTION_PASS_TO_USER},  {@link #ACTION_POKE_USER_ACTIVITY} and {@link #ACTION_GO_TO_SLEEP} flags.
 */
public int interceptKeyBeforeQueueing(long whenNanos,int action,int flags,int keyCode,int scanCode,int policyFlags,boolean isScreenOn);
Program: 21732
Project: 21732
Buggy source:
/** 
 * Called from the input dispatcher thread before a key is dispatched to a window. <p>Allows you to define behavior for keys that can not be overridden by applications or redirect key events to a different window.  This method is called from the input thread, with no locks held. <p>Note that if you change the window a key is dispatched to, the new target window will receive the key event without having input focus.
 * @param win The window that currently has focus.  This is where the keyevent will normally go.
 * @param action The key event action.
 * @param flags The key event flags.
 * @param keyCode The key code.
 * @param metaState bit mask of meta keys that are held.
 * @param repeatCount Number of times a key down has repeated.
 * @param policyFlags The policy flags associated with the key.
 * @return Returns true if the policy consumed the event and it shouldnot be further dispatched.
 */
public boolean interceptKeyBeforeDispatching(WindowState win,int action,int flags,int keyCode,int metaState,int repeatCount,int policyFlags);

Fixed version (ground truth):
/** 
 * Called from the input dispatcher thread before a key is dispatched to a window. <p>Allows you to define behavior for keys that can not be overridden by applications or redirect key events to a different window.  This method is called from the input thread, with no locks held. <p>Note that if you change the window a key is dispatched to, the new target window will receive the key event without having input focus.
 * @param win The window that currently has focus.  This is where the keyevent will normally go.
 * @param action The key event action.
 * @param flags The key event flags.
 * @param keyCode The key code.
 * @param scanCode The key's scan code.
 * @param metaState bit mask of meta keys that are held.
 * @param repeatCount Number of times a key down has repeated.
 * @param policyFlags The policy flags associated with the key.
 * @return Returns true if the policy consumed the event and it shouldnot be further dispatched.
 */
public boolean interceptKeyBeforeDispatching(WindowState win,int action,int flags,int keyCode,int scanCode,int metaState,int repeatCount,int policyFlags);
Program: 21733
Project: 21733
Buggy source:
/** 
 * Called from the input reader thread before a key is enqueued. <p>There are some actions that need to be handled here because they affect the power state of the device, for example, the power keys. Generally, it's best to keep as little as possible in the queue thread because it's the most fragile.
 * @param whenNanos The event time in uptime nanoseconds.
 * @param keyCode The key code.
 * @param down True if the key is down.
 * @param policyFlags The policy flags associated with the key.
 * @param isScreenOn True if the screen is already on
 * @return The bitwise or of the {@link #ACTION_PASS_TO_USER},  {@link #ACTION_POKE_USER_ACTIVITY} and {@link #ACTION_GO_TO_SLEEP} flags.
 */
public int interceptKeyBeforeQueueing(long whenNanos,int keyCode,boolean down,int policyFlags,boolean isScreenOn);

Fixed version (ground truth):
/** 
 * Called from the input reader thread before a key is enqueued. <p>There are some actions that need to be handled here because they affect the power state of the device, for example, the power keys. Generally, it's best to keep as little as possible in the queue thread because it's the most fragile.
 * @param whenNanos The event time in uptime nanoseconds.
 * @param action The key event action.
 * @param flags The key event flags.
 * @param keyCode The key code.
 * @param scanCode The key's scan code.
 * @param policyFlags The policy flags associated with the key.
 * @param isScreenOn True if the screen is already on
 * @return The bitwise or of the {@link #ACTION_PASS_TO_USER},  {@link #ACTION_POKE_USER_ACTIVITY} and {@link #ACTION_GO_TO_SLEEP} flags.
 */
public int interceptKeyBeforeQueueing(long whenNanos,int action,int flags,int keyCode,int scanCode,int policyFlags,boolean isScreenOn);
Program: 21736
Project: 21736
Buggy source:
static private int printField(char[] formatStr,int amt,char suffix,int pos,boolean always,int zeropad){
  if (always || amt > 0) {
    if ((always && zeropad >= 3) || amt > 99) {
      int dig=amt / 100;
      formatStr[pos]=(char)(dig + '0');
      pos++;
      always=true;
      amt-=(dig * 100);
    }
    if ((always && zeropad >= 2) || amt > 9) {
      int dig=amt / 10;
      formatStr[pos]=(char)(dig + '0');
      pos++;
      always=true;
      amt-=(dig * 10);
    }
    formatStr[pos]=(char)(amt + '0');
    pos++;
    formatStr[pos]=suffix;
    pos++;
  }
  return pos;
}

Fixed version (ground truth):
static private int printField(char[] formatStr,int amt,char suffix,int pos,boolean always,int zeropad){
  if (always || amt > 0) {
    final int startPos=pos;
    if ((always && zeropad >= 3) || amt > 99) {
      int dig=amt / 100;
      formatStr[pos]=(char)(dig + '0');
      pos++;
      amt-=(dig * 100);
    }
    if ((always && zeropad >= 2) || amt > 9 || startPos != pos) {
      int dig=amt / 10;
      formatStr[pos]=(char)(dig + '0');
      pos++;
      amt-=(dig * 10);
    }
    formatStr[pos]=(char)(amt + '0');
    pos++;
    formatStr[pos]=suffix;
    pos++;
  }
  return pos;
}
Program: 21737
Project: 21737
Buggy source:
static private int printField(char[] formatStr,int amt,char suffix,int pos,boolean always,int zeropad){
  if (always || amt > 0) {
    if ((always && zeropad >= 3) || amt > 99) {
      int dig=amt / 100;
      formatStr[pos]=(char)(dig + '0');
      pos++;
      always=true;
      amt-=(dig * 100);
    }
    if ((always && zeropad >= 2) || amt > 9) {
      int dig=amt / 10;
      formatStr[pos]=(char)(dig + '0');
      pos++;
      always=true;
      amt-=(dig * 10);
    }
    formatStr[pos]=(char)(amt + '0');
    pos++;
    formatStr[pos]=suffix;
    pos++;
  }
  return pos;
}

Fixed version (ground truth):
static private int printField(char[] formatStr,int amt,char suffix,int pos,boolean always,int zeropad){
  if (always || amt > 0) {
    final int startPos=pos;
    if ((always && zeropad >= 3) || amt > 99) {
      int dig=amt / 100;
      formatStr[pos]=(char)(dig + '0');
      pos++;
      amt-=(dig * 100);
    }
    if ((always && zeropad >= 2) || amt > 9 || startPos != pos) {
      int dig=amt / 10;
      formatStr[pos]=(char)(dig + '0');
      pos++;
      amt-=(dig * 10);
    }
    formatStr[pos]=(char)(amt + '0');
    pos++;
    formatStr[pos]=suffix;
    pos++;
  }
  return pos;
}
Program: 21738
Project: 21738
Buggy source:
/** 
 * Lists all the installed packages.
 */
private void runListPackages(boolean showApplicationPackage){
  try {
    String opt;
    while ((opt=nextOption()) != null) {
      if (opt.equals("String_Node_Str")) {
      }
 else       if (opt.equals("String_Node_Str")) {
        showApplicationPackage=true;
      }
 else       if (opt.equals("String_Node_Str")) {
        showApplicationPackage=true;
      }
 else {
        System.err.println("String_Node_Str" + opt);
        showUsage();
        return;
      }
    }
  }
 catch (  RuntimeException ex) {
    System.err.println("String_Node_Str" + ex.toString());
    showUsage();
    return;
  }
  try {
    List<PackageInfo> packages=mPm.getInstalledPackages(0);
    int count=packages.size();
    for (int p=0; p < count; p++) {
      PackageInfo info=packages.get(p);
      System.out.print("String_Node_Str");
      if (showApplicationPackage) {
        System.out.print(info.applicationInfo.sourceDir);
        System.out.print("String_Node_Str");
      }
      System.out.println(info.packageName);
    }
  }
 catch (  RemoteException e) {
    System.err.println(e.toString());
    System.err.println(PM_NOT_RUNNING_ERR);
  }
}

Fixed version (ground truth):
/** 
 * Lists all the installed packages.
 */
private void runListPackages(boolean showApplicationPackage){
  int getFlags=0;
  boolean listDisabled=false, listEnabled=false;
  try {
    String opt;
    while ((opt=nextOption()) != null) {
      if (opt.equals("String_Node_Str")) {
      }
 else       if (opt.equals("String_Node_Str")) {
        showApplicationPackage=true;
      }
 else       if (opt.equals("String_Node_Str")) {
        showApplicationPackage=true;
      }
 else       if (opt.equals("String_Node_Str")) {
        listDisabled=true;
      }
 else       if (opt.equals("String_Node_Str")) {
        listEnabled=true;
      }
 else       if (opt.equals("String_Node_Str")) {
        getFlags|=PackageManager.GET_UNINSTALLED_PACKAGES;
      }
 else {
        System.err.println("String_Node_Str" + opt);
        showUsage();
        return;
      }
    }
  }
 catch (  RuntimeException ex) {
    System.err.println("String_Node_Str" + ex.toString());
    showUsage();
    return;
  }
  String filter=nextArg();
  try {
    List<PackageInfo> packages=mPm.getInstalledPackages(getFlags);
    int count=packages.size();
    for (int p=0; p < count; p++) {
      PackageInfo info=packages.get(p);
      if (filter != null && !info.packageName.contains(filter)) {
        continue;
      }
      if ((!listDisabled || !info.applicationInfo.enabled) && (!listEnabled || info.applicationInfo.enabled)) {
        System.out.print("String_Node_Str");
        if (showApplicationPackage) {
          System.out.print(info.applicationInfo.sourceDir);
          System.out.print("String_Node_Str");
        }
        System.out.println(info.packageName);
      }
    }
  }
 catch (  RemoteException e) {
    System.err.println(e.toString());
    System.err.println(PM_NOT_RUNNING_ERR);
  }
}
Program: 21739
Project: 21739
Buggy source:
/** 
 * Execute the list sub-command. pm list [package | packages] pm list permission-groups pm list permissions pm list features pm list instrumentation
 */
private void runList(){
  String type=nextArg();
  if (type == null) {
    System.err.println("String_Node_Str");
    showUsage();
    return;
  }
  if ("String_Node_Str".equals(type) || "String_Node_Str".equals(type)) {
    runListPackages(false);
  }
 else   if ("String_Node_Str".equals(type)) {
    runListPermissionGroups();
  }
 else   if ("String_Node_Str".equals(type)) {
    runListPermissions();
  }
 else   if ("String_Node_Str".equals(type)) {
    runListFeatures();
  }
 else   if ("String_Node_Str".equals(type)) {
    runListInstrumentation();
  }
 else {
    System.err.println("String_Node_Str" + type + "String_Node_Str");
    showUsage();
  }
}

Fixed version (ground truth):
/** 
 * Execute the list sub-command. pm list [package | packages] pm list permission-groups pm list permissions pm list features pm list libraries pm list instrumentation
 */
private void runList(){
  String type=nextArg();
  if (type == null) {
    System.err.println("String_Node_Str");
    showUsage();
    return;
  }
  if ("String_Node_Str".equals(type) || "String_Node_Str".equals(type)) {
    runListPackages(false);
  }
 else   if ("String_Node_Str".equals(type)) {
    runListPermissionGroups();
  }
 else   if ("String_Node_Str".equals(type)) {
    runListPermissions();
  }
 else   if ("String_Node_Str".equals(type)) {
    runListFeatures();
  }
 else   if ("String_Node_Str".equals(type)) {
    runListLibraries();
  }
 else   if ("String_Node_Str".equals(type)) {
    runListInstrumentation();
  }
 else {
    System.err.println("String_Node_Str" + type + "String_Node_Str");
    showUsage();
  }
}
Program: 21742
Project: 21742
Buggy source:
@SuppressWarnings("String_Node_Str") public void dumpCheckinLocked(PrintWriter pw,String[] args){
  boolean isUnpluggedOnly=false;
  for (  String arg : args) {
    if ("String_Node_Str".equals(arg)) {
      if (LOCAL_LOGV)       Log.v("String_Node_Str","String_Node_Str");
      isUnpluggedOnly=true;
    }
  }
  if (isUnpluggedOnly) {
    dumpCheckinLocked(pw,STATS_SINCE_UNPLUGGED,-1);
  }
 else {
    dumpCheckinLocked(pw,STATS_SINCE_CHARGED,-1);
    dumpCheckinLocked(pw,STATS_SINCE_UNPLUGGED,-1);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void dumpCheckinLocked(PrintWriter pw,String[] args,List<ApplicationInfo> apps){
  boolean isUnpluggedOnly=false;
  for (  String arg : args) {
    if ("String_Node_Str".equals(arg)) {
      if (LOCAL_LOGV)       Log.v("String_Node_Str","String_Node_Str");
      isUnpluggedOnly=true;
    }
  }
  if (apps != null) {
    SparseArray<ArrayList<String>> uids=new SparseArray<ArrayList<String>>();
    for (int i=0; i < apps.size(); i++) {
      ApplicationInfo ai=apps.get(i);
      ArrayList<String> pkgs=uids.get(ai.uid);
      if (pkgs == null) {
        pkgs=new ArrayList<String>();
        uids.put(ai.uid,pkgs);
      }
      pkgs.add(ai.packageName);
    }
    SparseArray<? extends Uid> uidStats=getUidStats();
    final int NU=uidStats.size();
    String[] lineArgs=new String[2];
    for (int i=0; i < NU; i++) {
      int uid=uidStats.keyAt(i);
      ArrayList<String> pkgs=uids.get(uid);
      if (pkgs != null) {
        for (int j=0; j < pkgs.size(); j++) {
          lineArgs[0]=Integer.toString(uid);
          lineArgs[1]=pkgs.get(j);
          dumpLine(pw,0,"String_Node_Str",UID_DATA,(Object[])lineArgs);
        }
      }
    }
  }
  if (isUnpluggedOnly) {
    dumpCheckinLocked(pw,STATS_SINCE_UNPLUGGED,-1);
  }
 else {
    dumpCheckinLocked(pw,STATS_SINCE_CHARGED,-1);
    dumpCheckinLocked(pw,STATS_SINCE_UNPLUGGED,-1);
  }
}
Program: 21743
Project: 21743
Buggy source:
@Override public Parcelable onSaveInstanceState(){
  dismissPopup();
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  boolean haveChildren=getChildCount() > 0;
  long selectedId=getSelectedItemId();
  ss.selectedId=selectedId;
  ss.height=getHeight();
  if (selectedId >= 0) {
    ss.viewTop=mSelectedTop;
    ss.position=getSelectedItemPosition();
    ss.firstId=INVALID_POSITION;
  }
 else {
    if (haveChildren) {
      View v=getChildAt(0);
      ss.viewTop=v.getTop();
      ss.position=mFirstPosition;
      ss.firstId=mAdapter.getItemId(mFirstPosition);
    }
 else {
      ss.viewTop=0;
      ss.firstId=INVALID_POSITION;
      ss.position=0;
    }
  }
  ss.filter=null;
  if (mFiltered) {
    final EditText textFilter=mTextFilter;
    if (textFilter != null) {
      Editable filterText=textFilter.getText();
      if (filterText != null) {
        ss.filter=filterText.toString();
      }
    }
  }
  return ss;
}

Fixed version (ground truth):
@Override public Parcelable onSaveInstanceState(){
  dismissPopup();
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  boolean haveChildren=getChildCount() > 0 && mItemCount > 0;
  long selectedId=getSelectedItemId();
  ss.selectedId=selectedId;
  ss.height=getHeight();
  if (selectedId >= 0) {
    ss.viewTop=mSelectedTop;
    ss.position=getSelectedItemPosition();
    ss.firstId=INVALID_POSITION;
  }
 else {
    if (haveChildren) {
      View v=getChildAt(0);
      ss.viewTop=v.getTop();
      int firstPos=mFirstPosition;
      if (firstPos >= mItemCount) {
        firstPos=mItemCount - 1;
      }
      ss.position=firstPos;
      ss.firstId=mAdapter.getItemId(firstPos);
    }
 else {
      ss.viewTop=0;
      ss.firstId=INVALID_POSITION;
      ss.position=0;
    }
  }
  ss.filter=null;
  if (mFiltered) {
    final EditText textFilter=mTextFilter;
    if (textFilter != null) {
      Editable filterText=textFilter.getText();
      if (filterText != null) {
        ss.filter=filterText.toString();
      }
    }
  }
  return ss;
}
Program: 21744
Project: 21744
Buggy source:
private Intent newGrantCredentialsPermissionIntent(Account account,int uid,AccountAuthenticatorResponse response,String authTokenType,String authTokenLabel){
  RegisteredServicesCache.ServiceInfo<AuthenticatorDescription> serviceInfo=mAuthenticatorCache.getServiceInfo(AuthenticatorDescription.newKey(account.type));
  if (serviceInfo == null) {
    throw new IllegalArgumentException("String_Node_Str" + account.type);
  }
  final Context authContext;
  try {
    authContext=mContext.createPackageContext(serviceInfo.type.packageName,0);
  }
 catch (  PackageManager.NameNotFoundException e) {
    throw new IllegalArgumentException("String_Node_Str" + account.type);
  }
  Intent intent=new Intent(mContext,GrantCredentialsPermissionActivity.class);
  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  intent.addCategory(String.valueOf(getCredentialPermissionNotificationId(account,authTokenType,uid)));
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_ACCOUNT,account);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_AUTH_TOKEN_LABEL,authTokenLabel);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_AUTH_TOKEN_TYPE,authTokenType);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_RESPONSE,response);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_ACCOUNT_TYPE_LABEL,authContext.getString(serviceInfo.type.labelId));
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_PACKAGES,mContext.getPackageManager().getPackagesForUid(uid));
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_REQUESTING_UID,uid);
  return intent;
}

Fixed version (ground truth):
private Intent newGrantCredentialsPermissionIntent(Account account,int uid,AccountAuthenticatorResponse response,String authTokenType,String authTokenLabel){
  Intent intent=new Intent(mContext,GrantCredentialsPermissionActivity.class);
  intent.addCategory(String.valueOf(getCredentialPermissionNotificationId(account,authTokenType,uid)));
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_ACCOUNT,account);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_AUTH_TOKEN_TYPE,authTokenType);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_RESPONSE,response);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_REQUESTING_UID,uid);
  return intent;
}
Program: 21746
Project: 21746
Buggy source:
public void onClick(View v){
  final AccountManagerService accountManagerService=AccountManagerService.getSingleton();
switch (v.getId()) {
case R.id.allow_button:
    accountManagerService.grantAppPermission(mAccount,mAuthTokenType,mUid);
  Intent result=new Intent();
result.putExtra("String_Node_Str",true);
setResult(RESULT_OK,result);
setAccountAuthenticatorResult(result.getExtras());
break;
case R.id.deny_button:
accountManagerService.revokeAppPermission(mAccount,mAuthTokenType,mUid);
setResult(RESULT_CANCELED);
break;
}
finish();
}

Fixed version (ground truth):
public void onClick(View v){
switch (v.getId()) {
case R.id.allow_button:
    accountManagerService.grantAppPermission(mAccount,mAuthTokenType,mUid);
  Intent result=new Intent();
result.putExtra("String_Node_Str",true);
setResult(RESULT_OK,result);
setAccountAuthenticatorResult(result.getExtras());
break;
case R.id.deny_button:
accountManagerService.revokeAppPermission(mAccount,mAuthTokenType,mUid);
setResult(RESULT_CANCELED);
break;
}
finish();
}
Program: 21747
Project: 21747
Buggy source:
@Override public Parcelable onSaveInstanceState(){
  dismissPopup();
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  boolean haveChildren=getChildCount() > 0;
  long selectedId=getSelectedItemId();
  ss.selectedId=selectedId;
  ss.height=getHeight();
  if (selectedId >= 0) {
    ss.viewTop=mSelectedTop;
    ss.position=getSelectedItemPosition();
    ss.firstId=INVALID_POSITION;
  }
 else {
    if (haveChildren) {
      View v=getChildAt(0);
      ss.viewTop=v.getTop();
      ss.position=mFirstPosition;
      ss.firstId=mAdapter.getItemId(mFirstPosition);
    }
 else {
      ss.viewTop=0;
      ss.firstId=INVALID_POSITION;
      ss.position=0;
    }
  }
  ss.filter=null;
  if (mFiltered) {
    final EditText textFilter=mTextFilter;
    if (textFilter != null) {
      Editable filterText=textFilter.getText();
      if (filterText != null) {
        ss.filter=filterText.toString();
      }
    }
  }
  return ss;
}

Fixed version (ground truth):
@Override public Parcelable onSaveInstanceState(){
  dismissPopup();
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  boolean haveChildren=getChildCount() > 0 && mItemCount > 0;
  long selectedId=getSelectedItemId();
  ss.selectedId=selectedId;
  ss.height=getHeight();
  if (selectedId >= 0) {
    ss.viewTop=mSelectedTop;
    ss.position=getSelectedItemPosition();
    ss.firstId=INVALID_POSITION;
  }
 else {
    if (haveChildren) {
      View v=getChildAt(0);
      ss.viewTop=v.getTop();
      int firstPos=mFirstPosition;
      if (firstPos >= mItemCount) {
        firstPos=mItemCount - 1;
      }
      ss.position=firstPos;
      ss.firstId=mAdapter.getItemId(firstPos);
    }
 else {
      ss.viewTop=0;
      ss.firstId=INVALID_POSITION;
      ss.position=0;
    }
  }
  ss.filter=null;
  if (mFiltered) {
    final EditText textFilter=mTextFilter;
    if (textFilter != null) {
      Editable filterText=textFilter.getText();
      if (filterText != null) {
        ss.filter=filterText.toString();
      }
    }
  }
  return ss;
}
Program: 21748
Project: 21748
Buggy source:
/** 
 * Gets the SIP URI string of this profile.
 * @return the SIP URI string of this profile
 */
public String getUriString(){
  return mAddress.getURI().toString();
}

Fixed version (ground truth):
/** 
 * Gets the SIP URI string of this profile.
 * @return the SIP URI string of this profile
 */
public String getUriString(){
  if (!TextUtils.isEmpty(mProxyAddress)) {
    return "String_Node_Str" + getUserName() + "String_Node_Str"+ mDomain;
  }
  return getUri().toString();
}
Program: 21749
Project: 21749
Buggy source:
/** 
 * Sets the protocol used to connect to the SIP server. Currently, only "UDP" and "TCP" are supported.
 * @param protocol the protocol string
 * @return this builder object
 * @throws IllegalArgumentException if the protocol is not recognized
 */
public Builder setProtocol(String protocol) throws IllegalArgumentException {
  if (protocol == null) {
    throw new NullPointerException("String_Node_Str");
  }
  protocol=protocol.toUpperCase();
  if (!protocol.equals("String_Node_Str") && !protocol.equals("String_Node_Str")) {
    throw new IllegalArgumentException("String_Node_Str" + protocol);
  }
  mProfile.mProtocol=protocol;
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the protocol used to connect to the SIP server. Currently, only "UDP" and "TCP" are supported.
 * @param protocol the protocol string
 * @return this builder object
 * @throws IllegalArgumentException if the protocol is not recognized
 */
public Builder setProtocol(String protocol) throws IllegalArgumentException {
  if (protocol == null) {
    throw new NullPointerException("String_Node_Str");
  }
  protocol=protocol.toUpperCase();
  if (!protocol.equals(UDP) && !protocol.equals(TCP)) {
    throw new IllegalArgumentException("String_Node_Str" + protocol);
  }
  mProfile.mProtocol=protocol;
  return this;
}
Program: 21750
Project: 21750
Buggy source:
/** 
 * Sets the port number of the server. By default, it is 5060.
 * @param port port number of the server
 * @return this builder object
 * @throws IllegalArgumentException if the port number is out of range
 */
public Builder setPort(int port) throws IllegalArgumentException {
  try {
    mUri.setPort(port);
    return this;
  }
 catch (  InvalidArgumentException e) {
    throw new IllegalArgumentException(e);
  }
}

Fixed version (ground truth):
/** 
 * Sets the port number of the server. By default, it is 5060.
 * @param port port number of the server
 * @return this builder object
 * @throws IllegalArgumentException if the port number is out of range
 */
public Builder setPort(int port) throws IllegalArgumentException {
  if ((port > 65535) || (port < 1000)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mProfile.mPort=port;
  return this;
}
Program: 21751
Project: 21751
Buggy source:
private SipProfile(Parcel in){
  mAddress=(Address)in.readSerializable();
  mProxyAddress=in.readString();
  mPassword=in.readString();
  mDomain=in.readString();
  mProtocol=in.readString();
  mProfileName=in.readString();
  mSendKeepAlive=(in.readInt() == 0) ? false : true;
  mAutoRegistration=(in.readInt() == 0) ? false : true;
  mCallingUid=in.readInt();
}

Fixed version (ground truth):
private SipProfile(Parcel in){
  mAddress=(Address)in.readSerializable();
  mProxyAddress=in.readString();
  mPassword=in.readString();
  mDomain=in.readString();
  mProtocol=in.readString();
  mProfileName=in.readString();
  mSendKeepAlive=(in.readInt() == 0) ? false : true;
  mAutoRegistration=(in.readInt() == 0) ? false : true;
  mCallingUid=in.readInt();
  mPort=in.readInt();
}
Program: 21752
Project: 21752
Buggy source:
/** 
 * Gets the port number of the SIP server.
 * @return the port number of the SIP server
 */
public int getPort(){
  int port=getUri().getPort();
  return (port == -1) ? DEFAULT_PORT : port;
}

Fixed version (ground truth):
/** 
 * Gets the port number of the SIP server.
 * @return the port number of the SIP server
 */
public int getPort(){
  return mPort;
}
Program: 21753
Project: 21753
Buggy source:
/** 
 * Builds and returns the SIP profile object.
 * @return the profile object created
 */
public SipProfile build(){
  mProfile.mPassword=mUri.getUserPassword();
  mUri.setUserPassword(null);
  try {
    mProfile.mAddress=mAddressFactory.createAddress(mDisplayName,mUri);
    if (!TextUtils.isEmpty(mProxyAddress)) {
      SipURI uri=(SipURI)mAddressFactory.createURI(fix(mProxyAddress));
      mProfile.mProxyAddress=uri.getHost();
    }
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
  return mProfile;
}

Fixed version (ground truth):
/** 
 * Builds and returns the SIP profile object.
 * @return the profile object created
 */
public SipProfile build(){
  mProfile.mPassword=mUri.getUserPassword();
  mUri.setUserPassword(null);
  try {
    if (!TextUtils.isEmpty(mProxyAddress)) {
      SipURI uri=(SipURI)mAddressFactory.createURI(fix(mProxyAddress));
      mProfile.mProxyAddress=uri.getHost();
    }
 else {
      if (!mProfile.mProtocol.equals(UDP)) {
        mUri.setTransportParam(mProfile.mProtocol);
      }
      if (mProfile.mPort != DEFAULT_PORT) {
        mUri.setPort(mProfile.mPort);
      }
    }
    mProfile.mAddress=mAddressFactory.createAddress(mDisplayName,mUri);
  }
 catch (  InvalidArgumentException e) {
    throw new RuntimeException(e);
  }
catch (  ParseException e) {
    throw new RuntimeException(e);
  }
  return mProfile;
}
Program: 21754
Project: 21754
Buggy source:
@Override public void writeToParcel(Parcel out,int flags){
  out.writeSerializable(mAddress);
  out.writeString(mProxyAddress);
  out.writeString(mPassword);
  out.writeString(mDomain);
  out.writeString(mProtocol);
  out.writeString(mProfileName);
  out.writeInt(mSendKeepAlive ? 1 : 0);
  out.writeInt(mAutoRegistration ? 1 : 0);
  out.writeInt(mCallingUid);
}

Fixed version (ground truth):
@Override public void writeToParcel(Parcel out,int flags){
  out.writeSerializable(mAddress);
  out.writeString(mProxyAddress);
  out.writeString(mPassword);
  out.writeString(mDomain);
  out.writeString(mProtocol);
  out.writeString(mProfileName);
  out.writeInt(mSendKeepAlive ? 1 : 0);
  out.writeInt(mAutoRegistration ? 1 : 0);
  out.writeInt(mCallingUid);
  out.writeInt(mPort);
}
Program: 21755
Project: 21755
Buggy source:
private Request createRequest(String requestType,SipProfile userProfile,String tag) throws ParseException, SipException {
  FromHeader fromHeader=createFromHeader(userProfile,tag);
  ToHeader toHeader=createToHeader(userProfile);
  SipURI requestURI=mAddressFactory.createSipURI("String_Node_Str" + userProfile.getSipDomain());
  List<ViaHeader> viaHeaders=createViaHeaders();
  CallIdHeader callIdHeader=createCallIdHeader();
  CSeqHeader cSeqHeader=createCSeqHeader(requestType);
  MaxForwardsHeader maxForwards=createMaxForwardsHeader();
  Request request=mMessageFactory.createRequest(requestURI,requestType,callIdHeader,cSeqHeader,fromHeader,toHeader,viaHeaders,maxForwards);
  Header userAgentHeader=mHeaderFactory.createHeader("String_Node_Str","String_Node_Str");
  request.addHeader(userAgentHeader);
  return request;
}

Fixed version (ground truth):
private Request createRequest(String requestType,SipProfile userProfile,String tag) throws ParseException, SipException {
  FromHeader fromHeader=createFromHeader(userProfile,tag);
  ToHeader toHeader=createToHeader(userProfile);
  SipURI requestURI=mAddressFactory.createSipURI(userProfile.getUriString().replaceFirst(userProfile.getUserName() + "String_Node_Str","String_Node_Str"));
  List<ViaHeader> viaHeaders=createViaHeaders();
  CallIdHeader callIdHeader=createCallIdHeader();
  CSeqHeader cSeqHeader=createCSeqHeader(requestType);
  MaxForwardsHeader maxForwards=createMaxForwardsHeader();
  Request request=mMessageFactory.createRequest(requestURI,requestType,callIdHeader,cSeqHeader,fromHeader,toHeader,viaHeaders,maxForwards);
  Header userAgentHeader=mHeaderFactory.createHeader("String_Node_Str","String_Node_Str");
  request.addHeader(userAgentHeader);
  return request;
}
Program: 21756
Project: 21756
Buggy source:
private Intent newGrantCredentialsPermissionIntent(Account account,int uid,AccountAuthenticatorResponse response,String authTokenType,String authTokenLabel){
  RegisteredServicesCache.ServiceInfo<AuthenticatorDescription> serviceInfo=mAuthenticatorCache.getServiceInfo(AuthenticatorDescription.newKey(account.type));
  if (serviceInfo == null) {
    throw new IllegalArgumentException("String_Node_Str" + account.type);
  }
  final Context authContext;
  try {
    authContext=mContext.createPackageContext(serviceInfo.type.packageName,0);
  }
 catch (  PackageManager.NameNotFoundException e) {
    throw new IllegalArgumentException("String_Node_Str" + account.type);
  }
  Intent intent=new Intent(mContext,GrantCredentialsPermissionActivity.class);
  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  intent.addCategory(String.valueOf(getCredentialPermissionNotificationId(account,authTokenType,uid)));
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_ACCOUNT,account);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_AUTH_TOKEN_LABEL,authTokenLabel);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_AUTH_TOKEN_TYPE,authTokenType);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_RESPONSE,response);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_ACCOUNT_TYPE_LABEL,authContext.getString(serviceInfo.type.labelId));
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_PACKAGES,mContext.getPackageManager().getPackagesForUid(uid));
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_REQUESTING_UID,uid);
  return intent;
}

Fixed version (ground truth):
private Intent newGrantCredentialsPermissionIntent(Account account,int uid,AccountAuthenticatorResponse response,String authTokenType,String authTokenLabel){
  Intent intent=new Intent(mContext,GrantCredentialsPermissionActivity.class);
  intent.addCategory(String.valueOf(getCredentialPermissionNotificationId(account,authTokenType,uid)));
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_ACCOUNT,account);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_AUTH_TOKEN_TYPE,authTokenType);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_RESPONSE,response);
  intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_REQUESTING_UID,uid);
  return intent;
}
Program: 21758
Project: 21758
Buggy source:
public void onClick(View v){
  final AccountManagerService accountManagerService=AccountManagerService.getSingleton();
switch (v.getId()) {
case R.id.allow_button:
    accountManagerService.grantAppPermission(mAccount,mAuthTokenType,mUid);
  Intent result=new Intent();
result.putExtra("String_Node_Str",true);
setResult(RESULT_OK,result);
setAccountAuthenticatorResult(result.getExtras());
break;
case R.id.deny_button:
accountManagerService.revokeAppPermission(mAccount,mAuthTokenType,mUid);
setResult(RESULT_CANCELED);
break;
}
finish();
}

Fixed version (ground truth):
public void onClick(View v){
switch (v.getId()) {
case R.id.allow_button:
    accountManagerService.grantAppPermission(mAccount,mAuthTokenType,mUid);
  Intent result=new Intent();
result.putExtra("String_Node_Str",true);
setResult(RESULT_OK,result);
setAccountAuthenticatorResult(result.getExtras());
break;
case R.id.deny_button:
accountManagerService.revokeAppPermission(mAccount,mAuthTokenType,mUid);
setResult(RESULT_CANCELED);
break;
}
finish();
}
Program: 21759
Project: 21759
Buggy source:
/** 
 * Gets the SIP URI string of this profile.
 * @return the SIP URI string of this profile
 */
public String getUriString(){
  return mAddress.getURI().toString();
}

Fixed version (ground truth):
/** 
 * Gets the SIP URI string of this profile.
 * @return the SIP URI string of this profile
 */
public String getUriString(){
  if (!TextUtils.isEmpty(mProxyAddress)) {
    return "String_Node_Str" + getUserName() + "String_Node_Str"+ mDomain;
  }
  return getUri().toString();
}
Program: 21760
Project: 21760
Buggy source:
/** 
 * Sets the protocol used to connect to the SIP server. Currently, only "UDP" and "TCP" are supported.
 * @param protocol the protocol string
 * @return this builder object
 * @throws IllegalArgumentException if the protocol is not recognized
 */
public Builder setProtocol(String protocol) throws IllegalArgumentException {
  if (protocol == null) {
    throw new NullPointerException("String_Node_Str");
  }
  protocol=protocol.toUpperCase();
  if (!protocol.equals("String_Node_Str") && !protocol.equals("String_Node_Str")) {
    throw new IllegalArgumentException("String_Node_Str" + protocol);
  }
  mProfile.mProtocol=protocol;
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the protocol used to connect to the SIP server. Currently, only "UDP" and "TCP" are supported.
 * @param protocol the protocol string
 * @return this builder object
 * @throws IllegalArgumentException if the protocol is not recognized
 */
public Builder setProtocol(String protocol) throws IllegalArgumentException {
  if (protocol == null) {
    throw new NullPointerException("String_Node_Str");
  }
  protocol=protocol.toUpperCase();
  if (!protocol.equals(UDP) && !protocol.equals(TCP)) {
    throw new IllegalArgumentException("String_Node_Str" + protocol);
  }
  mProfile.mProtocol=protocol;
  return this;
}
Program: 21761
Project: 21761
Buggy source:
/** 
 * Sets the port number of the server. By default, it is 5060.
 * @param port port number of the server
 * @return this builder object
 * @throws IllegalArgumentException if the port number is out of range
 */
public Builder setPort(int port) throws IllegalArgumentException {
  try {
    mUri.setPort(port);
    return this;
  }
 catch (  InvalidArgumentException e) {
    throw new IllegalArgumentException(e);
  }
}

Fixed version (ground truth):
/** 
 * Sets the port number of the server. By default, it is 5060.
 * @param port port number of the server
 * @return this builder object
 * @throws IllegalArgumentException if the port number is out of range
 */
public Builder setPort(int port) throws IllegalArgumentException {
  if ((port > 65535) || (port < 1000)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mProfile.mPort=port;
  return this;
}
Program: 21762
Project: 21762
Buggy source:
private SipProfile(Parcel in){
  mAddress=(Address)in.readSerializable();
  mProxyAddress=in.readString();
  mPassword=in.readString();
  mDomain=in.readString();
  mProtocol=in.readString();
  mProfileName=in.readString();
  mSendKeepAlive=(in.readInt() == 0) ? false : true;
  mAutoRegistration=(in.readInt() == 0) ? false : true;
  mCallingUid=in.readInt();
}

Fixed version (ground truth):
private SipProfile(Parcel in){
  mAddress=(Address)in.readSerializable();
  mProxyAddress=in.readString();
  mPassword=in.readString();
  mDomain=in.readString();
  mProtocol=in.readString();
  mProfileName=in.readString();
  mSendKeepAlive=(in.readInt() == 0) ? false : true;
  mAutoRegistration=(in.readInt() == 0) ? false : true;
  mCallingUid=in.readInt();
  mPort=in.readInt();
}
Program: 21763
Project: 21763
Buggy source:
/** 
 * Gets the port number of the SIP server.
 * @return the port number of the SIP server
 */
public int getPort(){
  int port=getUri().getPort();
  return (port == -1) ? DEFAULT_PORT : port;
}

Fixed version (ground truth):
/** 
 * Gets the port number of the SIP server.
 * @return the port number of the SIP server
 */
public int getPort(){
  return mPort;
}
Program: 21764
Project: 21764
Buggy source:
/** 
 * Builds and returns the SIP profile object.
 * @return the profile object created
 */
public SipProfile build(){
  mProfile.mPassword=mUri.getUserPassword();
  mUri.setUserPassword(null);
  try {
    mProfile.mAddress=mAddressFactory.createAddress(mDisplayName,mUri);
    if (!TextUtils.isEmpty(mProxyAddress)) {
      SipURI uri=(SipURI)mAddressFactory.createURI(fix(mProxyAddress));
      mProfile.mProxyAddress=uri.getHost();
    }
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
  return mProfile;
}

Fixed version (ground truth):
/** 
 * Builds and returns the SIP profile object.
 * @return the profile object created
 */
public SipProfile build(){
  mProfile.mPassword=mUri.getUserPassword();
  mUri.setUserPassword(null);
  try {
    if (!TextUtils.isEmpty(mProxyAddress)) {
      SipURI uri=(SipURI)mAddressFactory.createURI(fix(mProxyAddress));
      mProfile.mProxyAddress=uri.getHost();
    }
 else {
      if (!mProfile.mProtocol.equals(UDP)) {
        mUri.setTransportParam(mProfile.mProtocol);
      }
      if (mProfile.mPort != DEFAULT_PORT) {
        mUri.setPort(mProfile.mPort);
      }
    }
    mProfile.mAddress=mAddressFactory.createAddress(mDisplayName,mUri);
  }
 catch (  InvalidArgumentException e) {
    throw new RuntimeException(e);
  }
catch (  ParseException e) {
    throw new RuntimeException(e);
  }
  return mProfile;
}
Program: 21765
Project: 21765
Buggy source:
@Override public void writeToParcel(Parcel out,int flags){
  out.writeSerializable(mAddress);
  out.writeString(mProxyAddress);
  out.writeString(mPassword);
  out.writeString(mDomain);
  out.writeString(mProtocol);
  out.writeString(mProfileName);
  out.writeInt(mSendKeepAlive ? 1 : 0);
  out.writeInt(mAutoRegistration ? 1 : 0);
  out.writeInt(mCallingUid);
}

Fixed version (ground truth):
@Override public void writeToParcel(Parcel out,int flags){
  out.writeSerializable(mAddress);
  out.writeString(mProxyAddress);
  out.writeString(mPassword);
  out.writeString(mDomain);
  out.writeString(mProtocol);
  out.writeString(mProfileName);
  out.writeInt(mSendKeepAlive ? 1 : 0);
  out.writeInt(mAutoRegistration ? 1 : 0);
  out.writeInt(mCallingUid);
  out.writeInt(mPort);
}