Program: 197640
Project: 197640
Buggy source:
void readFromParcelLocked(Parcel in){
  int magic=in.readInt();
  if (magic != MAGIC) {
    throw new ParcelFormatException("String_Node_Str" + Integer.toHexString(magic));
  }
  readHistory(in,false);
  mStartCount=in.readInt();
  mStartClockTime=in.readLong();
  mStartPlatformVersion=in.readString();
  mEndPlatformVersion=in.readString();
  mUptime=in.readLong();
  mUptimeStart=in.readLong();
  mRealtime=in.readLong();
  mRealtimeStart=in.readLong();
  mOnBattery=in.readInt() != 0;
  mOnBatteryInternal=false;
  mOnBatteryTimeBase.readFromParcel(in);
  mOnBatteryScreenOffTimeBase.readFromParcel(in);
  mScreenState=Display.STATE_UNKNOWN;
  mScreenOnTimer=new StopwatchTimer(null,-1,null,mOnBatteryTimeBase,in);
  for (int i=0; i < NUM_SCREEN_BRIGHTNESS_BINS; i++) {
    mScreenBrightnessTimer[i]=new StopwatchTimer(null,-100 - i,null,mOnBatteryTimeBase,in);
  }
  mInteractive=false;
  mInteractiveTimer=new StopwatchTimer(null,-9,null,mOnBatteryTimeBase,in);
  mPhoneOn=false;
  mLowPowerModeEnabledTimer=new StopwatchTimer(null,-2,null,mOnBatteryTimeBase,in);
  mPhoneOnTimer=new StopwatchTimer(null,-3,null,mOnBatteryTimeBase,in);
  for (int i=0; i < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; i++) {
    mPhoneSignalStrengthsTimer[i]=new StopwatchTimer(null,-200 - i,null,mOnBatteryTimeBase,in);
  }
  mPhoneSignalScanningTimer=new StopwatchTimer(null,-200 + 1,null,mOnBatteryTimeBase,in);
  for (int i=0; i < NUM_DATA_CONNECTION_TYPES; i++) {
    mPhoneDataConnectionsTimer[i]=new StopwatchTimer(null,-300 - i,null,mOnBatteryTimeBase,in);
  }
  for (int i=0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
    mNetworkByteActivityCounters[i]=new LongSamplingCounter(mOnBatteryTimeBase,in);
    mNetworkPacketActivityCounters[i]=new LongSamplingCounter(mOnBatteryTimeBase,in);
  }
  mMobileRadioPowerState=DataConnectionRealTimeInfo.DC_POWER_STATE_LOW;
  mMobileRadioActiveTimer=new StopwatchTimer(null,-400,null,mOnBatteryTimeBase,in);
  mMobileRadioActivePerAppTimer=new StopwatchTimer(null,-401,null,mOnBatteryTimeBase,in);
  mMobileRadioActiveAdjustedTime=new LongSamplingCounter(mOnBatteryTimeBase,in);
  mMobileRadioActiveUnknownTime=new LongSamplingCounter(mOnBatteryTimeBase,in);
  mMobileRadioActiveUnknownCount=new LongSamplingCounter(mOnBatteryTimeBase,in);
  mWifiOn=false;
  mWifiOnTimer=new StopwatchTimer(null,-4,null,mOnBatteryTimeBase,in);
  mGlobalWifiRunning=false;
  mGlobalWifiRunningTimer=new StopwatchTimer(null,-5,null,mOnBatteryTimeBase,in);
  for (int i=0; i < NUM_WIFI_STATES; i++) {
    mWifiStateTimer[i]=new StopwatchTimer(null,-600 - i,null,mOnBatteryTimeBase,in);
  }
  for (int i=0; i < NUM_WIFI_SUPPL_STATES; i++) {
    mWifiSupplStateTimer[i]=new StopwatchTimer(null,-700 - i,null,mOnBatteryTimeBase,in);
  }
  for (int i=0; i < NUM_WIFI_SIGNAL_STRENGTH_BINS; i++) {
    mWifiSignalStrengthsTimer[i]=new StopwatchTimer(null,-800 - i,null,mOnBatteryTimeBase,in);
  }
  mBluetoothOn=false;
  mBluetoothOnTimer=new StopwatchTimer(null,-6,null,mOnBatteryTimeBase,in);
  for (int i=0; i < NUM_BLUETOOTH_STATES; i++) {
    mBluetoothStateTimer[i]=new StopwatchTimer(null,-500 - i,null,mOnBatteryTimeBase,in);
  }
  mAudioOnNesting=0;
  mAudioOnTimer=new StopwatchTimer(null,-7,null,mOnBatteryTimeBase);
  mVideoOnNesting=0;
  mVideoOnTimer=new StopwatchTimer(null,-8,null,mOnBatteryTimeBase);
  mFlashlightOn=false;
  mFlashlightOnTimer=new StopwatchTimer(null,-9,null,mOnBatteryTimeBase,in);
  mDischargeUnplugLevel=in.readInt();
  mDischargePlugLevel=in.readInt();
  mDischargeCurrentLevel=in.readInt();
  mCurrentBatteryLevel=in.readInt();
  mLowDischargeAmountSinceCharge=in.readInt();
  mHighDischargeAmountSinceCharge=in.readInt();
  mDischargeAmountScreenOn=in.readInt();
  mDischargeAmountScreenOnSinceCharge=in.readInt();
  mDischargeAmountScreenOff=in.readInt();
  mDischargeAmountScreenOffSinceCharge=in.readInt();
  mNumDischargeStepDurations=in.readInt();
  in.readLongArray(mDischargeStepDurations);
  mNumChargeStepDurations=in.readInt();
  in.readLongArray(mChargeStepDurations);
  mLastWriteTime=in.readLong();
  mBluetoothPingCount=in.readInt();
  mBluetoothPingStart=-1;
  mKernelWakelockStats.clear();
  int NKW=in.readInt();
  for (int ikw=0; ikw < NKW; ikw++) {
    if (in.readInt() != 0) {
      String wakelockName=in.readString();
      SamplingTimer kwlt=new SamplingTimer(mOnBatteryTimeBase,in);
      mKernelWakelockStats.put(wakelockName,kwlt);
    }
  }
  mWakeupReasonStats.clear();
  int NWR=in.readInt();
  for (int iwr=0; iwr < NWR; iwr++) {
    if (in.readInt() != 0) {
      String reasonName=in.readString();
      LongSamplingCounter counter=new LongSamplingCounter(mOnBatteryScreenOffTimeBase,in);
      mWakeupReasonStats.put(reasonName,counter);
    }
  }
  mPartialTimers.clear();
  mFullTimers.clear();
  mWindowTimers.clear();
  mWifiRunningTimers.clear();
  mFullWifiLockTimers.clear();
  mWifiScanTimers.clear();
  mWifiBatchedScanTimers.clear();
  mWifiMulticastTimers.clear();
  mAudioTurnedOnTimers.clear();
  mVideoTurnedOnTimers.clear();
  sNumSpeedSteps=in.readInt();
  int numUids=in.readInt();
  mUidStats.clear();
  for (int i=0; i < numUids; i++) {
    int uid=in.readInt();
    Uid u=new Uid(uid);
    u.readFromParcelLocked(mOnBatteryTimeBase,mOnBatteryScreenOffTimeBase,in);
    mUidStats.append(uid,u);
  }
}

Fixed version (ground truth):
void readFromParcelLocked(Parcel in){
  int magic=in.readInt();
  if (magic != MAGIC) {
    throw new ParcelFormatException("String_Node_Str" + Integer.toHexString(magic));
  }
  readHistory(in,false);
  mStartCount=in.readInt();
  mStartClockTime=in.readLong();
  mStartPlatformVersion=in.readString();
  mEndPlatformVersion=in.readString();
  mUptime=in.readLong();
  mUptimeStart=in.readLong();
  mRealtime=in.readLong();
  mRealtimeStart=in.readLong();
  mOnBattery=in.readInt() != 0;
  mOnBatteryInternal=false;
  mOnBatteryTimeBase.readFromParcel(in);
  mOnBatteryScreenOffTimeBase.readFromParcel(in);
  mScreenState=Display.STATE_UNKNOWN;
  mScreenOnTimer=new StopwatchTimer(null,-1,null,mOnBatteryTimeBase,in);
  for (int i=0; i < NUM_SCREEN_BRIGHTNESS_BINS; i++) {
    mScreenBrightnessTimer[i]=new StopwatchTimer(null,-100 - i,null,mOnBatteryTimeBase,in);
  }
  mInteractive=false;
  mInteractiveTimer=new StopwatchTimer(null,-9,null,mOnBatteryTimeBase,in);
  mPhoneOn=false;
  mLowPowerModeEnabledTimer=new StopwatchTimer(null,-2,null,mOnBatteryTimeBase,in);
  mPhoneOnTimer=new StopwatchTimer(null,-3,null,mOnBatteryTimeBase,in);
  for (int i=0; i < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; i++) {
    mPhoneSignalStrengthsTimer[i]=new StopwatchTimer(null,-200 - i,null,mOnBatteryTimeBase,in);
  }
  mPhoneSignalScanningTimer=new StopwatchTimer(null,-200 + 1,null,mOnBatteryTimeBase,in);
  for (int i=0; i < NUM_DATA_CONNECTION_TYPES; i++) {
    mPhoneDataConnectionsTimer[i]=new StopwatchTimer(null,-300 - i,null,mOnBatteryTimeBase,in);
  }
  for (int i=0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
    mNetworkByteActivityCounters[i]=new LongSamplingCounter(mOnBatteryTimeBase,in);
    mNetworkPacketActivityCounters[i]=new LongSamplingCounter(mOnBatteryTimeBase,in);
  }
  mMobileRadioPowerState=DataConnectionRealTimeInfo.DC_POWER_STATE_LOW;
  mMobileRadioActiveTimer=new StopwatchTimer(null,-400,null,mOnBatteryTimeBase,in);
  mMobileRadioActivePerAppTimer=new StopwatchTimer(null,-401,null,mOnBatteryTimeBase,in);
  mMobileRadioActiveAdjustedTime=new LongSamplingCounter(mOnBatteryTimeBase,in);
  mMobileRadioActiveUnknownTime=new LongSamplingCounter(mOnBatteryTimeBase,in);
  mMobileRadioActiveUnknownCount=new LongSamplingCounter(mOnBatteryTimeBase,in);
  mWifiOn=false;
  mWifiOnTimer=new StopwatchTimer(null,-4,null,mOnBatteryTimeBase,in);
  mGlobalWifiRunning=false;
  mGlobalWifiRunningTimer=new StopwatchTimer(null,-5,null,mOnBatteryTimeBase,in);
  for (int i=0; i < NUM_WIFI_STATES; i++) {
    mWifiStateTimer[i]=new StopwatchTimer(null,-600 - i,null,mOnBatteryTimeBase,in);
  }
  for (int i=0; i < NUM_WIFI_SUPPL_STATES; i++) {
    mWifiSupplStateTimer[i]=new StopwatchTimer(null,-700 - i,null,mOnBatteryTimeBase,in);
  }
  for (int i=0; i < NUM_WIFI_SIGNAL_STRENGTH_BINS; i++) {
    mWifiSignalStrengthsTimer[i]=new StopwatchTimer(null,-800 - i,null,mOnBatteryTimeBase,in);
  }
  mBluetoothOn=false;
  mBluetoothOnTimer=new StopwatchTimer(null,-6,null,mOnBatteryTimeBase,in);
  for (int i=0; i < NUM_BLUETOOTH_STATES; i++) {
    mBluetoothStateTimer[i]=new StopwatchTimer(null,-500 - i,null,mOnBatteryTimeBase,in);
  }
  mAudioOnNesting=0;
  mAudioOnTimer=new StopwatchTimer(null,-7,null,mOnBatteryTimeBase);
  mVideoOnNesting=0;
  mVideoOnTimer=new StopwatchTimer(null,-8,null,mOnBatteryTimeBase);
  mFlashlightOn=false;
  mFlashlightOnTimer=new StopwatchTimer(null,-9,null,mOnBatteryTimeBase,in);
  mDischargeUnplugLevel=in.readInt();
  mDischargePlugLevel=in.readInt();
  mDischargeCurrentLevel=in.readInt();
  mCurrentBatteryLevel=in.readInt();
  mLowDischargeAmountSinceCharge=in.readInt();
  mHighDischargeAmountSinceCharge=in.readInt();
  mDischargeAmountScreenOn=in.readInt();
  mDischargeAmountScreenOnSinceCharge=in.readInt();
  mDischargeAmountScreenOff=in.readInt();
  mDischargeAmountScreenOffSinceCharge=in.readInt();
  mNumDischargeStepDurations=in.readInt();
  in.readLongArray(mDischargeStepDurations);
  mNumChargeStepDurations=in.readInt();
  in.readLongArray(mChargeStepDurations);
  mLastWriteTime=in.readLong();
  mBluetoothPingCount=in.readInt();
  mBluetoothPingStart=-1;
  mKernelWakelockStats.clear();
  int NKW=in.readInt();
  for (int ikw=0; ikw < NKW; ikw++) {
    if (in.readInt() != 0) {
      String wakelockName=in.readString();
      SamplingTimer kwlt=new SamplingTimer(mOnBatteryScreenOffTimeBase,in);
      mKernelWakelockStats.put(wakelockName,kwlt);
    }
  }
  mWakeupReasonStats.clear();
  int NWR=in.readInt();
  for (int iwr=0; iwr < NWR; iwr++) {
    if (in.readInt() != 0) {
      String reasonName=in.readString();
      SamplingTimer timer=new SamplingTimer(mOnBatteryTimeBase,in);
      mWakeupReasonStats.put(reasonName,timer);
    }
  }
  mPartialTimers.clear();
  mFullTimers.clear();
  mWindowTimers.clear();
  mWifiRunningTimers.clear();
  mFullWifiLockTimers.clear();
  mWifiScanTimers.clear();
  mWifiBatchedScanTimers.clear();
  mWifiMulticastTimers.clear();
  mAudioTurnedOnTimers.clear();
  mVideoTurnedOnTimers.clear();
  sNumSpeedSteps=in.readInt();
  int numUids=in.readInt();
  mUidStats.clear();
  for (int i=0; i < numUids; i++) {
    int uid=in.readInt();
    Uid u=new Uid(uid);
    u.readFromParcelLocked(mOnBatteryTimeBase,mOnBatteryScreenOffTimeBase,in);
    mUidStats.append(uid,u);
  }
}