Program: 2423
Project: 2423
Buggy source:
private void makeReceive(ClassBuilder cb,EndpointState ps){
  final String OP_PARAM="String_Node_Str";
  final String MESSAGE_PARAM="String_Node_Str";
  final String ARG_PREFIX="String_Node_Str";
  JobContext jc=this.job.getContext();
  Module main=jc.getMainModule();
  IOAction a=ps.getAcceptable().iterator().next();
  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(SCRIBMESSAGE_CLASS + "String_Node_Str" + MESSAGE_PARAM+ "String_Node_Str"+ ClassBuilder.SUPER+ "String_Node_Str"+ getPrefixedRoleClassName(a.peer)+ "String_Node_Str");
    addReceiveOpPayloadIntoBuffs(main,a,mb1,MESSAGE_PARAM,ARG_PREFIX);
  }
 else {
    final String MESSAGE_VAR=MESSAGE_PARAM;
    MessageSigNameDecl msd=main.getMessageSigDecl(((MessageSigName)a.mid).getSimpleName());
    addReceiveMessageSigNameParams(a,mb1,msd,OP_PARAM,ARG_PREFIX);
    mb1.addBodyLine(SCRIBMESSAGE_CLASS + "String_Node_Str" + MESSAGE_VAR+ "String_Node_Str"+ ClassBuilder.SUPER+ "String_Node_Str"+ getPrefixedRoleClassName(a.peer)+ "String_Node_Str");
    mb1.addBodyLine(ARG_PREFIX + "String_Node_Str" + BUFF_VAL+ "String_Node_Str"+ msd.extName+ "String_Node_Str"+ MESSAGE_VAR+ "String_Node_Str");
  }
  makeReturnNextSocket(mb1,next);
  MethodBuilder mb4=cb.newMethod("String_Node_Str");
  mb4.addModifiers(ClassBuilder.PUBLIC);
  mb4.setReturn("String_Node_Str");
  mb4.addBodyLine(ClassBuilder.RETURN + "String_Node_Str" + ClassBuilder.SUPER+ "String_Node_Str"+ getPrefixedRoleClassName(a.peer)+ "String_Node_Str");
  ClassBuilder future=cb.newClass();
  cb.addImports("String_Node_Str");
  String fname="String_Node_Str" + cb.getName();
  future.setName(fname);
  future.setSuperClass(SCRIBFUTURE_CLASS);
  if (!a.payload.isEmpty()) {
    int i=1;
    for (    PayloadType<?> pt : a.payload.elems) {
      String type=main.getDataTypeDecl((DataType)pt).extName;
      FieldBuilder f=future.newField("String_Node_Str" + i);
      f.setType(type);
      f.addModifiers(ClassBuilder.PUBLIC);
      i++;
    }
  }
  final String FUTURE_PARAM="String_Node_Str";
  MethodBuilder cons=future.newConstructor("String_Node_Str" + SCRIBMESSAGE_CLASS + "String_Node_Str"+ FUTURE_PARAM);
  cons.addModifiers(ClassBuilder.PROTECTED);
  cons.addBodyLine(ClassBuilder.SUPER + "String_Node_Str" + FUTURE_PARAM+ "String_Node_Str");
  MethodBuilder sync=future.newMethod("String_Node_Str");
  sync.addExceptions("String_Node_Str","String_Node_Str");
  sync.addModifiers(ClassBuilder.PUBLIC);
  sync.setReturn(fname);
  sync.addBodyLine(SCRIBMESSAGE_CLASS + "String_Node_Str" + ClassBuilder.SUPER+ "String_Node_Str");
  if (!a.payload.isEmpty()) {
    int i=1;
    for (    PayloadType<?> pt : a.payload.elems) {
      String type=main.getDataTypeDecl((DataType)pt).extName;
      sync.addBodyLine(ClassBuilder.THIS + "String_Node_Str" + "String_Node_Str"+ i+ "String_Node_Str"+ type+ "String_Node_Str"+ (i - 1)+ "String_Node_Str");
    }
    i++;
  }
  sync.addBodyLine(ClassBuilder.RETURN + "String_Node_Str" + ClassBuilder.THIS+ "String_Node_Str");
  MethodBuilder mb2=cb.newMethod("String_Node_Str");
  mb2.addExceptions(SCRIBBLERUNTIMEEXCEPTION_CLASS);
  mb2.addBodyLine(ClassBuilder.SUPER + "String_Node_Str");
  mb2.addModifiers(ClassBuilder.PUBLIC,ClassBuilder.SYNCHRONIZED);
  mb2.setReturn(next);
  if (a.mid.isOp()) {
    mb2.addParameters(SessionApiGenerator.getOpClassName(a.mid) + "String_Node_Str" + OP_PARAM);
  }
 else {
    throw new RuntimeException("String_Node_Str" + a.mid);
  }
  mb2.addParameters(BUFF_CLASS + "String_Node_Str" + fname+ "String_Node_Str"+ ARG_PREFIX);
  String ln=ARG_PREFIX + "String_Node_Str" + ClassBuilder.NEW+ "String_Node_Str"+ fname+ "String_Node_Str"+ ClassBuilder.SUPER+ "String_Node_Str"+ getPrefixedRoleClassName(a.peer)+ "String_Node_Str";
  mb2.addBodyLine(ln);
  if (next.equals("String_Node_Str")) {
    mb2.addBodyLine(SCRIBSOCKET_EP_FIELD + "String_Node_Str");
  }
 else {
    makeReturnNextSocket(mb2,next);
  }
  MethodBuilder mb3=cb.newMethod("String_Node_Str");
  mb3.addExceptions(SCRIBBLERUNTIMEEXCEPTION_CLASS);
  mb3.addModifiers(ClassBuilder.PUBLIC);
  mb3.setReturn(next);
  if (!next.equals("String_Node_Str")) {
    if (a.mid.isOp()) {
      mb3.addParameters(SessionApiGenerator.getOpClassName(a.mid) + "String_Node_Str" + OP_PARAM);
      mb3.addBodyLine(ClassBuilder.RETURN + "String_Node_Str" + OP_PARAM+ "String_Node_Str"+ ClassBuilder.NEW+ "String_Node_Str"+ BUFF_CLASS+ "String_Node_Str");
    }
 else {
      throw new RuntimeException("String_Node_Str" + a.mid);
    }
  }
}

Fixed version (ground truth):
private void makeReceive(ClassBuilder cb,EndpointState ps){
  final String OP_PARAM="String_Node_Str";
  final String MESSAGE_PARAM="String_Node_Str";
  final String ARG_PREFIX="String_Node_Str";
  JobContext jc=this.job.getContext();
  Module main=jc.getMainModule();
  IOAction a=ps.getAcceptable().iterator().next();
  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(SCRIBMESSAGE_CLASS + "String_Node_Str" + MESSAGE_PARAM+ "String_Node_Str"+ ClassBuilder.SUPER+ "String_Node_Str"+ getPrefixedRoleClassName(a.peer)+ "String_Node_Str");
    addReceiveOpPayloadIntoBuffs(main,a,mb1,MESSAGE_PARAM,ARG_PREFIX);
  }
 else {
    final String MESSAGE_VAR=MESSAGE_PARAM;
    MessageSigNameDecl msd=main.getMessageSigDecl(((MessageSigName)a.mid).getSimpleName());
    addReceiveMessageSigNameParams(a,mb1,msd,OP_PARAM,ARG_PREFIX);
    mb1.addBodyLine(SCRIBMESSAGE_CLASS + "String_Node_Str" + MESSAGE_VAR+ "String_Node_Str"+ ClassBuilder.SUPER+ "String_Node_Str"+ getPrefixedRoleClassName(a.peer)+ "String_Node_Str");
    mb1.addBodyLine(ARG_PREFIX + "String_Node_Str" + BUFF_VAL+ "String_Node_Str"+ msd.extName+ "String_Node_Str"+ MESSAGE_VAR+ "String_Node_Str");
  }
  makeReturnNextSocket(mb1,next);
  MethodBuilder mb4=cb.newMethod("String_Node_Str");
  mb4.addModifiers(ClassBuilder.PUBLIC);
  mb4.setReturn("String_Node_Str");
  mb4.addBodyLine(ClassBuilder.RETURN + "String_Node_Str" + ClassBuilder.SUPER+ "String_Node_Str"+ getPrefixedRoleClassName(a.peer)+ "String_Node_Str");
  ClassBuilder future=cb.newClass();
  cb.addImports("String_Node_Str");
  String fname="String_Node_Str" + cb.getName();
  future.setName(fname);
  future.setSuperClass(SCRIBFUTURE_CLASS);
  if (!a.payload.isEmpty()) {
    int i=1;
    for (    PayloadType<?> pt : a.payload.elems) {
      String type=main.getDataTypeDecl((DataType)pt).extName;
      FieldBuilder f=future.newField("String_Node_Str" + i);
      f.setType(type);
      f.addModifiers(ClassBuilder.PUBLIC);
      i++;
    }
  }
  final String FUTURE_PARAM="String_Node_Str";
  MethodBuilder cons=future.newConstructor("String_Node_Str" + SCRIBMESSAGE_CLASS + "String_Node_Str"+ FUTURE_PARAM);
  cons.addModifiers(ClassBuilder.PROTECTED);
  cons.addBodyLine(ClassBuilder.SUPER + "String_Node_Str" + FUTURE_PARAM+ "String_Node_Str");
  MethodBuilder sync=future.newMethod("String_Node_Str");
  sync.addExceptions("String_Node_Str","String_Node_Str");
  sync.addModifiers(ClassBuilder.PUBLIC);
  sync.setReturn(fname);
  sync.addBodyLine(SCRIBMESSAGE_CLASS + "String_Node_Str" + ClassBuilder.SUPER+ "String_Node_Str");
  if (!a.payload.isEmpty()) {
    int i=1;
    for (    PayloadType<?> pt : a.payload.elems) {
      String type=main.getDataTypeDecl((DataType)pt).extName;
      sync.addBodyLine(ClassBuilder.THIS + "String_Node_Str" + "String_Node_Str"+ i+ "String_Node_Str"+ type+ "String_Node_Str"+ (i - 1)+ "String_Node_Str");
    }
    i++;
  }
  sync.addBodyLine(ClassBuilder.RETURN + "String_Node_Str" + ClassBuilder.THIS+ "String_Node_Str");
  MethodBuilder mb2=cb.newMethod("String_Node_Str");
  mb2.addExceptions(SCRIBBLERUNTIMEEXCEPTION_CLASS);
  mb2.addBodyLine(ClassBuilder.SUPER + "String_Node_Str");
  mb2.addModifiers(ClassBuilder.PUBLIC,ClassBuilder.SYNCHRONIZED);
  mb2.setReturn(next);
  mb2.addParameters(SessionApiGenerator.getOpClassName(a.mid) + "String_Node_Str" + OP_PARAM);
  mb2.addParameters(BUFF_CLASS + "String_Node_Str" + fname+ "String_Node_Str"+ ARG_PREFIX);
  String ln=ARG_PREFIX + "String_Node_Str" + ClassBuilder.NEW+ "String_Node_Str"+ fname+ "String_Node_Str"+ ClassBuilder.SUPER+ "String_Node_Str"+ getPrefixedRoleClassName(a.peer)+ "String_Node_Str";
  mb2.addBodyLine(ln);
  if (next.equals("String_Node_Str")) {
    mb2.addBodyLine(SCRIBSOCKET_EP_FIELD + "String_Node_Str");
  }
 else {
    makeReturnNextSocket(mb2,next);
  }
  MethodBuilder mb3=cb.newMethod("String_Node_Str");
  mb3.addExceptions(SCRIBBLERUNTIMEEXCEPTION_CLASS);
  mb3.addModifiers(ClassBuilder.PUBLIC);
  mb3.setReturn(next);
  if (!next.equals("String_Node_Str")) {
    mb3.addParameters(SessionApiGenerator.getOpClassName(a.mid) + "String_Node_Str" + OP_PARAM);
    mb3.addBodyLine(ClassBuilder.RETURN + "String_Node_Str" + OP_PARAM+ "String_Node_Str"+ ClassBuilder.NEW+ "String_Node_Str"+ BUFF_CLASS+ "String_Node_Str");
  }
}