Program: 113195
Project: 113195
Buggy source:
public WalkInfo buildTreeWalk(){
  WalkInfo info=new WalkInfo();
  info.fullSchema=resolveFullSchema();
  info.nativeFilter=resolveNativeFilter();
  info.requiredProperties=resolveRequiredProperties(info.nativeFilter);
  final ObjectId featureTypeId=typeRef.getMetadataId();
  final ObjectId oldFeatureTypeTree;
  final ObjectId newFeatureTypeTree;
  final ObjectStore treeSource;
{
    final String nativeTypeName=nativeSchema.getTypeName();
    final @Nullable GeometryDescriptor geometryAttribute=nativeSchema.getGeometryDescriptor();
    final Optional<Index> oldHeadIndex;
    final Optional<Index> headIndex;
    final Optional<NodeRef> oldCanonicalTree=resolveCanonicalTree(oldHeadRef,nativeTypeName);
    final Optional<NodeRef> newCanonicalTree=resolveCanonicalTree(headRef,nativeTypeName);
    final ObjectId oldCanonicalTreeId=oldCanonicalTree.isPresent() ? oldCanonicalTree.get().getObjectId() : RevTree.EMPTY_TREE_ID;
    final ObjectId newCanonicalTreeId=newCanonicalTree.isPresent() ? newCanonicalTree.get().getObjectId() : RevTree.EMPTY_TREE_ID;
    Optional<Index> indexes[];
    final boolean ignoreIndex=geometryAttribute == null || this.ignoreIndex || info.nativeFilter instanceof Id;
    if (ignoreIndex) {
      indexes=NO_INDEX;
    }
 else {
      indexes=resolveIndex(oldCanonicalTreeId,newCanonicalTreeId,nativeTypeName,geometryAttribute.getLocalName());
    }
    oldHeadIndex=indexes[0];
    headIndex=indexes[1];
    checkState(!(oldHeadIndex.isPresent() || headIndex.isPresent()) || headIndex.get().info().equals(oldHeadIndex.get().info()));
    if (oldHeadIndex.isPresent()) {
      oldFeatureTypeTree=oldHeadIndex.get().indexTreeId();
      newFeatureTypeTree=headIndex.get().indexTreeId();
    }
 else {
      oldFeatureTypeTree=oldCanonicalTreeId;
      newFeatureTypeTree=newCanonicalTreeId;
    }
    info.materializedIndexProperties=resolveMaterializedProperties(headIndex);
    PrePostFilterSplitter filterSplitter;
    filterSplitter=new PrePostFilterSplitter().extraAttributes(info.materializedIndexProperties).filter(info.nativeFilter).build();
    info.preFilter=filterSplitter.getPreFilter();
    info.postFilter=filterSplitter.getPostFilter();
    info.indexContainsAllRequiredProperties=info.materializedIndexProperties.containsAll(info.requiredProperties);
    info.filterIsFullySupportedByIndex=Filter.INCLUDE.equals(info.postFilter);
    treeSource=headIndex.isPresent() ? repo.indexDatabase() : repo.objectDatabase();
  }
  info.diffOp=repo.command(DiffTree.class);
  info.diffOp.setDefaultMetadataId(featureTypeId).setPreserveIterationOrder(shallPreserveIterationOrder()).setPathFilter(createFidFilter(info.nativeFilter)).setCustomFilter(createIndexPreFilter(info.preFilter,info.filterIsFullySupportedByIndex)).setBoundsFilter(createBoundsFilter(info.fullSchema,info.nativeFilter,newFeatureTypeTree,treeSource)).setChangeTypeFilter(resolveChangeType()).setOldTree(oldFeatureTypeTree).setNewTree(newFeatureTypeTree).setLeftSource(treeSource).setRightSource(treeSource).recordStats();
  return info;
}

Fixed version (ground truth):
public WalkInfo buildTreeWalk(){
  WalkInfo info=new WalkInfo();
  info.fullSchema=resolveFullSchema();
  info.nativeFilter=resolveNativeFilter();
  info.requiredProperties=resolveRequiredProperties(info.nativeFilter);
  final ObjectId featureTypeId=typeRef.getMetadataId();
  final ObjectId oldFeatureTypeTree;
  final ObjectId newFeatureTypeTree;
  final ObjectStore treeSource;
{
    final String nativeTypeName=nativeSchema.getTypeName();
    final @Nullable GeometryDescriptor geometryAttribute=nativeSchema.getGeometryDescriptor();
    final Optional<Index> oldHeadIndex;
    final Optional<Index> headIndex;
    final Optional<NodeRef> oldCanonicalTree=resolveCanonicalTree(oldHeadRef,nativeTypeName);
    final Optional<NodeRef> newCanonicalTree=resolveCanonicalTree(headRef,nativeTypeName);
    final ObjectId oldCanonicalTreeId=oldCanonicalTree.isPresent() ? oldCanonicalTree.get().getObjectId() : RevTree.EMPTY_TREE_ID;
    final ObjectId newCanonicalTreeId=newCanonicalTree.isPresent() ? newCanonicalTree.get().getObjectId() : RevTree.EMPTY_TREE_ID;
    Optional<Index> indexes[];
    final boolean ignoreIndex=geometryAttribute == null || this.ignoreIndex || info.nativeFilter instanceof Id;
    if (ignoreIndex) {
      indexes=NO_INDEX;
    }
 else {
      indexes=resolveIndex(oldCanonicalTreeId,newCanonicalTreeId,nativeTypeName,geometryAttribute.getLocalName());
    }
    oldHeadIndex=indexes[0];
    headIndex=indexes[1];
    checkState(!(oldHeadIndex.isPresent() || headIndex.isPresent()) || headIndex.get().info().equals(oldHeadIndex.get().info()));
    if (oldHeadIndex.isPresent()) {
      oldFeatureTypeTree=oldHeadIndex.get().indexTreeId();
      newFeatureTypeTree=headIndex.get().indexTreeId();
    }
 else {
      oldFeatureTypeTree=oldCanonicalTreeId;
      newFeatureTypeTree=newCanonicalTreeId;
    }
    info.materializedIndexProperties=resolveMaterializedProperties(headIndex);
    PrePostFilterSplitter filterSplitter;
    filterSplitter=new PrePostFilterSplitter().extraAttributes(info.materializedIndexProperties).filter(info.nativeFilter).build();
    info.preFilter=filterSplitter.getPreFilter();
    info.postFilter=filterSplitter.getPostFilter();
    info.indexContainsAllRequiredProperties=info.materializedIndexProperties.containsAll(info.requiredProperties);
    info.filterIsFullySupportedByIndex=Filter.INCLUDE.equals(info.postFilter);
    treeSource=headIndex.isPresent() ? repo.indexDatabase() : repo.objectDatabase();
  }
  info.diffOp=repo.command(DiffTree.class);
  info.diffOp.setDefaultMetadataId(featureTypeId).setPreserveIterationOrder(shallPreserveIterationOrder()).setPathFilter(createFidFilter(info.nativeFilter)).setCustomFilter(createIndexPreFilter(info.preFilter,info.filterIsFullySupportedByIndex)).setChangeTypeFilter(resolveChangeType()).setOldTree(oldFeatureTypeTree).setNewTree(newFeatureTypeTree).setLeftSource(treeSource).setRightSource(treeSource).recordStats();
  return info;
}