Program: 2422
Project: 2422
Buggy source:
private String constructBranchReceiveClass(EndpointState ps,Module main){
  final String OP_FIELD="String_Node_Str";
  final String OP_PARAM=OP_FIELD;
  final String MESSAGE_FIELD="String_Node_Str";
  final String MESSAGE_PARAM=MESSAGE_FIELD;
  final String ARG_PREFIX="String_Node_Str";
  String branchName=this.classNames.get(ps);
  String enumClass=branchName + "String_Node_Str";
  String className=newClassName();
  ClassBuilder cb=constructClassExceptMethods(RECEIVESOCKET_CLASS,className,ps);
  MethodBuilder ctor=cb.getConstructors().iterator().next();
  ctor.addParameters(branchName + "String_Node_Str" + enumClass+ "String_Node_Str"+ OP_PARAM,SCRIBMESSAGE_CLASS + "String_Node_Str" + MESSAGE_PARAM);
  ctor.addBodyLine(ClassBuilder.THIS + "String_Node_Str" + OP_FIELD+ "String_Node_Str"+ OP_PARAM+ "String_Node_Str");
  ctor.addBodyLine(ClassBuilder.THIS + "String_Node_Str" + MESSAGE_FIELD+ "String_Node_Str"+ MESSAGE_PARAM+ "String_Node_Str");
  FieldBuilder fb1=cb.newField(OP_FIELD);
  fb1.addModifiers(ClassBuilder.PUBLIC,ClassBuilder.FINAL);
  fb1.setType(this.classNames.get(ps) + "String_Node_Str" + enumClass);
  FieldBuilder fb2=cb.newField(MESSAGE_FIELD);
  fb2.addModifiers(ClassBuilder.PRIVATE,ClassBuilder.FINAL);
  fb2.setType(SCRIBMESSAGE_CLASS);
  for (  IOAction a : ps.getAcceptable()) {
    EndpointState succ=ps.accept(a);
    String next=this.classNames.get(succ);
    MethodBuilder mb1=makeReceiveBlurb(cb,next);
    if (a.mid.isOp()) {
      addReceiveOpParams(main,a,mb1,OP_PARAM,ARG_PREFIX);
      mb1.addBodyLine(ClassBuilder.SUPER + "String_Node_Str");
      addBranchCheck(getPrefixedOpClassName(a.mid),mb1,MESSAGE_FIELD);
      addReceiveOpPayloadIntoBuffs(main,a,mb1,MESSAGE_PARAM,ARG_PREFIX);
    }
 else {
      MessageSigNameDecl msd=main.getMessageSigDecl(((MessageSigName)a.mid).getSimpleName());
      addReceiveMessageSigNameParams(a,mb1,msd,OP_PARAM,ARG_PREFIX);
      mb1.addBodyLine(ClassBuilder.SUPER + "String_Node_Str");
      addBranchCheck(getPrefixedOpClassName(a.mid),mb1,MESSAGE_FIELD);
      mb1.addBodyLine(ARG_PREFIX + "String_Node_Str" + BUFF_VAL+ "String_Node_Str"+ msd.extName+ "String_Node_Str"+ MESSAGE_FIELD+ "String_Node_Str");
    }
    if (!next.equals("String_Node_Str")) {
      mb1.addBodyLine(ClassBuilder.RETURN + "String_Node_Str" + ClassBuilder.NEW+ "String_Node_Str"+ next+ "String_Node_Str");
    }
    if (!a.payload.isEmpty()) {
      MethodBuilder mb2=makeReceiveBlurb(cb,next);
      mb2.addParameters(SessionApiGenerator.getOpClassName(a.mid) + "String_Node_Str" + OP_PARAM);
      String ln=(next.equals("String_Node_Str")) ? "String_Node_Str" : ClassBuilder.RETURN + "String_Node_Str";
      if (a.mid.isOp()) {
        ln+="String_Node_Str" + OP_PARAM + "String_Node_Str"+ a.payload.elems.stream().map((e) -> ClassBuilder.NEW + "String_Node_Str" + BUFF_CLASS+ "String_Node_Str").collect(Collectors.joining("String_Node_Str"))+ "String_Node_Str";
      }
 else {
        ln+="String_Node_Str" + OP_PARAM + "String_Node_Str"+ ClassBuilder.NEW+ "String_Node_Str"+ BUFF_CLASS+ "String_Node_Str";
      }
      mb2.addBodyLine(ln);
    }
  }
  this.classes.put(className,cb);
  return className;
}

Fixed version (ground truth):
private String constructBranchReceiveClass(EndpointState ps,Module main){
  final String OP_FIELD="String_Node_Str";
  final String OP_PARAM=OP_FIELD;
  final String MESSAGE_FIELD="String_Node_Str";
  final String MESSAGE_PARAM=MESSAGE_FIELD;
  final String ARG_PREFIX="String_Node_Str";
  String branchName=this.classNames.get(ps);
  String enumClass=branchName + "String_Node_Str";
  String className=newClassName();
  ClassBuilder cb=constructClassExceptMethods(RECEIVESOCKET_CLASS,className,ps);
  MethodBuilder ctor=cb.getConstructors().iterator().next();
  ctor.addParameters(branchName + "String_Node_Str" + enumClass+ "String_Node_Str"+ OP_PARAM,SCRIBMESSAGE_CLASS + "String_Node_Str" + MESSAGE_PARAM);
  ctor.addBodyLine(ClassBuilder.THIS + "String_Node_Str" + OP_FIELD+ "String_Node_Str"+ OP_PARAM+ "String_Node_Str");
  ctor.addBodyLine(ClassBuilder.THIS + "String_Node_Str" + MESSAGE_FIELD+ "String_Node_Str"+ MESSAGE_PARAM+ "String_Node_Str");
  FieldBuilder fb1=cb.newField(OP_FIELD);
  fb1.addModifiers(ClassBuilder.PUBLIC,ClassBuilder.FINAL);
  fb1.setType(this.classNames.get(ps) + "String_Node_Str" + enumClass);
  FieldBuilder fb2=cb.newField(MESSAGE_FIELD);
  fb2.addModifiers(ClassBuilder.PRIVATE,ClassBuilder.FINAL);
  fb2.setType(SCRIBMESSAGE_CLASS);
  for (  IOAction a : ps.getAcceptable()) {
    EndpointState succ=ps.accept(a);
    String next=this.classNames.get(succ);
    MethodBuilder mb1=makeReceiveBlurb(cb,next);
    if (a.mid.isOp()) {
      addReceiveOpParams(main,a,mb1,OP_PARAM,ARG_PREFIX);
      mb1.addBodyLine(ClassBuilder.SUPER + "String_Node_Str");
      addBranchCheck(getPrefixedOpClassName(a.mid),mb1,MESSAGE_FIELD);
      addReceiveOpPayloadIntoBuffs(main,a,mb1,MESSAGE_PARAM,ARG_PREFIX);
    }
 else {
      MessageSigNameDecl msd=main.getMessageSigDecl(((MessageSigName)a.mid).getSimpleName());
      addReceiveMessageSigNameParams(a,mb1,msd,OP_PARAM,ARG_PREFIX);
      mb1.addBodyLine(ClassBuilder.SUPER + "String_Node_Str");
      addBranchCheck(getPrefixedOpClassName(a.mid),mb1,MESSAGE_FIELD);
      mb1.addBodyLine(ARG_PREFIX + "String_Node_Str" + BUFF_VAL+ "String_Node_Str"+ msd.extName+ "String_Node_Str"+ MESSAGE_FIELD+ "String_Node_Str");
    }
    makeReturnNextSocket(mb1,next);
    if (!a.payload.isEmpty()) {
      MethodBuilder mb2=makeReceiveBlurb(cb,next);
      mb2.addParameters(SessionApiGenerator.getOpClassName(a.mid) + "String_Node_Str" + OP_PARAM);
      String ln=(next.equals("String_Node_Str")) ? "String_Node_Str" : ClassBuilder.RETURN + "String_Node_Str";
      if (a.mid.isOp()) {
        ln+="String_Node_Str" + OP_PARAM + "String_Node_Str"+ a.payload.elems.stream().map((e) -> ClassBuilder.NEW + "String_Node_Str" + BUFF_CLASS+ "String_Node_Str").collect(Collectors.joining("String_Node_Str"))+ "String_Node_Str";
      }
 else {
        ln+="String_Node_Str" + OP_PARAM + "String_Node_Str"+ ClassBuilder.NEW+ "String_Node_Str"+ BUFF_CLASS+ "String_Node_Str";
      }
      mb2.addBodyLine(ln);
    }
  }
  this.classes.put(className,cb);
  return className;
}