Program: 2032
Project: 2032
Buggy source:
@Override public void computeFrameLw(Rect pf,Rect df,Rect of,Rect cf,Rect vf){
  mHaveFrame=true;
  final Rect container=mContainingFrame;
  container.set(pf);
  final Rect display=mDisplayFrame;
  display.set(df);
  final int pw=container.right - container.left;
  final int ph=container.bottom - container.top;
  int w, h;
  if ((mAttrs.flags & WindowManager.LayoutParams.FLAG_SCALED) != 0) {
    if (mAttrs.width < 0) {
      w=pw;
    }
 else     if (mEnforceSizeCompat) {
      w=(int)(mAttrs.width * mGlobalScale + .5f);
    }
 else {
      w=mAttrs.width;
    }
    if (mAttrs.height < 0) {
      h=ph;
    }
 else     if (mEnforceSizeCompat) {
      h=(int)(mAttrs.height * mGlobalScale + .5f);
    }
 else {
      h=mAttrs.height;
    }
  }
 else {
    if (mAttrs.width == WindowManager.LayoutParams.MATCH_PARENT) {
      w=pw;
    }
 else     if (mEnforceSizeCompat) {
      w=(int)(mRequestedWidth * mGlobalScale + .5f);
    }
 else {
      w=mRequestedWidth;
    }
    if (mAttrs.height == WindowManager.LayoutParams.MATCH_PARENT) {
      h=ph;
    }
 else     if (mEnforceSizeCompat) {
      h=(int)(mRequestedHeight * mGlobalScale + .5f);
    }
 else {
      h=mRequestedHeight;
    }
  }
  if (!mParentFrame.equals(pf)) {
    mParentFrame.set(pf);
    mContentChanged=true;
  }
  if (mRequestedWidth != mLastRequestedWidth || mRequestedHeight != mLastRequestedHeight) {
    mLastRequestedWidth=mRequestedWidth;
    mLastRequestedHeight=mRequestedHeight;
    mContentChanged=true;
  }
  final Rect overscan=mOverscanFrame;
  overscan.set(of);
  final Rect content=mContentFrame;
  content.set(cf);
  final Rect visible=mVisibleFrame;
  visible.set(vf);
  final Rect frame=mFrame;
  final int fw=frame.width();
  final int fh=frame.height();
  float x, y;
  if (mEnforceSizeCompat) {
    x=mAttrs.x * mGlobalScale;
    y=mAttrs.y * mGlobalScale;
  }
 else {
    x=mAttrs.x;
    y=mAttrs.y;
  }
  Gravity.apply(mAttrs.gravity,w,h,container,(int)(x + mAttrs.horizontalMargin * pw),(int)(y + mAttrs.verticalMargin * ph),frame);
  Gravity.applyDisplay(mAttrs.gravity,df,frame);
  if (content.left < frame.left)   content.left=frame.left;
  if (content.top < frame.top)   content.top=frame.top;
  if (content.right > frame.right)   content.right=frame.right;
  if (content.bottom > frame.bottom)   content.bottom=frame.bottom;
  if (visible.left < frame.left)   visible.left=frame.left;
  if (visible.top < frame.top)   visible.top=frame.top;
  if (visible.right > frame.right)   visible.right=frame.right;
  if (visible.bottom > frame.bottom)   visible.bottom=frame.bottom;
  final Rect overscanInsets=mOverscanInsets;
  overscanInsets.left=overscan.left - frame.left;
  overscanInsets.top=overscan.top - frame.top;
  overscanInsets.right=frame.right - overscan.right;
  overscanInsets.bottom=frame.bottom - overscan.bottom;
  final Rect contentInsets=mContentInsets;
  contentInsets.left=content.left - frame.left;
  contentInsets.top=content.top - frame.top;
  contentInsets.right=frame.right - content.right;
  contentInsets.bottom=frame.bottom - content.bottom;
  final Rect visibleInsets=mVisibleInsets;
  visibleInsets.left=visible.left - frame.left;
  visibleInsets.top=visible.top - frame.top;
  visibleInsets.right=frame.right - visible.right;
  visibleInsets.bottom=frame.bottom - visible.bottom;
  mCompatFrame.set(frame);
  if (mEnforceSizeCompat) {
    overscanInsets.scale(mInvGlobalScale);
    contentInsets.scale(mInvGlobalScale);
    visibleInsets.scale(mInvGlobalScale);
    mCompatFrame.scale(mInvGlobalScale);
  }
  if (mIsWallpaper && (fw != frame.width() || fh != frame.height())) {
    final DisplayInfo displayInfo=mDisplayContent.getDisplayInfo();
    mService.updateWallpaperOffsetLocked(this,displayInfo.appWidth,displayInfo.appHeight,false);
  }
  if (WindowManagerService.localLOGV) {
    Slog.v(TAG,"String_Node_Str" + mRequestedWidth + "String_Node_Str"+ mRequestedHeight+ "String_Node_Str"+ "String_Node_Str"+ pw+ "String_Node_Str"+ ph+ "String_Node_Str"+ mFrame.toShortString()+ "String_Node_Str"+ contentInsets.toShortString()+ "String_Node_Str"+ visibleInsets.toShortString());
  }
}

Fixed version (ground truth):
@Override public void computeFrameLw(Rect pf,Rect df,Rect of,Rect cf,Rect vf){
  mHaveFrame=true;
  final Rect container=mContainingFrame;
  container.set(pf);
  final Rect display=mDisplayFrame;
  display.set(df);
  final int pw=container.right - container.left;
  final int ph=container.bottom - container.top;
  int w, h;
  if ((mAttrs.flags & WindowManager.LayoutParams.FLAG_SCALED) != 0) {
    if (mAttrs.width < 0) {
      w=pw;
    }
 else     if (mEnforceSizeCompat) {
      w=(int)(mAttrs.width * mGlobalScale + .5f);
    }
 else {
      w=mAttrs.width;
    }
    if (mAttrs.height < 0) {
      h=ph;
    }
 else     if (mEnforceSizeCompat) {
      h=(int)(mAttrs.height * mGlobalScale + .5f);
    }
 else {
      h=mAttrs.height;
    }
  }
 else {
    if (mAttrs.width == WindowManager.LayoutParams.MATCH_PARENT) {
      w=pw;
    }
 else     if (mEnforceSizeCompat) {
      w=(int)(mRequestedWidth * mGlobalScale + .5f);
    }
 else {
      w=mRequestedWidth;
    }
    if (mAttrs.height == WindowManager.LayoutParams.MATCH_PARENT) {
      h=ph;
    }
 else     if (mEnforceSizeCompat) {
      h=(int)(mRequestedHeight * mGlobalScale + .5f);
    }
 else {
      h=mRequestedHeight;
    }
  }
  if (!mParentFrame.equals(pf)) {
    mParentFrame.set(pf);
    mContentChanged=true;
  }
  if (mRequestedWidth != mLastRequestedWidth || mRequestedHeight != mLastRequestedHeight) {
    mLastRequestedWidth=mRequestedWidth;
    mLastRequestedHeight=mRequestedHeight;
    mContentChanged=true;
  }
  final Rect overscan=mOverscanFrame;
  overscan.set(of);
  final Rect content=mContentFrame;
  content.set(cf);
  final Rect visible=mVisibleFrame;
  visible.set(vf);
  final Rect frame=mFrame;
  final int fw=frame.width();
  final int fh=frame.height();
  float x, y;
  if (mEnforceSizeCompat) {
    x=mAttrs.x * mGlobalScale;
    y=mAttrs.y * mGlobalScale;
  }
 else {
    x=mAttrs.x;
    y=mAttrs.y;
  }
  Gravity.apply(mAttrs.gravity,w,h,container,(int)(x + mAttrs.horizontalMargin * pw),(int)(y + mAttrs.verticalMargin * ph),frame);
  Gravity.applyDisplay(mAttrs.gravity,df,frame);
  if (content.left < frame.left)   content.left=frame.left;
  if (content.top < frame.top)   content.top=frame.top;
  if (content.right > frame.right)   content.right=frame.right;
  if (content.bottom > frame.bottom)   content.bottom=frame.bottom;
  if (visible.left < frame.left)   visible.left=frame.left;
  if (visible.top < frame.top)   visible.top=frame.top;
  if (visible.right > frame.right)   visible.right=frame.right;
  if (visible.bottom > frame.bottom)   visible.bottom=frame.bottom;
  final Rect overscanInsets=mOverscanInsets;
  overscanInsets.left=overscan.left > frame.left ? overscan.left - frame.left : 0;
  overscanInsets.top=overscan.top > frame.top ? overscan.top - frame.top : 0;
  overscanInsets.right=overscan.right < frame.right ? frame.right - overscan.right : 0;
  overscanInsets.bottom=overscan.bottom < frame.bottom ? frame.bottom - overscan.bottom : 0;
  final Rect contentInsets=mContentInsets;
  contentInsets.left=content.left - frame.left;
  contentInsets.top=content.top - frame.top;
  contentInsets.right=frame.right - content.right;
  contentInsets.bottom=frame.bottom - content.bottom;
  final Rect visibleInsets=mVisibleInsets;
  visibleInsets.left=visible.left - frame.left;
  visibleInsets.top=visible.top - frame.top;
  visibleInsets.right=frame.right - visible.right;
  visibleInsets.bottom=frame.bottom - visible.bottom;
  mCompatFrame.set(frame);
  if (mEnforceSizeCompat) {
    overscanInsets.scale(mInvGlobalScale);
    contentInsets.scale(mInvGlobalScale);
    visibleInsets.scale(mInvGlobalScale);
    mCompatFrame.scale(mInvGlobalScale);
  }
  if (mIsWallpaper && (fw != frame.width() || fh != frame.height())) {
    final DisplayInfo displayInfo=mDisplayContent.getDisplayInfo();
    mService.updateWallpaperOffsetLocked(this,displayInfo.appWidth,displayInfo.appHeight,false);
  }
  if (WindowManagerService.localLOGV) {
    Slog.v(TAG,"String_Node_Str" + mRequestedWidth + "String_Node_Str"+ mRequestedHeight+ "String_Node_Str"+ "String_Node_Str"+ pw+ "String_Node_Str"+ ph+ "String_Node_Str"+ mFrame.toShortString()+ "String_Node_Str"+ contentInsets.toShortString()+ "String_Node_Str"+ visibleInsets.toShortString());
  }
}