Program: 2360
Project: 2360
Buggy source:
private void generateIOStateInterfacesSecondPass(Set<EndpointState> visited,EndpointState s){
  if (visited.contains(s) || s.isTerminal()) {
    return;
  }
  Set<InterfaceBuilder> succifs=this.preds.get(s);
  if (succifs != null) {
    InterfaceBuilder iostate=this.iostates.get(IOStateInterfaceGenerator.getIOStateInterfaceName(getSelf(),s));
    if (this.SUBTYPES) {
      String name=iostate.getName();
      if (name.startsWith("String_Node_Str")) {
        List<String> ifs=this.iostates.get(name).getInterfaces();
        List<String> outs=ifs.stream().filter((i) -> i.startsWith("String_Node_Str")).map((o) -> (o=o.substring(0,o.indexOf("String_Node_Str"))).substring(o.indexOf("String_Node_Str") + 1,o.length())).sorted((s1,s2) -> s1.compareTo(s2)).collect(Collectors.toList());
        addSupertypeInterfaceToMethods(s,outs,"String_Node_Str","String_Node_Str");
      }
    }
    for (    InterfaceBuilder pred : succifs) {
      iostate.addInterfaces(pred.getName());
      String ret=iostate.getName() + "String_Node_Str" + IntStream.range(0,iostate.getParameters().size()).mapToObj((i) -> "String_Node_Str").collect(Collectors.joining("String_Node_Str"))+ "String_Node_Str";
      addToCastMethod(pred,ret);
      for (      MethodBuilder cast : pred.getDefaultMethods()) {
        MethodBuilder mb=addToCastMethod(iostate,cast.getReturn());
        if (mb != null) {
          mb.addAnnotations("String_Node_Str");
        }
      }
    }
  }
  visited.add(s);
  for (  IOAction a : s.getAcceptable()) {
    generateIOStateInterfacesSecondPass(visited,s.accept(a));
  }
}

Fixed version (ground truth):
private void generateIOStateInterfacesSecondPass(Set<EndpointState> visited,EndpointState s){
  if (visited.contains(s) || s.isTerminal()) {
    return;
  }
  Set<InterfaceBuilder> succifs=this.preds.get(s);
  if (succifs != null) {
    InterfaceBuilder iostate=this.iostates.get(IOStateInterfaceGenerator.getIOStateInterfaceName(getSelf(),s));
    if (this.SUBTYPES) {
      String name=iostate.getName();
      if (name.startsWith("String_Node_Str")) {
        List<String> ifs=this.iostates.get(name).getInterfaces();
        List<String> outs=ifs.stream().filter((i) -> i.startsWith("String_Node_Str")).map((o) -> (o=o.substring(0,o.indexOf("String_Node_Str"))).substring(o.indexOf("String_Node_Str") + 1,o.length())).sorted((s1,s2) -> s1.compareTo(s2)).collect(Collectors.toList());
        addSupertypeInterfaceToMethods(s,outs,"String_Node_Str","String_Node_Str");
      }
    }
    for (    InterfaceBuilder pred : succifs) {
      iostate.addInterfaces(pred.getName());
      String ret=iostate.getName() + "String_Node_Str" + IntStream.range(0,iostate.getParameters().size()).mapToObj((i) -> "String_Node_Str").collect(Collectors.joining("String_Node_Str"))+ "String_Node_Str";
      addToCastMethod(pred,ret);
      for (      MethodBuilder cast : pred.getDefaultMethods()) {
        MethodBuilder mb=addToCastMethod(iostate,cast.getReturn());
        if (mb != null) {
          mb.addAnnotations("String_Node_Str");
        }
      }
    }
  }
  visited.add(s);
  for (  IOAction a : s.getTakeable()) {
    generateIOStateInterfacesSecondPass(visited,s.take(a));
  }
}