Program: 166950
Project: 166950
Buggy source:
/** 
 * verify the "has" containers we have are valid with the schema table tree given
 * @param schemaTableTree
 * @return true if any has container does NOT match, false if everything is fine
 */
private boolean invalidateByHas(SchemaTableTree schemaTableTree){
  for (  HasContainer hasContainer : schemaTableTree.hasContainers) {
    if (!hasContainer.getKey().equals(TopologyStrategy.TOPOLOGY_SELECTION_WITHOUT) && !hasContainer.getKey().equals(TopologyStrategy.TOPOLOGY_SELECTION_FROM)) {
      if (hasContainer.getKey().equals(label.getAccessor())) {
        SchemaTable hasContainerLabelSchemaTable;
        SchemaTable predicateSchemaTable=SchemaTable.from(sqlgGraph,hasContainer.getValue().toString());
        if (schemaTableTree.getSchemaTable().getTable().startsWith(SchemaManager.VERTEX_PREFIX)) {
          hasContainerLabelSchemaTable=SchemaTable.of(predicateSchemaTable.getSchema(),SchemaManager.VERTEX_PREFIX + predicateSchemaTable.getTable());
        }
 else {
          hasContainerLabelSchemaTable=SchemaTable.of(predicateSchemaTable.getSchema(),SchemaManager.EDGE_PREFIX + predicateSchemaTable.getTable());
        }
        if (hasContainer.getBiPredicate().equals(Compare.eq) && !hasContainerLabelSchemaTable.toString().equals(schemaTableTree.getSchemaTable().toString())) {
          return true;
        }
      }
 else       if (!hasContainer.getKey().equals(T.id.getAccessor())) {
        if (hasContainer.getBiPredicate() instanceof FullText && ((FullText)hasContainer.getBiPredicate()).getQuery() != null) {
          return false;
        }
        if (!this.getFilteredAllTables().get(schemaTableTree.getSchemaTable().toString()).containsKey(hasContainer.getKey())) {
          return true;
        }
        if (hasEmptyWithin(hasContainer)) {
          return true;
        }
      }
 else       if (hasEmptyWithin(hasContainer)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * verify the "has" containers we have are valid with the schema table tree given
 * @param schemaTableTree
 * @return true if any has container does NOT match, false if everything is fine
 */
private boolean invalidateByHas(SchemaTableTree schemaTableTree){
  for (  HasContainer hasContainer : schemaTableTree.hasContainers) {
    if (!hasContainer.getKey().equals(TopologyStrategy.TOPOLOGY_SELECTION_WITHOUT) && !hasContainer.getKey().equals(TopologyStrategy.TOPOLOGY_SELECTION_FROM)) {
      if (hasContainer.getKey().equals(label.getAccessor())) {
        SchemaTable predicateSchemaTable=SchemaTable.from(sqlgGraph,hasContainer.getValue().toString());
        SchemaTable hasContainerLabelSchemaTable=getHasContainerSchemaTable(schemaTableTree,predicateSchemaTable);
        if (hasContainer.getBiPredicate().equals(Compare.eq) && !hasContainerLabelSchemaTable.toString().equals(schemaTableTree.getSchemaTable().toString())) {
          return true;
        }
      }
 else       if (hasContainer.getKey().equals(T.id.getAccessor())) {
        if (hasContainer.getBiPredicate().equals(Compare.eq)) {
          Object value=hasContainer.getValue();
          SchemaTable hasContainerLabelSchemaTable=getIDContainerSchemaTable(schemaTableTree,value);
          if (!hasContainerLabelSchemaTable.equals(schemaTableTree.getSchemaTable())) {
            return true;
          }
        }
 else         if (hasContainer.getBiPredicate().equals(Contains.within)) {
          Collection<?> c=(Collection<?>)hasContainer.getPredicate().getValue();
          Iterator<?> it=c.iterator();
          Collection<Object> ok=new LinkedList<>();
          while (it.hasNext()) {
            Object value=it.next();
            SchemaTable hasContainerLabelSchemaTable=getIDContainerSchemaTable(schemaTableTree,value);
            if (hasContainerLabelSchemaTable.equals(schemaTableTree.getSchemaTable())) {
              ok.add(value);
            }
          }
          if (ok.isEmpty()) {
            return true;
          }
          ((P<Collection<Object>>)(hasContainer.getPredicate())).setValue(ok);
        }
      }
 else {
        if (hasContainer.getBiPredicate() instanceof FullText && ((FullText)hasContainer.getBiPredicate()).getQuery() != null) {
          return false;
        }
        if (!this.getFilteredAllTables().get(schemaTableTree.getSchemaTable().toString()).containsKey(hasContainer.getKey())) {
          return true;
        }
        if (hasEmptyWithin(hasContainer)) {
          return true;
        }
      }
    }
  }
  return false;
}