Program: 2144
Project: 2144
Buggy source:
/** 
 * The cache keeps track of   {@link AccessibilityEvent}s and invalidates cached nodes as appropriate.
 * @param event An event.
 */
public void onAccessibilityEvent(AccessibilityEvent event){
  if (ENABLED) {
    final int eventType=event.getEventType();
switch (eventType) {
case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
{
        mWindowId=event.getWindowId();
        clear();
      }
    break;
case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER:
case AccessibilityEvent.TYPE_VIEW_HOVER_EXIT:
{
    final int windowId=event.getWindowId();
    if (mWindowId != windowId) {
      mWindowId=windowId;
      clear();
    }
  }
break;
case AccessibilityEvent.TYPE_VIEW_FOCUSED:
case AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED:
case AccessibilityEvent.TYPE_VIEW_SELECTED:
case AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED:
case AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED:
{
synchronized (mLock) {
  final long sourceId=event.getSourceNodeId();
  clearSubTreeLocked(sourceId);
  if (eventType == AccessibilityEvent.TYPE_VIEW_FOCUSED) {
    clearSubtreeWithOldInputFocusLocked(sourceId);
  }
  if (eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED) {
    clearSubtreeWithOldAccessibilityFocusLocked(sourceId);
  }
}
}
break;
case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED:
case AccessibilityEvent.TYPE_VIEW_SCROLLED:
{
synchronized (mLock) {
final long accessibilityNodeId=event.getSourceNodeId();
clearSubTreeLocked(accessibilityNodeId);
}
}
break;
}
if (Build.IS_DEBUGGABLE && CHECK_INTEGRITY) {
checkIntegrity();
}
}
}

Fixed version (ground truth):
/** 
 * The cache keeps track of   {@link AccessibilityEvent}s and invalidates cached nodes as appropriate.
 * @param event An event.
 */
public void onAccessibilityEvent(AccessibilityEvent event){
  if (ENABLED) {
    final int eventType=event.getEventType();
switch (eventType) {
case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
{
        mWindowId=event.getWindowId();
        clear();
      }
    break;
case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER:
case AccessibilityEvent.TYPE_VIEW_HOVER_EXIT:
{
    final int windowId=event.getWindowId();
    if (mWindowId != windowId) {
      mWindowId=windowId;
      clear();
    }
  }
break;
case AccessibilityEvent.TYPE_VIEW_FOCUSED:
case AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED:
case AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED:
case AccessibilityEvent.TYPE_VIEW_SELECTED:
case AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED:
case AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED:
{
synchronized (mLock) {
  final long sourceId=event.getSourceNodeId();
  clearSubTreeLocked(sourceId);
  if (eventType == AccessibilityEvent.TYPE_VIEW_FOCUSED) {
    clearSubtreeWithOldInputFocusLocked(sourceId);
  }
  if (eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED) {
    clearSubtreeWithOldAccessibilityFocusLocked(sourceId);
  }
}
}
break;
case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED:
case AccessibilityEvent.TYPE_VIEW_SCROLLED:
{
synchronized (mLock) {
final long accessibilityNodeId=event.getSourceNodeId();
clearSubTreeLocked(accessibilityNodeId);
}
}
break;
}
if (Build.IS_DEBUGGABLE && CHECK_INTEGRITY) {
checkIntegrity();
}
}
}