Program: 95822
Project: 95822
Buggy source:
/** 
 * Grows children of a single supported frequent patterns in a graph (checks time constraint).
 * @param graph graph
 * @param minEdgeId minimal edge id satisfying the branch constraint
 * @param parentPattern pattern to grow
 * @param parentEmbeddings all embeddings of the parent pattern
 * @param rightmostPath rightmost path of the parent pattern
 * @return map of child patterns and embeddings
 */
private PatternEmbeddingsMap growPattern(int[] graph,int minEdgeId,int[] parentPattern,int[][] parentEmbeddings,int[] rightmostPath){
  PatternEmbeddingsMap currentChildMap=PatternEmbeddingsMap.getEmptyOne();
  for (int m=0; m < parentEmbeddings.length / 2; m++) {
    int[] parentVertexIds=parentEmbeddings[2 * m];
    int[] parentEdgeIds=parentEmbeddings[2 * m + 1];
    int forwardsTime=graphUtils.getVertexCount(parentPattern);
    int rightmostTime=rightmostPath[0];
    for (int edgeId=minEdgeId; edgeId < graphUtils.getEdgeCount(graph); edgeId++) {
      if (!ArrayUtils.contains(parentEdgeIds,edgeId)) {
        int edgeFromId=graphUtils.getFromId(graph,edgeId);
        int fromTime=ArrayUtils.indexOf(parentVertexIds,edgeFromId);
        int edgeToId=graphUtils.getToId(graph,edgeId);
        int toTime=ArrayUtils.indexOf(parentVertexIds,edgeToId);
        if (fromTime == rightmostTime && toTime >= 0) {
          int[] childPattern=dfsCodeUtils.addExtension(parentPattern,fromTime,graphUtils.getFromLabel(graph,edgeId),getExtensionIsOutgoing(graph,edgeId,true),graphUtils.getEdgeLabel(graph,edgeId),toTime,graphUtils.getToLabel(graph,edgeId));
          int[] childVertexIds=parentVertexIds.clone();
          int[] childEdgeIds=ArrayUtils.add(parentEdgeIds,edgeId);
          currentChildMap.put(childPattern,childVertexIds,childEdgeIds);
        }
 else         if (toTime == rightmostTime && fromTime >= 0) {
          int[] childPattern=dfsCodeUtils.addExtension(parentPattern,toTime,graphUtils.getFromLabel(graph,edgeId),getExtensionIsOutgoing(graph,edgeId,false),graphUtils.getEdgeLabel(graph,edgeId),fromTime,graphUtils.getToLabel(graph,edgeId));
          int[] childVertexIds=parentVertexIds.clone();
          int[] childEdgeIds=ArrayUtils.add(parentEdgeIds,edgeId);
          currentChildMap.put(childPattern,childVertexIds,childEdgeIds);
        }
 else {
          for (          int rightmostPathTime : rightmostPath) {
            if (fromTime == rightmostPathTime && toTime < 0) {
              int[] childPattern=dfsCodeUtils.addExtension(parentPattern,fromTime,graphUtils.getFromLabel(graph,edgeId),getExtensionIsOutgoing(graph,edgeId,true),graphUtils.getEdgeLabel(graph,edgeId),forwardsTime,graphUtils.getToLabel(graph,edgeId));
              int[] childVertexIds=ArrayUtils.add(parentVertexIds,edgeToId);
              int[] childEdgeIds=ArrayUtils.add(parentEdgeIds,edgeId);
              currentChildMap.put(childPattern,childVertexIds,childEdgeIds);
              break;
            }
 else             if (toTime == rightmostPathTime && fromTime < 0) {
              int[] childPattern=dfsCodeUtils.addExtension(parentPattern,toTime,graphUtils.getToLabel(graph,edgeId),getExtensionIsOutgoing(graph,edgeId,false),graphUtils.getEdgeLabel(graph,edgeId),forwardsTime,graphUtils.getFromLabel(graph,edgeId));
              int[] childVertexIds=ArrayUtils.add(parentVertexIds,edgeFromId);
              int[] childEdgeIds=ArrayUtils.add(parentEdgeIds,edgeId);
              currentChildMap.put(childPattern,childVertexIds,childEdgeIds);
              break;
            }
          }
        }
      }
    }
  }
  return currentChildMap;
}

Fixed version (ground truth):
/** 
 * Grows children of a single supported frequent patterns in a graph (checks time constraint).
 * @param graph graph
 * @param minEdgeId minimal edge id satisfying the branch constraint
 * @param parentPattern pattern to grow
 * @param parentEmbeddings all embeddings of the parent pattern
 * @param rightmostPath rightmost path of the parent pattern
 * @return map of child patterns and embeddings
 */
private PatternEmbeddingsMap growPattern(int[] graph,int minEdgeId,int[] parentPattern,int[][] parentEmbeddings,int[] rightmostPath){
  PatternEmbeddingsMap currentChildMap=PatternEmbeddingsMap.getEmptyOne();
  for (int m=0; m < parentEmbeddings.length / 2; m++) {
    int[] parentVertexIds=parentEmbeddings[2 * m];
    int[] parentEdgeIds=parentEmbeddings[2 * m + 1];
    int forwardsTime=graphUtils.getVertexCount(parentPattern);
    int rightmostTime=rightmostPath[0];
    for (int edgeId=minEdgeId; edgeId < graphUtils.getEdgeCount(graph); edgeId++) {
      if (!ArrayUtils.contains(parentEdgeIds,edgeId)) {
        int edgeFromId=graphUtils.getFromId(graph,edgeId);
        int fromTime=ArrayUtils.indexOf(parentVertexIds,edgeFromId);
        int edgeToId=graphUtils.getToId(graph,edgeId);
        int toTime=ArrayUtils.indexOf(parentVertexIds,edgeToId);
        if (fromTime == rightmostTime && toTime >= 0) {
          int[] childPattern=dfsCodeUtils.addExtension(parentPattern,fromTime,graphUtils.getFromLabel(graph,edgeId),getExtensionIsOutgoing(graph,edgeId,true),graphUtils.getEdgeLabel(graph,edgeId),toTime,graphUtils.getToLabel(graph,edgeId));
          int[] childVertexIds=parentVertexIds.clone();
          int[] childEdgeIds=ArrayUtils.add(parentEdgeIds,edgeId);
          currentChildMap.put(childPattern,childVertexIds,childEdgeIds);
        }
 else         if (toTime == rightmostTime && fromTime >= 0) {
          int[] childPattern=dfsCodeUtils.addExtension(parentPattern,toTime,graphUtils.getToLabel(graph,edgeId),getExtensionIsOutgoing(graph,edgeId,false),graphUtils.getEdgeLabel(graph,edgeId),fromTime,graphUtils.getFromLabel(graph,edgeId));
          int[] childVertexIds=parentVertexIds.clone();
          int[] childEdgeIds=ArrayUtils.add(parentEdgeIds,edgeId);
          currentChildMap.put(childPattern,childVertexIds,childEdgeIds);
        }
 else {
          for (          int rightmostPathTime : rightmostPath) {
            if (fromTime == rightmostPathTime && toTime < 0) {
              int[] childPattern=dfsCodeUtils.addExtension(parentPattern,fromTime,graphUtils.getFromLabel(graph,edgeId),getExtensionIsOutgoing(graph,edgeId,true),graphUtils.getEdgeLabel(graph,edgeId),forwardsTime,graphUtils.getToLabel(graph,edgeId));
              int[] childVertexIds=ArrayUtils.add(parentVertexIds,edgeToId);
              int[] childEdgeIds=ArrayUtils.add(parentEdgeIds,edgeId);
              currentChildMap.put(childPattern,childVertexIds,childEdgeIds);
              break;
            }
 else             if (toTime == rightmostPathTime && fromTime < 0) {
              int[] childPattern=dfsCodeUtils.addExtension(parentPattern,toTime,graphUtils.getToLabel(graph,edgeId),getExtensionIsOutgoing(graph,edgeId,false),graphUtils.getEdgeLabel(graph,edgeId),forwardsTime,graphUtils.getFromLabel(graph,edgeId));
              int[] childVertexIds=ArrayUtils.add(parentVertexIds,edgeFromId);
              int[] childEdgeIds=ArrayUtils.add(parentEdgeIds,edgeId);
              currentChildMap.put(childPattern,childVertexIds,childEdgeIds);
              break;
            }
          }
        }
      }
    }
  }
  return currentChildMap;
}