Program: 198248
Project: 198248
Buggy source:
static ActivityRecord restoreFromXml(XmlPullParser in,int taskId,ActivityStackSupervisor stackSupervisor) throws IOException, XmlPullParserException {
  Intent intent=null;
  PersistableBundle persistentState=null;
  int launchedFromUid=0;
  String launchedFromPackage=null;
  String resolvedType=null;
  boolean componentSpecified=false;
  int userId=0;
  long createTime=-1;
  final int outerDepth=in.getDepth();
  TaskDescription taskDescription=new TaskDescription();
  for (int attrNdx=in.getAttributeCount() - 1; attrNdx >= 0; --attrNdx) {
    final String attrName=in.getAttributeName(attrNdx);
    final String attrValue=in.getAttributeValue(attrNdx);
    if (TaskPersister.DEBUG)     Slog.d(TaskPersister.TAG,"String_Node_Str" + attrName + "String_Node_Str"+ attrValue);
    if (ATTR_ID.equals(attrName)) {
      createTime=Long.valueOf(attrValue);
    }
 else     if (ATTR_LAUNCHEDFROMUID.equals(attrName)) {
      launchedFromUid=Integer.valueOf(attrValue);
    }
 else     if (ATTR_LAUNCHEDFROMPACKAGE.equals(attrName)) {
      launchedFromPackage=attrValue;
    }
 else     if (ATTR_RESOLVEDTYPE.equals(attrName)) {
      resolvedType=attrValue;
    }
 else     if (ATTR_COMPONENTSPECIFIED.equals(attrName)) {
      componentSpecified=Boolean.valueOf(attrValue);
    }
 else     if (ATTR_USERID.equals(attrName)) {
      userId=Integer.valueOf(attrValue);
    }
 else     if (TaskRecord.readTaskDescriptionAttribute(taskDescription,attrName,attrValue)) {
    }
 else {
      Log.d(TAG,"String_Node_Str" + attrName);
    }
  }
  int event;
  while (((event=in.next()) != XmlPullParser.END_DOCUMENT) && (event != XmlPullParser.END_TAG || in.getDepth() < outerDepth)) {
    if (event == XmlPullParser.START_TAG) {
      final String name=in.getName();
      if (TaskPersister.DEBUG)       Slog.d(TaskPersister.TAG,"String_Node_Str" + name);
      if (TAG_INTENT.equals(name)) {
        intent=Intent.restoreFromXml(in);
        if (TaskPersister.DEBUG)         Slog.d(TaskPersister.TAG,"String_Node_Str" + intent);
      }
 else       if (TAG_PERSISTABLEBUNDLE.equals(name)) {
        persistentState=PersistableBundle.restoreFromXml(in);
        if (TaskPersister.DEBUG)         Slog.d(TaskPersister.TAG,"String_Node_Str" + persistentState);
      }
 else {
        Slog.w(TAG,"String_Node_Str" + name);
        XmlUtils.skipCurrentTag(in);
      }
    }
  }
  if (intent == null) {
    throw new XmlPullParserException("String_Node_Str" + intent);
  }
  final ActivityManagerService service=stackSupervisor.mService;
  final ActivityInfo aInfo=stackSupervisor.resolveActivity(intent,resolvedType,0,null,null,userId);
  if (aInfo == null) {
    throw new XmlPullParserException("String_Node_Str" + intent + "String_Node_Str"+ resolvedType);
  }
  final ActivityRecord r=new ActivityRecord(service,null,launchedFromUid,launchedFromPackage,intent,resolvedType,aInfo,service.getConfiguration(),null,null,0,componentSpecified,stackSupervisor,null,null);
  r.persistentState=persistentState;
  if (createTime >= 0) {
    taskDescription.setIcon(TaskPersister.restoreImage(createImageFilename(r,taskId)));
  }
  r.taskDescription=taskDescription;
  r.createTime=createTime;
  return r;
}

Fixed version (ground truth):
static ActivityRecord restoreFromXml(XmlPullParser in,int taskId,ActivityStackSupervisor stackSupervisor) throws IOException, XmlPullParserException {
  Intent intent=null;
  PersistableBundle persistentState=null;
  int launchedFromUid=0;
  String launchedFromPackage=null;
  String resolvedType=null;
  boolean componentSpecified=false;
  int userId=0;
  long createTime=-1;
  final int outerDepth=in.getDepth();
  TaskDescription taskDescription=new TaskDescription();
  for (int attrNdx=in.getAttributeCount() - 1; attrNdx >= 0; --attrNdx) {
    final String attrName=in.getAttributeName(attrNdx);
    final String attrValue=in.getAttributeValue(attrNdx);
    if (TaskPersister.DEBUG)     Slog.d(TaskPersister.TAG,"String_Node_Str" + attrName + "String_Node_Str"+ attrValue);
    if (ATTR_ID.equals(attrName)) {
      createTime=Long.valueOf(attrValue);
    }
 else     if (ATTR_LAUNCHEDFROMUID.equals(attrName)) {
      launchedFromUid=Integer.valueOf(attrValue);
    }
 else     if (ATTR_LAUNCHEDFROMPACKAGE.equals(attrName)) {
      launchedFromPackage=attrValue;
    }
 else     if (ATTR_RESOLVEDTYPE.equals(attrName)) {
      resolvedType=attrValue;
    }
 else     if (ATTR_COMPONENTSPECIFIED.equals(attrName)) {
      componentSpecified=Boolean.valueOf(attrValue);
    }
 else     if (ATTR_USERID.equals(attrName)) {
      userId=Integer.valueOf(attrValue);
    }
 else     if (TaskRecord.readTaskDescriptionAttribute(taskDescription,attrName,attrValue)) {
    }
 else {
      Log.d(TAG,"String_Node_Str" + attrName);
    }
  }
  int event;
  while (((event=in.next()) != XmlPullParser.END_DOCUMENT) && (event != XmlPullParser.END_TAG || in.getDepth() < outerDepth)) {
    if (event == XmlPullParser.START_TAG) {
      final String name=in.getName();
      if (TaskPersister.DEBUG)       Slog.d(TaskPersister.TAG,"String_Node_Str" + name);
      if (TAG_INTENT.equals(name)) {
        intent=Intent.restoreFromXml(in);
        if (TaskPersister.DEBUG)         Slog.d(TaskPersister.TAG,"String_Node_Str" + intent);
      }
 else       if (TAG_PERSISTABLEBUNDLE.equals(name)) {
        persistentState=PersistableBundle.restoreFromXml(in);
        if (TaskPersister.DEBUG)         Slog.d(TaskPersister.TAG,"String_Node_Str" + persistentState);
      }
 else {
        Slog.w(TAG,"String_Node_Str" + name);
        XmlUtils.skipCurrentTag(in);
      }
    }
  }
  if (intent == null) {
    throw new XmlPullParserException("String_Node_Str" + intent);
  }
  final ActivityManagerService service=stackSupervisor.mService;
  final ActivityInfo aInfo=stackSupervisor.resolveActivity(intent,resolvedType,0,null,null,userId);
  if (aInfo == null) {
    throw new XmlPullParserException("String_Node_Str" + intent + "String_Node_Str"+ resolvedType);
  }
  final ActivityRecord r=new ActivityRecord(service,null,launchedFromUid,launchedFromPackage,intent,resolvedType,aInfo,service.getConfiguration(),null,null,0,componentSpecified,stackSupervisor,null,null);
  r.persistentState=persistentState;
  if (createTime >= 0) {
    taskDescription.setIcon(TaskPersister.restoreImage(createImageFilename(createTime,taskId)));
  }
  r.taskDescription=taskDescription;
  r.createTime=createTime;
  return r;
}