Program: 183157
Project: 183157
Buggy source:
void updateReportedVisibilityLocked(){
  if (appToken == null) {
    return;
  }
  int numInteresting=0;
  int numVisible=0;
  boolean nowGone=true;
  if (DEBUG_VISIBILITY)   Log.v(TAG,"String_Node_Str" + this);
  final int N=allAppWindows.size();
  for (int i=0; i < N; i++) {
    WindowState win=allAppWindows.get(i);
    if (win == startingWindow || win.mAppFreezing) {
      continue;
    }
    if (DEBUG_VISIBILITY) {
      Log.v(TAG,"String_Node_Str" + win + "String_Node_Str"+ win.isDisplayedLw()+ "String_Node_Str"+ win.isAnimating());
      if (!win.isDisplayedLw()) {
        Log.v(TAG,"String_Node_Str" + win.mSurface + "String_Node_Str"+ win.mPolicyVisibility+ "String_Node_Str"+ win.mDrawPending+ "String_Node_Str"+ win.mCommitDrawPending+ "String_Node_Str"+ win.mAttachedHidden+ "String_Node_Str"+ (win.mAppToken != null ? win.mAppToken.hiddenRequested : false)+ "String_Node_Str"+ win.mAnimating);
      }
    }
    numInteresting++;
    if (win.isDisplayedLw()) {
      if (!win.isAnimating()) {
        numVisible++;
      }
      nowGone=false;
    }
 else     if (win.isAnimating()) {
      nowGone=false;
    }
  }
  boolean nowVisible=numInteresting > 0 && numVisible >= numInteresting;
  if (DEBUG_VISIBILITY)   Log.v(TAG,"String_Node_Str" + this + "String_Node_Str"+ numInteresting+ "String_Node_Str"+ numVisible);
  if (nowVisible != reportedVisible) {
    if (DEBUG_VISIBILITY)     Log.v(TAG,"String_Node_Str" + this + "String_Node_Str"+ nowVisible);
    reportedVisible=nowVisible;
    Message m=mH.obtainMessage(H.REPORT_APPLICATION_TOKEN_WINDOWS,nowVisible ? 1 : 0,nowGone ? 1 : 0,this);
    mH.sendMessage(m);
  }
}

Fixed version (ground truth):
void updateReportedVisibilityLocked(){
  if (appToken == null) {
    return;
  }
  int numInteresting=0;
  int numVisible=0;
  boolean nowGone=true;
  if (DEBUG_VISIBILITY)   Log.v(TAG,"String_Node_Str" + this);
  final int N=allAppWindows.size();
  for (int i=0; i < N; i++) {
    WindowState win=allAppWindows.get(i);
    if (win == startingWindow || win.mAppFreezing) {
      continue;
    }
    if (DEBUG_VISIBILITY) {
      Log.v(TAG,"String_Node_Str" + win + "String_Node_Str"+ win.isDrawnLw()+ "String_Node_Str"+ win.isAnimating());
      if (!win.isDrawnLw()) {
        Log.v(TAG,"String_Node_Str" + win.mSurface + "String_Node_Str"+ win.mPolicyVisibility+ "String_Node_Str"+ win.mDrawPending+ "String_Node_Str"+ win.mCommitDrawPending+ "String_Node_Str"+ win.mAttachedHidden+ "String_Node_Str"+ (win.mAppToken != null ? win.mAppToken.hiddenRequested : false)+ "String_Node_Str"+ win.mAnimating);
      }
    }
    numInteresting++;
    if (win.isDrawnLw()) {
      if (!win.isAnimating()) {
        numVisible++;
      }
      nowGone=false;
    }
 else     if (win.isAnimating()) {
      nowGone=false;
    }
  }
  boolean nowVisible=numInteresting > 0 && numVisible >= numInteresting;
  if (DEBUG_VISIBILITY)   Log.v(TAG,"String_Node_Str" + this + "String_Node_Str"+ numInteresting+ "String_Node_Str"+ numVisible);
  if (nowVisible != reportedVisible) {
    if (DEBUG_VISIBILITY)     Log.v(TAG,"String_Node_Str" + this + "String_Node_Str"+ nowVisible);
    reportedVisible=nowVisible;
    Message m=mH.obtainMessage(H.REPORT_APPLICATION_TOKEN_WINDOWS,nowVisible ? 1 : 0,nowGone ? 1 : 0,this);
    mH.sendMessage(m);
  }
}