Program: 106138
Project: 106138
Buggy source:
@Override public void buildACLViewSearchBuilder(SearchBuilder<? extends ControlledViewEntity> sb,Long domainId,boolean isRecursive,List<Long> permittedAccounts,ListProjectResourcesCriteria listProjectResourcesCriteria,List<Long> grantedIds,List<Long> revokedIds){
  sb.and().op("String_Node_Str",sb.entity().getAccountId(),SearchCriteria.Op.IN);
  sb.and("String_Node_Str",sb.entity().getDomainId(),SearchCriteria.Op.EQ);
  if (((permittedAccounts.isEmpty()) && (domainId != null) && isRecursive)) {
    sb.and("String_Node_Str",sb.entity().getDomainPath(),SearchCriteria.Op.LIKE);
  }
  if (listProjectResourcesCriteria != null) {
    if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.ListProjectResourcesOnly) {
      sb.and("String_Node_Str",sb.entity().getAccountType(),SearchCriteria.Op.EQ);
    }
 else     if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.SkipProjectResources) {
      sb.and("String_Node_Str",sb.entity().getAccountType(),SearchCriteria.Op.NEQ);
    }
  }
  if (!grantedIds.isEmpty()) {
    sb.or("String_Node_Str",sb.entity().getId(),SearchCriteria.Op.IN);
  }
  sb.cp();
  if (!revokedIds.isEmpty()) {
    sb.and("String_Node_Str",sb.entity().getId(),SearchCriteria.Op.NIN);
  }
}

Fixed version (ground truth):
@Override public void buildACLViewSearchBuilder(SearchBuilder<? extends ControlledViewEntity> sb,Long domainId,boolean isRecursive,List<Long> permittedAccounts,ListProjectResourcesCriteria listProjectResourcesCriteria,List<Long> grantedIds,List<Long> revokedIds){
  if (!revokedIds.isEmpty()) {
    sb.and("String_Node_Str",sb.entity().getId(),SearchCriteria.Op.NIN);
  }
  if (permittedAccounts.isEmpty() && domainId == null && listProjectResourcesCriteria == null) {
    return;
  }
  boolean hasOp=true;
  if (!permittedAccounts.isEmpty()) {
    sb.and().op("String_Node_Str",sb.entity().getAccountId(),SearchCriteria.Op.IN);
  }
 else   if (domainId != null) {
    if (isRecursive) {
      sb.and().op("String_Node_Str",sb.entity().getDomainPath(),SearchCriteria.Op.LIKE);
    }
 else {
      sb.and().op("String_Node_Str",sb.entity().getDomainId(),SearchCriteria.Op.EQ);
    }
  }
 else {
    hasOp=false;
  }
  if (listProjectResourcesCriteria != null) {
    if (hasOp) {
      if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.ListProjectResourcesOnly) {
        sb.and("String_Node_Str",sb.entity().getAccountType(),SearchCriteria.Op.EQ);
      }
 else       if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.SkipProjectResources) {
        sb.and("String_Node_Str",sb.entity().getAccountType(),SearchCriteria.Op.NEQ);
      }
    }
 else {
      if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.ListProjectResourcesOnly) {
        sb.and().op("String_Node_Str",sb.entity().getAccountType(),SearchCriteria.Op.EQ);
      }
 else       if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.SkipProjectResources) {
        sb.and().op("String_Node_Str",sb.entity().getAccountType(),SearchCriteria.Op.NEQ);
      }
    }
  }
  if (!grantedIds.isEmpty()) {
    sb.or("String_Node_Str",sb.entity().getId(),SearchCriteria.Op.IN);
  }
  sb.cp();
}