nus-yam/ex-repair huggingface dataset:
Program: 198539
Project: 198539
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  float centerX=getWidth() / 2.0f;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    float width=child.getMeasuredWidth();
    float height=child.getMeasuredHeight();
    child.layout((int)(centerX - width / 2.0f),0,(int)(centerX + width / 2.0f),(int)height);
  }
  setMaxLayoutHeight(getHeight());
  updateContentHeight();
  clampScrollPosition();
  requestChildrenUpdate();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  float centerX=getWidth() / 2.0f;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    float width=child.getMeasuredWidth();
    float height=child.getMeasuredHeight();
    child.layout((int)(centerX - width / 2.0f),0,(int)(centerX + width / 2.0f),(int)height);
  }
  setMaxLayoutHeight(getHeight());
  updateContentHeight();
  clampScrollPosition();
  requestAnimationOnViewResize();
  requestChildrenUpdate();
}
Program: 198540
Project: 198540
Buggy source:
public void reset(){
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}

Fixed version (ground truth):
public void reset(){
  super.reset();
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}
Program: 198541
Project: 198541
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  boolean updateExpandHeight=mMaxExpandHeight == 0;
  mMaxExpandHeight=mPrivateLayout.getMaxHeight();
  if (updateExpandHeight) {
    applyExpansionToLayout();
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  boolean updateExpandHeight=mMaxExpandHeight == 0 && !mWasReset;
  mMaxExpandHeight=mPrivateLayout.getMaxHeight();
  if (updateExpandHeight) {
    applyExpansionToLayout();
  }
  mWasReset=false;
}
Program: 198542
Project: 198542
Buggy source:
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  mMaxExpandHeight=0;
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  mMaxExpandHeight=0;
  mWasReset=true;
  logExpansionEvent(false,wasExpanded);
}
Program: 198543
Project: 198543
Buggy source:
private void generateChildHierarchyEvents(){
  generateChildRemovalEvents();
  generateChildAdditionEvents();
  generatePositionChangeEvents();
  generateSnapBackEvents();
  generateDragEvents();
  generateTopPaddingEvent();
  generateActivateEvent();
  generateDimmedEvent();
  generateHideSensitiveEvent();
  generateDarkEvent();
  generateGoToFullShadeEvent();
  mNeedsAnimation=false;
}

Fixed version (ground truth):
private void generateChildHierarchyEvents(){
  generateChildRemovalEvents();
  generateChildAdditionEvents();
  generatePositionChangeEvents();
  generateSnapBackEvents();
  generateDragEvents();
  generateTopPaddingEvent();
  generateActivateEvent();
  generateDimmedEvent();
  generateHideSensitiveEvent();
  generateDarkEvent();
  generateGoToFullShadeEvent();
  generateViewResizeEvent();
  mNeedsAnimation=false;
}
Program: 198544
Project: 198544
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  float centerX=getWidth() / 2.0f;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    float width=child.getMeasuredWidth();
    float height=child.getMeasuredHeight();
    child.layout((int)(centerX - width / 2.0f),0,(int)(centerX + width / 2.0f),(int)height);
  }
  setMaxLayoutHeight(getHeight());
  updateContentHeight();
  clampScrollPosition();
  requestChildrenUpdate();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  float centerX=getWidth() / 2.0f;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    float width=child.getMeasuredWidth();
    float height=child.getMeasuredHeight();
    child.layout((int)(centerX - width / 2.0f),0,(int)(centerX + width / 2.0f),(int)height);
  }
  setMaxLayoutHeight(getHeight());
  updateContentHeight();
  clampScrollPosition();
  requestAnimationOnViewResize();
  requestChildrenUpdate();
}
Program: 198545
Project: 198545
Buggy source:
public void reset(){
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}

Fixed version (ground truth):
public void reset(){
  super.reset();
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}
Program: 198546
Project: 198546
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  boolean updateExpandHeight=mMaxExpandHeight == 0;
  mMaxExpandHeight=mPrivateLayout.getMaxHeight();
  if (updateExpandHeight) {
    applyExpansionToLayout();
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  boolean updateExpandHeight=mMaxExpandHeight == 0 && !mWasReset;
  mMaxExpandHeight=mPrivateLayout.getMaxHeight();
  if (updateExpandHeight) {
    applyExpansionToLayout();
  }
  mWasReset=false;
}
Program: 198547
Project: 198547
Buggy source:
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  mMaxExpandHeight=0;
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  mMaxExpandHeight=0;
  mWasReset=true;
  logExpansionEvent(false,wasExpanded);
}
Program: 198548
Project: 198548
Buggy source:
private void generateChildHierarchyEvents(){
  generateChildRemovalEvents();
  generateChildAdditionEvents();
  generatePositionChangeEvents();
  generateSnapBackEvents();
  generateDragEvents();
  generateTopPaddingEvent();
  generateActivateEvent();
  generateDimmedEvent();
  generateHideSensitiveEvent();
  generateDarkEvent();
  generateGoToFullShadeEvent();
  mNeedsAnimation=false;
}

Fixed version (ground truth):
private void generateChildHierarchyEvents(){
  generateChildRemovalEvents();
  generateChildAdditionEvents();
  generatePositionChangeEvents();
  generateSnapBackEvents();
  generateDragEvents();
  generateTopPaddingEvent();
  generateActivateEvent();
  generateDimmedEvent();
  generateHideSensitiveEvent();
  generateDarkEvent();
  generateGoToFullShadeEvent();
  generateViewResizeEvent();
  mNeedsAnimation=false;
}
Program: 198549
Project: 198549
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  float centerX=getWidth() / 2.0f;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    float width=child.getMeasuredWidth();
    float height=child.getMeasuredHeight();
    child.layout((int)(centerX - width / 2.0f),0,(int)(centerX + width / 2.0f),(int)height);
  }
  setMaxLayoutHeight(getHeight());
  updateContentHeight();
  clampScrollPosition();
  requestChildrenUpdate();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  float centerX=getWidth() / 2.0f;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    float width=child.getMeasuredWidth();
    float height=child.getMeasuredHeight();
    child.layout((int)(centerX - width / 2.0f),0,(int)(centerX + width / 2.0f),(int)height);
  }
  setMaxLayoutHeight(getHeight());
  updateContentHeight();
  clampScrollPosition();
  requestAnimationOnViewResize();
  requestChildrenUpdate();
}
Program: 198550
Project: 198550
Buggy source:
public void reset(){
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}

Fixed version (ground truth):
public void reset(){
  super.reset();
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}
Program: 198551
Project: 198551
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  boolean updateExpandHeight=mMaxExpandHeight == 0;
  mMaxExpandHeight=mPrivateLayout.getMaxHeight();
  if (updateExpandHeight) {
    applyExpansionToLayout();
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  boolean updateExpandHeight=mMaxExpandHeight == 0 && !mWasReset;
  mMaxExpandHeight=mPrivateLayout.getMaxHeight();
  if (updateExpandHeight) {
    applyExpansionToLayout();
  }
  mWasReset=false;
}
Program: 198552
Project: 198552
Buggy source:
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  mMaxExpandHeight=0;
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  mMaxExpandHeight=0;
  mWasReset=true;
  logExpansionEvent(false,wasExpanded);
}
Program: 198553
Project: 198553
Buggy source:
private void generateChildHierarchyEvents(){
  generateChildRemovalEvents();
  generateChildAdditionEvents();
  generatePositionChangeEvents();
  generateSnapBackEvents();
  generateDragEvents();
  generateTopPaddingEvent();
  generateActivateEvent();
  generateDimmedEvent();
  generateHideSensitiveEvent();
  generateDarkEvent();
  generateGoToFullShadeEvent();
  mNeedsAnimation=false;
}

Fixed version (ground truth):
private void generateChildHierarchyEvents(){
  generateChildRemovalEvents();
  generateChildAdditionEvents();
  generatePositionChangeEvents();
  generateSnapBackEvents();
  generateDragEvents();
  generateTopPaddingEvent();
  generateActivateEvent();
  generateDimmedEvent();
  generateHideSensitiveEvent();
  generateDarkEvent();
  generateGoToFullShadeEvent();
  generateViewResizeEvent();
  mNeedsAnimation=false;
}
Program: 198554
Project: 198554
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  float centerX=getWidth() / 2.0f;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    float width=child.getMeasuredWidth();
    float height=child.getMeasuredHeight();
    child.layout((int)(centerX - width / 2.0f),0,(int)(centerX + width / 2.0f),(int)height);
  }
  setMaxLayoutHeight(getHeight());
  updateContentHeight();
  clampScrollPosition();
  requestChildrenUpdate();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  float centerX=getWidth() / 2.0f;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    float width=child.getMeasuredWidth();
    float height=child.getMeasuredHeight();
    child.layout((int)(centerX - width / 2.0f),0,(int)(centerX + width / 2.0f),(int)height);
  }
  setMaxLayoutHeight(getHeight());
  updateContentHeight();
  clampScrollPosition();
  requestAnimationOnViewResize();
  requestChildrenUpdate();
}
Program: 198555
Project: 198555
Buggy source:
public void reset(){
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}

Fixed version (ground truth):
public void reset(){
  super.reset();
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}
Program: 198556
Project: 198556
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  boolean updateExpandHeight=mMaxExpandHeight == 0;
  mMaxExpandHeight=mPrivateLayout.getMaxHeight();
  if (updateExpandHeight) {
    applyExpansionToLayout();
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  boolean updateExpandHeight=mMaxExpandHeight == 0 && !mWasReset;
  mMaxExpandHeight=mPrivateLayout.getMaxHeight();
  if (updateExpandHeight) {
    applyExpansionToLayout();
  }
  mWasReset=false;
}
Program: 198557
Project: 198557
Buggy source:
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  mMaxExpandHeight=0;
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  mMaxExpandHeight=0;
  mWasReset=true;
  logExpansionEvent(false,wasExpanded);
}
Program: 198558
Project: 198558
Buggy source:
private void generateChildHierarchyEvents(){
  generateChildRemovalEvents();
  generateChildAdditionEvents();
  generatePositionChangeEvents();
  generateSnapBackEvents();
  generateDragEvents();
  generateTopPaddingEvent();
  generateActivateEvent();
  generateDimmedEvent();
  generateHideSensitiveEvent();
  generateDarkEvent();
  generateGoToFullShadeEvent();
  mNeedsAnimation=false;
}

Fixed version (ground truth):
private void generateChildHierarchyEvents(){
  generateChildRemovalEvents();
  generateChildAdditionEvents();
  generatePositionChangeEvents();
  generateSnapBackEvents();
  generateDragEvents();
  generateTopPaddingEvent();
  generateActivateEvent();
  generateDimmedEvent();
  generateHideSensitiveEvent();
  generateDarkEvent();
  generateGoToFullShadeEvent();
  generateViewResizeEvent();
  mNeedsAnimation=false;
}
Program: 198559
Project: 198559
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  float centerX=getWidth() / 2.0f;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    float width=child.getMeasuredWidth();
    float height=child.getMeasuredHeight();
    child.layout((int)(centerX - width / 2.0f),0,(int)(centerX + width / 2.0f),(int)height);
  }
  setMaxLayoutHeight(getHeight());
  updateContentHeight();
  clampScrollPosition();
  requestChildrenUpdate();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  float centerX=getWidth() / 2.0f;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    float width=child.getMeasuredWidth();
    float height=child.getMeasuredHeight();
    child.layout((int)(centerX - width / 2.0f),0,(int)(centerX + width / 2.0f),(int)height);
  }
  setMaxLayoutHeight(getHeight());
  updateContentHeight();
  clampScrollPosition();
  requestAnimationOnViewResize();
  requestChildrenUpdate();
}
Program: 198567
Project: 198567
Buggy source:
private void removeSessionStateLocked(IBinder sessionToken,int userId){
  UserState userState=getUserStateLocked(userId);
  if (sessionToken == userState.mainSessionToken) {
    userState.mainSessionToken=null;
  }
  SessionState sessionState=userState.sessionStateMap.remove(sessionToken);
  if (sessionState.mLogUri != null) {
    SomeArgs args=SomeArgs.obtain();
    args.arg1=sessionState.mLogUri;
    args.arg2=System.currentTimeMillis();
    mLogHandler.obtainMessage(LogHandler.MSG_CLOSE_ENTRY,args).sendToTarget();
  }
  ClientState clientState=userState.clientStateMap.get(sessionState.mClient.asBinder());
  if (clientState != null) {
    clientState.mSessionTokens.remove(sessionToken);
    if (clientState.isEmpty()) {
      userState.clientStateMap.remove(sessionState.mClient.asBinder());
    }
  }
  TvInputInfo info=sessionState.mInfo;
  if (info != null) {
    ServiceState serviceState=userState.serviceStateMap.get(info.getComponent());
    if (serviceState != null) {
      serviceState.mSessionTokens.remove(sessionToken);
    }
  }
  updateServiceConnectionLocked(sessionState.mInfo.getComponent(),userId);
}

Fixed version (ground truth):
private void removeSessionStateLocked(IBinder sessionToken,int userId){
  UserState userState=getUserStateLocked(userId);
  if (sessionToken == userState.mainSessionToken) {
    userState.mainSessionToken=null;
  }
  SessionState sessionState=userState.sessionStateMap.remove(sessionToken);
  if (sessionState == null) {
    return;
  }
  if (sessionState.mLogUri != null) {
    SomeArgs args=SomeArgs.obtain();
    args.arg1=sessionState.mLogUri;
    args.arg2=System.currentTimeMillis();
    mLogHandler.obtainMessage(LogHandler.MSG_CLOSE_ENTRY,args).sendToTarget();
  }
  ClientState clientState=userState.clientStateMap.get(sessionState.mClient.asBinder());
  if (clientState != null) {
    clientState.mSessionTokens.remove(sessionToken);
    if (clientState.isEmpty()) {
      userState.clientStateMap.remove(sessionState.mClient.asBinder());
    }
  }
  TvInputInfo info=sessionState.mInfo;
  if (info != null) {
    ServiceState serviceState=userState.serviceStateMap.get(info.getComponent());
    if (serviceState != null) {
      serviceState.mSessionTokens.remove(sessionToken);
    }
  }
  updateServiceConnectionLocked(sessionState.mInfo.getComponent(),userId);
}
Program: 198570
Project: 198570
Buggy source:
private void removeSessionStateLocked(IBinder sessionToken,int userId){
  UserState userState=getUserStateLocked(userId);
  if (sessionToken == userState.mainSessionToken) {
    userState.mainSessionToken=null;
  }
  SessionState sessionState=userState.sessionStateMap.remove(sessionToken);
  if (sessionState.mLogUri != null) {
    SomeArgs args=SomeArgs.obtain();
    args.arg1=sessionState.mLogUri;
    args.arg2=System.currentTimeMillis();
    mLogHandler.obtainMessage(LogHandler.MSG_CLOSE_ENTRY,args).sendToTarget();
  }
  ClientState clientState=userState.clientStateMap.get(sessionState.mClient.asBinder());
  if (clientState != null) {
    clientState.mSessionTokens.remove(sessionToken);
    if (clientState.isEmpty()) {
      userState.clientStateMap.remove(sessionState.mClient.asBinder());
    }
  }
  TvInputInfo info=sessionState.mInfo;
  if (info != null) {
    ServiceState serviceState=userState.serviceStateMap.get(info.getComponent());
    if (serviceState != null) {
      serviceState.mSessionTokens.remove(sessionToken);
    }
  }
  updateServiceConnectionLocked(sessionState.mInfo.getComponent(),userId);
}

Fixed version (ground truth):
private void removeSessionStateLocked(IBinder sessionToken,int userId){
  UserState userState=getUserStateLocked(userId);
  if (sessionToken == userState.mainSessionToken) {
    userState.mainSessionToken=null;
  }
  SessionState sessionState=userState.sessionStateMap.remove(sessionToken);
  if (sessionState == null) {
    return;
  }
  if (sessionState.mLogUri != null) {
    SomeArgs args=SomeArgs.obtain();
    args.arg1=sessionState.mLogUri;
    args.arg2=System.currentTimeMillis();
    mLogHandler.obtainMessage(LogHandler.MSG_CLOSE_ENTRY,args).sendToTarget();
  }
  ClientState clientState=userState.clientStateMap.get(sessionState.mClient.asBinder());
  if (clientState != null) {
    clientState.mSessionTokens.remove(sessionToken);
    if (clientState.isEmpty()) {
      userState.clientStateMap.remove(sessionState.mClient.asBinder());
    }
  }
  TvInputInfo info=sessionState.mInfo;
  if (info != null) {
    ServiceState serviceState=userState.serviceStateMap.get(info.getComponent());
    if (serviceState != null) {
      serviceState.mSessionTokens.remove(sessionToken);
    }
  }
  updateServiceConnectionLocked(sessionState.mInfo.getComponent(),userId);
}
Program: 198576
Project: 198576
Buggy source:
private void removeSessionStateLocked(IBinder sessionToken,int userId){
  UserState userState=getUserStateLocked(userId);
  if (sessionToken == userState.mainSessionToken) {
    userState.mainSessionToken=null;
  }
  SessionState sessionState=userState.sessionStateMap.remove(sessionToken);
  if (sessionState.mLogUri != null) {
    SomeArgs args=SomeArgs.obtain();
    args.arg1=sessionState.mLogUri;
    args.arg2=System.currentTimeMillis();
    mLogHandler.obtainMessage(LogHandler.MSG_CLOSE_ENTRY,args).sendToTarget();
  }
  ClientState clientState=userState.clientStateMap.get(sessionState.mClient.asBinder());
  if (clientState != null) {
    clientState.mSessionTokens.remove(sessionToken);
    if (clientState.isEmpty()) {
      userState.clientStateMap.remove(sessionState.mClient.asBinder());
    }
  }
  TvInputInfo info=sessionState.mInfo;
  if (info != null) {
    ServiceState serviceState=userState.serviceStateMap.get(info.getComponent());
    if (serviceState != null) {
      serviceState.mSessionTokens.remove(sessionToken);
    }
  }
  updateServiceConnectionLocked(sessionState.mInfo.getComponent(),userId);
}

Fixed version (ground truth):
private void removeSessionStateLocked(IBinder sessionToken,int userId){
  UserState userState=getUserStateLocked(userId);
  if (sessionToken == userState.mainSessionToken) {
    userState.mainSessionToken=null;
  }
  SessionState sessionState=userState.sessionStateMap.remove(sessionToken);
  if (sessionState == null) {
    return;
  }
  if (sessionState.mLogUri != null) {
    SomeArgs args=SomeArgs.obtain();
    args.arg1=sessionState.mLogUri;
    args.arg2=System.currentTimeMillis();
    mLogHandler.obtainMessage(LogHandler.MSG_CLOSE_ENTRY,args).sendToTarget();
  }
  ClientState clientState=userState.clientStateMap.get(sessionState.mClient.asBinder());
  if (clientState != null) {
    clientState.mSessionTokens.remove(sessionToken);
    if (clientState.isEmpty()) {
      userState.clientStateMap.remove(sessionState.mClient.asBinder());
    }
  }
  TvInputInfo info=sessionState.mInfo;
  if (info != null) {
    ServiceState serviceState=userState.serviceStateMap.get(info.getComponent());
    if (serviceState != null) {
      serviceState.mSessionTokens.remove(sessionToken);
    }
  }
  updateServiceConnectionLocked(sessionState.mInfo.getComponent(),userId);
}
Program: 198585
Project: 198585
Buggy source:
boolean reset(){
  if (mTimer.reset(true)) {
    mTimer=null;
    return true;
  }
  return false;
}

Fixed version (ground truth):
void reset(){
  mUserTime=mSystemTime=mForegroundTime=0;
  mStarts=0;
  mLoadedUserTime=mLoadedSystemTime=mLoadedForegroundTime=0;
  mLoadedStarts=0;
  mLastUserTime=mLastSystemTime=mLastForegroundTime=0;
  mLastStarts=0;
  mUnpluggedUserTime=mUnpluggedSystemTime=mUnpluggedForegroundTime=0;
  mUnpluggedStarts=0;
  for (int i=0; i < mSpeedBins.length; i++) {
    SamplingCounter c=mSpeedBins[i];
    if (c != null) {
      c.reset(false);
    }
  }
  mExcessivePower=null;
}
Program: 198586
Project: 198586
Buggy source:
Proc(){
  mOnBatteryTimeBase.add(this);
  mSpeedBins=new SamplingCounter[getCpuSpeedSteps()];
}

Fixed version (ground truth):
Proc(String name){
  mName=name;
  mOnBatteryTimeBase.add(this);
  mSpeedBins=new SamplingCounter[getCpuSpeedSteps()];
}
Program: 198590
Project: 198590
Buggy source:
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=BatteryStatsHelper.readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  if (mHistoryBuffer.dataPosition() > 0) {
    mRecordingHistory=true;
    final long elapsedRealtime=SystemClock.elapsedRealtime();
    final long uptime=SystemClock.uptimeMillis();
    if (USE_OLD_HISTORY) {
      addHistoryRecordLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    }
    addHistoryBufferLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    startRecordingHistory(elapsedRealtime,uptime,false);
  }
}

Fixed version (ground truth):
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=BatteryStatsHelper.readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  mEndPlatformVersion=Build.ID;
  if (mHistoryBuffer.dataPosition() > 0) {
    mRecordingHistory=true;
    final long elapsedRealtime=SystemClock.elapsedRealtime();
    final long uptime=SystemClock.uptimeMillis();
    if (USE_OLD_HISTORY) {
      addHistoryRecordLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    }
    addHistoryBufferLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    startRecordingHistory(elapsedRealtime,uptime,false);
  }
}
Program: 198595
Project: 198595
Buggy source:
boolean reset(){
  if (mTimer.reset(true)) {
    mTimer=null;
    return true;
  }
  return false;
}

Fixed version (ground truth):
void reset(){
  mUserTime=mSystemTime=mForegroundTime=0;
  mStarts=0;
  mLoadedUserTime=mLoadedSystemTime=mLoadedForegroundTime=0;
  mLoadedStarts=0;
  mLastUserTime=mLastSystemTime=mLastForegroundTime=0;
  mLastStarts=0;
  mUnpluggedUserTime=mUnpluggedSystemTime=mUnpluggedForegroundTime=0;
  mUnpluggedStarts=0;
  for (int i=0; i < mSpeedBins.length; i++) {
    SamplingCounter c=mSpeedBins[i];
    if (c != null) {
      c.reset(false);
    }
  }
  mExcessivePower=null;
}
Program: 198596
Project: 198596
Buggy source:
Proc(){
  mOnBatteryTimeBase.add(this);
  mSpeedBins=new SamplingCounter[getCpuSpeedSteps()];
}

Fixed version (ground truth):
Proc(String name){
  mName=name;
  mOnBatteryTimeBase.add(this);
  mSpeedBins=new SamplingCounter[getCpuSpeedSteps()];
}
Program: 198600
Project: 198600
Buggy source:
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=BatteryStatsHelper.readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  if (mHistoryBuffer.dataPosition() > 0) {
    mRecordingHistory=true;
    final long elapsedRealtime=SystemClock.elapsedRealtime();
    final long uptime=SystemClock.uptimeMillis();
    if (USE_OLD_HISTORY) {
      addHistoryRecordLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    }
    addHistoryBufferLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    startRecordingHistory(elapsedRealtime,uptime,false);
  }
}

Fixed version (ground truth):
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=BatteryStatsHelper.readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  mEndPlatformVersion=Build.ID;
  if (mHistoryBuffer.dataPosition() > 0) {
    mRecordingHistory=true;
    final long elapsedRealtime=SystemClock.elapsedRealtime();
    final long uptime=SystemClock.uptimeMillis();
    if (USE_OLD_HISTORY) {
      addHistoryRecordLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    }
    addHistoryBufferLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    startRecordingHistory(elapsedRealtime,uptime,false);
  }
}
Program: 198605
Project: 198605
Buggy source:
boolean reset(){
  if (mTimer.reset(true)) {
    mTimer=null;
    return true;
  }
  return false;
}

Fixed version (ground truth):
void reset(){
  mUserTime=mSystemTime=mForegroundTime=0;
  mStarts=0;
  mLoadedUserTime=mLoadedSystemTime=mLoadedForegroundTime=0;
  mLoadedStarts=0;
  mLastUserTime=mLastSystemTime=mLastForegroundTime=0;
  mLastStarts=0;
  mUnpluggedUserTime=mUnpluggedSystemTime=mUnpluggedForegroundTime=0;
  mUnpluggedStarts=0;
  for (int i=0; i < mSpeedBins.length; i++) {
    SamplingCounter c=mSpeedBins[i];
    if (c != null) {
      c.reset(false);
    }
  }
  mExcessivePower=null;
}
Program: 198606
Project: 198606
Buggy source:
Proc(){
  mOnBatteryTimeBase.add(this);
  mSpeedBins=new SamplingCounter[getCpuSpeedSteps()];
}

Fixed version (ground truth):
Proc(String name){
  mName=name;
  mOnBatteryTimeBase.add(this);
  mSpeedBins=new SamplingCounter[getCpuSpeedSteps()];
}
Program: 198610
Project: 198610
Buggy source:
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=BatteryStatsHelper.readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  if (mHistoryBuffer.dataPosition() > 0) {
    mRecordingHistory=true;
    final long elapsedRealtime=SystemClock.elapsedRealtime();
    final long uptime=SystemClock.uptimeMillis();
    if (USE_OLD_HISTORY) {
      addHistoryRecordLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    }
    addHistoryBufferLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    startRecordingHistory(elapsedRealtime,uptime,false);
  }
}

Fixed version (ground truth):
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=BatteryStatsHelper.readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  mEndPlatformVersion=Build.ID;
  if (mHistoryBuffer.dataPosition() > 0) {
    mRecordingHistory=true;
    final long elapsedRealtime=SystemClock.elapsedRealtime();
    final long uptime=SystemClock.uptimeMillis();
    if (USE_OLD_HISTORY) {
      addHistoryRecordLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    }
    addHistoryBufferLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    startRecordingHistory(elapsedRealtime,uptime,false);
  }
}
Program: 198612
Project: 198612
Buggy source:
private void removeSessionStateLocked(IBinder sessionToken,int userId){
  UserState userState=getUserStateLocked(userId);
  if (sessionToken == userState.mainSessionToken) {
    userState.mainSessionToken=null;
  }
  SessionState sessionState=userState.sessionStateMap.remove(sessionToken);
  if (sessionState.mLogUri != null) {
    SomeArgs args=SomeArgs.obtain();
    args.arg1=sessionState.mLogUri;
    args.arg2=System.currentTimeMillis();
    mLogHandler.obtainMessage(LogHandler.MSG_CLOSE_ENTRY,args).sendToTarget();
  }
  ClientState clientState=userState.clientStateMap.get(sessionState.mClient.asBinder());
  if (clientState != null) {
    clientState.mSessionTokens.remove(sessionToken);
    if (clientState.isEmpty()) {
      userState.clientStateMap.remove(sessionState.mClient.asBinder());
    }
  }
  TvInputInfo info=sessionState.mInfo;
  if (info != null) {
    ServiceState serviceState=userState.serviceStateMap.get(info.getComponent());
    if (serviceState != null) {
      serviceState.mSessionTokens.remove(sessionToken);
    }
  }
  updateServiceConnectionLocked(sessionState.mInfo.getComponent(),userId);
}

Fixed version (ground truth):
private void removeSessionStateLocked(IBinder sessionToken,int userId){
  UserState userState=getUserStateLocked(userId);
  if (sessionToken == userState.mainSessionToken) {
    userState.mainSessionToken=null;
  }
  SessionState sessionState=userState.sessionStateMap.remove(sessionToken);
  if (sessionState == null) {
    return;
  }
  if (sessionState.mLogUri != null) {
    SomeArgs args=SomeArgs.obtain();
    args.arg1=sessionState.mLogUri;
    args.arg2=System.currentTimeMillis();
    mLogHandler.obtainMessage(LogHandler.MSG_CLOSE_ENTRY,args).sendToTarget();
  }
  ClientState clientState=userState.clientStateMap.get(sessionState.mClient.asBinder());
  if (clientState != null) {
    clientState.mSessionTokens.remove(sessionToken);
    if (clientState.isEmpty()) {
      userState.clientStateMap.remove(sessionState.mClient.asBinder());
    }
  }
  TvInputInfo info=sessionState.mInfo;
  if (info != null) {
    ServiceState serviceState=userState.serviceStateMap.get(info.getComponent());
    if (serviceState != null) {
      serviceState.mSessionTokens.remove(sessionToken);
    }
  }
  updateServiceConnectionLocked(sessionState.mInfo.getComponent(),userId);
}
Program: 198615
Project: 198615
Buggy source:
private void removeSessionStateLocked(IBinder sessionToken,int userId){
  UserState userState=getUserStateLocked(userId);
  if (sessionToken == userState.mainSessionToken) {
    userState.mainSessionToken=null;
  }
  SessionState sessionState=userState.sessionStateMap.remove(sessionToken);
  if (sessionState.mLogUri != null) {
    SomeArgs args=SomeArgs.obtain();
    args.arg1=sessionState.mLogUri;
    args.arg2=System.currentTimeMillis();
    mLogHandler.obtainMessage(LogHandler.MSG_CLOSE_ENTRY,args).sendToTarget();
  }
  ClientState clientState=userState.clientStateMap.get(sessionState.mClient.asBinder());
  if (clientState != null) {
    clientState.mSessionTokens.remove(sessionToken);
    if (clientState.isEmpty()) {
      userState.clientStateMap.remove(sessionState.mClient.asBinder());
    }
  }
  TvInputInfo info=sessionState.mInfo;
  if (info != null) {
    ServiceState serviceState=userState.serviceStateMap.get(info.getComponent());
    if (serviceState != null) {
      serviceState.mSessionTokens.remove(sessionToken);
    }
  }
  updateServiceConnectionLocked(sessionState.mInfo.getComponent(),userId);
}

Fixed version (ground truth):
private void removeSessionStateLocked(IBinder sessionToken,int userId){
  UserState userState=getUserStateLocked(userId);
  if (sessionToken == userState.mainSessionToken) {
    userState.mainSessionToken=null;
  }
  SessionState sessionState=userState.sessionStateMap.remove(sessionToken);
  if (sessionState == null) {
    return;
  }
  if (sessionState.mLogUri != null) {
    SomeArgs args=SomeArgs.obtain();
    args.arg1=sessionState.mLogUri;
    args.arg2=System.currentTimeMillis();
    mLogHandler.obtainMessage(LogHandler.MSG_CLOSE_ENTRY,args).sendToTarget();
  }
  ClientState clientState=userState.clientStateMap.get(sessionState.mClient.asBinder());
  if (clientState != null) {
    clientState.mSessionTokens.remove(sessionToken);
    if (clientState.isEmpty()) {
      userState.clientStateMap.remove(sessionState.mClient.asBinder());
    }
  }
  TvInputInfo info=sessionState.mInfo;
  if (info != null) {
    ServiceState serviceState=userState.serviceStateMap.get(info.getComponent());
    if (serviceState != null) {
      serviceState.mSessionTokens.remove(sessionToken);
    }
  }
  updateServiceConnectionLocked(sessionState.mInfo.getComponent(),userId);
}
Program: 198621
Project: 198621
Buggy source:
boolean reset(){
  if (mTimer.reset(true)) {
    mTimer=null;
    return true;
  }
  return false;
}

Fixed version (ground truth):
void reset(){
  mUserTime=mSystemTime=mForegroundTime=0;
  mStarts=0;
  mLoadedUserTime=mLoadedSystemTime=mLoadedForegroundTime=0;
  mLoadedStarts=0;
  mLastUserTime=mLastSystemTime=mLastForegroundTime=0;
  mLastStarts=0;
  mUnpluggedUserTime=mUnpluggedSystemTime=mUnpluggedForegroundTime=0;
  mUnpluggedStarts=0;
  for (int i=0; i < mSpeedBins.length; i++) {
    SamplingCounter c=mSpeedBins[i];
    if (c != null) {
      c.reset(false);
    }
  }
  mExcessivePower=null;
}
Program: 198622
Project: 198622
Buggy source:
Proc(){
  mOnBatteryTimeBase.add(this);
  mSpeedBins=new SamplingCounter[getCpuSpeedSteps()];
}

Fixed version (ground truth):
Proc(String name){
  mName=name;
  mOnBatteryTimeBase.add(this);
  mSpeedBins=new SamplingCounter[getCpuSpeedSteps()];
}
Program: 198626
Project: 198626
Buggy source:
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=BatteryStatsHelper.readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  if (mHistoryBuffer.dataPosition() > 0) {
    mRecordingHistory=true;
    final long elapsedRealtime=SystemClock.elapsedRealtime();
    final long uptime=SystemClock.uptimeMillis();
    if (USE_OLD_HISTORY) {
      addHistoryRecordLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    }
    addHistoryBufferLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    startRecordingHistory(elapsedRealtime,uptime,false);
  }
}

Fixed version (ground truth):
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=BatteryStatsHelper.readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  mEndPlatformVersion=Build.ID;
  if (mHistoryBuffer.dataPosition() > 0) {
    mRecordingHistory=true;
    final long elapsedRealtime=SystemClock.elapsedRealtime();
    final long uptime=SystemClock.uptimeMillis();
    if (USE_OLD_HISTORY) {
      addHistoryRecordLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    }
    addHistoryBufferLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    startRecordingHistory(elapsedRealtime,uptime,false);
  }
}
Program: 198631
Project: 198631
Buggy source:
boolean reset(){
  if (mTimer.reset(true)) {
    mTimer=null;
    return true;
  }
  return false;
}

Fixed version (ground truth):
void reset(){
  mUserTime=mSystemTime=mForegroundTime=0;
  mStarts=0;
  mLoadedUserTime=mLoadedSystemTime=mLoadedForegroundTime=0;
  mLoadedStarts=0;
  mLastUserTime=mLastSystemTime=mLastForegroundTime=0;
  mLastStarts=0;
  mUnpluggedUserTime=mUnpluggedSystemTime=mUnpluggedForegroundTime=0;
  mUnpluggedStarts=0;
  for (int i=0; i < mSpeedBins.length; i++) {
    SamplingCounter c=mSpeedBins[i];
    if (c != null) {
      c.reset(false);
    }
  }
  mExcessivePower=null;
}
Program: 198632
Project: 198632
Buggy source:
Proc(){
  mOnBatteryTimeBase.add(this);
  mSpeedBins=new SamplingCounter[getCpuSpeedSteps()];
}

Fixed version (ground truth):
Proc(String name){
  mName=name;
  mOnBatteryTimeBase.add(this);
  mSpeedBins=new SamplingCounter[getCpuSpeedSteps()];
}
Program: 198636
Project: 198636
Buggy source:
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=BatteryStatsHelper.readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  if (mHistoryBuffer.dataPosition() > 0) {
    mRecordingHistory=true;
    final long elapsedRealtime=SystemClock.elapsedRealtime();
    final long uptime=SystemClock.uptimeMillis();
    if (USE_OLD_HISTORY) {
      addHistoryRecordLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    }
    addHistoryBufferLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    startRecordingHistory(elapsedRealtime,uptime,false);
  }
}

Fixed version (ground truth):
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=BatteryStatsHelper.readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  mEndPlatformVersion=Build.ID;
  if (mHistoryBuffer.dataPosition() > 0) {
    mRecordingHistory=true;
    final long elapsedRealtime=SystemClock.elapsedRealtime();
    final long uptime=SystemClock.uptimeMillis();
    if (USE_OLD_HISTORY) {
      addHistoryRecordLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    }
    addHistoryBufferLocked(elapsedRealtime,uptime,HistoryItem.CMD_START,mHistoryCur);
    startRecordingHistory(elapsedRealtime,uptime,false);
  }
}
Program: 198638
Project: 198638
Buggy source:
private ValueAnimator getAnimatorToRadius(float circleRadius){
  ValueAnimator animator=ValueAnimator.ofFloat(mCircleRadius,circleRadius);
  mCircleAnimator=animator;
  mCircleStartValue=mCircleRadius;
  mCircleWillBeHidden=circleRadius == 0.0f;
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      mCircleRadius=(float)animation.getAnimatedValue();
      invalidate();
    }
  }
);
  animator.addListener(mCircleEndListener);
  return animator;
}

Fixed version (ground truth):
private ValueAnimator getAnimatorToRadius(float circleRadius){
  ValueAnimator animator=ValueAnimator.ofFloat(mCircleRadius,circleRadius);
  mCircleAnimator=animator;
  mCircleStartValue=mCircleRadius;
  mCircleWillBeHidden=circleRadius == 0.0f;
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      mCircleRadius=(float)animation.getAnimatedValue();
      updateIconColor();
      invalidate();
    }
  }
);
  animator.addListener(mCircleEndListener);
  return animator;
}
Program: 198639
Project: 198639
Buggy source:
@Override protected void onDraw(Canvas canvas){
  drawBackgroundCircle(canvas);
  drawArrow(canvas);
  canvas.save();
  updateIconColor();
  canvas.scale(mImageScale,mImageScale,getWidth() / 2,getHeight() / 2);
  super.onDraw(canvas);
  canvas.restore();
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  drawBackgroundCircle(canvas);
  drawArrow(canvas);
  canvas.save();
  canvas.scale(mImageScale,mImageScale,getWidth() / 2,getHeight() / 2);
  super.onDraw(canvas);
  canvas.restore();
}
Program: 198641
Project: 198641
Buggy source:
private ValueAnimator getAnimatorToRadius(float circleRadius){
  ValueAnimator animator=ValueAnimator.ofFloat(mCircleRadius,circleRadius);
  mCircleAnimator=animator;
  mCircleStartValue=mCircleRadius;
  mCircleWillBeHidden=circleRadius == 0.0f;
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      mCircleRadius=(float)animation.getAnimatedValue();
      invalidate();
    }
  }
);
  animator.addListener(mCircleEndListener);
  return animator;
}

Fixed version (ground truth):
private ValueAnimator getAnimatorToRadius(float circleRadius){
  ValueAnimator animator=ValueAnimator.ofFloat(mCircleRadius,circleRadius);
  mCircleAnimator=animator;
  mCircleStartValue=mCircleRadius;
  mCircleWillBeHidden=circleRadius == 0.0f;
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      mCircleRadius=(float)animation.getAnimatedValue();
      updateIconColor();
      invalidate();
    }
  }
);
  animator.addListener(mCircleEndListener);
  return animator;
}
Program: 198642
Project: 198642
Buggy source:
@Override protected void onDraw(Canvas canvas){
  drawBackgroundCircle(canvas);
  drawArrow(canvas);
  canvas.save();
  updateIconColor();
  canvas.scale(mImageScale,mImageScale,getWidth() / 2,getHeight() / 2);
  super.onDraw(canvas);
  canvas.restore();
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  drawBackgroundCircle(canvas);
  drawArrow(canvas);
  canvas.save();
  canvas.scale(mImageScale,mImageScale,getWidth() / 2,getHeight() / 2);
  super.onDraw(canvas);
  canvas.restore();
}