Program: 112138
Project: 112138
Buggy source:
public <T>RecordReader<T> compile(final RecordReaderImplementation<T> recordReader){
  int stateCount=recordReader.getStateCount();
  String className="String_Node_Str" + (++id);
  ClassBuilder classBuilder=startClass(className,existing(BaseRecordReader.class));
  for (int i=0; i < stateCount; i++) {
    classBuilder=classBuilder.field(PUBLIC,existing(ColumnReader.class),"String_Node_Str" + i + "String_Node_Str").field(PUBLIC,existing(PrimitiveColumnIO.class),"String_Node_Str" + i + "String_Node_Str");
  }
  MethodBuilder readMethodBuilder=classBuilder.startMethod(PUBLIC,VOID,"String_Node_Str").var(INT,"String_Node_Str").var(INT,"String_Node_Str").var(INT,"String_Node_Str").transform(this.<MethodBuilder>debug("String_Node_Str")).exec().callOnThisNoParam("String_Node_Str").endExec().set("String_Node_Str").literal(0).endSet();
  for (int i=0; i < stateCount; i++) {
    final State state=recordReader.getState(i);
    String columnReader="String_Node_Str" + i + "String_Node_Str";
    readMethodBuilder=readMethodBuilder.label("String_Node_Str" + i).transform(this.<MethodBuilder>debug("String_Node_Str" + i));
    if (state.maxDefinitionLevel == 0) {
      readMethodBuilder=generateSwitch(readMethodBuilder,true,state);
    }
 else {
      readMethodBuilder=readMethodBuilder.set("String_Node_Str").get(columnReader).callNoParam("String_Node_Str").endSet().ifExp().get("String_Node_Str").isEqualTo().literal(state.maxDefinitionLevel).thenBlock().transform(new Function<ThenBuilder<MethodBuilder>,ThenBuilder<MethodBuilder>>(){
        public ThenBuilder<MethodBuilder> apply(        ThenBuilder<MethodBuilder> builder){
          return generateSwitch(builder,true,state);
        }
      }
).elseBlock().transform(new Function<ElseBuilder<MethodBuilder>,ElseBuilder<MethodBuilder>>(){
        public ElseBuilder<MethodBuilder> apply(        ElseBuilder<MethodBuilder> builder){
          return generateSwitch(builder,false,state);
        }
      }
).endIf();
    }
    if (state.maxRepetitionLevel == 0) {
      int nextReader=recordReader.getNextReader(state.id,0);
      if (nextReader != state.id) {
        String label=nextReader == recordReader.getStateCount() ? "String_Node_Str" : "String_Node_Str" + nextReader;
        readMethodBuilder=readMethodBuilder.gotoLabel(label);
      }
    }
 else {
      readMethodBuilder=readMethodBuilder.switchOn().get("String_Node_Str").switchBlock().transform(new Function<SwitchBuilder<MethodBuilder>,SwitchBuilder<MethodBuilder>>(){
        public SwitchBuilder<MethodBuilder> apply(        SwitchBuilder<MethodBuilder> builder){
          for (int i=0; i <= state.maxRepetitionLevel; i++) {
            int nextReader=recordReader.getNextReader(state.id,i);
            String label=nextReader == recordReader.getStateCount() ? "String_Node_Str" : "String_Node_Str" + nextReader;
            builder=builder.gotoLabel(i,label);
          }
          return builder;
        }
      }
).defaultCase().exec().callOnThis("String_Node_Str").literal("String_Node_Str").endCall().endExec().breakCase().endSwitch();
    }
  }
  FutureType testClass=readMethodBuilder.label("String_Node_Str").exec().callOnThisNoParam("String_Node_Str").endExec().endMethod().endClass();
  cl.define(testClass);
  try {
    Class<?> generated=(Class<?>)cl.loadClass(className);
    BaseRecordReader<T> compiledRecordReader=(BaseRecordReader<T>)generated.getConstructor().newInstance();
    compiledRecordReader.caseLookup=new State[stateCount];
    for (int i=0; i < stateCount; i++) {
      State state=recordReader.getState(i);
      try {
        generated.getField("String_Node_Str" + i + "String_Node_Str").set(compiledRecordReader,state.column);
        generated.getField("String_Node_Str" + i + "String_Node_Str").set(compiledRecordReader,state.primitiveColumnIO);
      }
 catch (      NoSuchFieldException e) {
        throw new RuntimeException("String_Node_Str" + i,e);
      }
      compiledRecordReader.caseLookup[i]=state;
    }
    compiledRecordReader.recordMaterializer=recordReader.getMaterializer();
    compiledRecordReader.recordConsumer=recordReader.getRecordConsumer();
    return compiledRecordReader;
  }
 catch (  ClassNotFoundException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
catch (  InstantiationException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
catch (  IllegalAccessException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
catch (  IllegalArgumentException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
catch (  SecurityException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
catch (  InvocationTargetException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
catch (  NoSuchMethodException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
public <T>RecordReader<T> compile(final RecordReaderImplementation<T> recordReader){
  int stateCount=recordReader.getStateCount();
  String className="String_Node_Str" + (++id);
  ClassBuilder classBuilder=startClass(className,existing(BaseRecordReader.class));
  for (int i=0; i < stateCount; i++) {
    classBuilder=classBuilder.field(PUBLIC,existing(ColumnReader.class),"String_Node_Str" + i + "String_Node_Str");
  }
  MethodBuilder readMethodBuilder=classBuilder.startMethod(PUBLIC,VOID,"String_Node_Str").var(INT,"String_Node_Str").var(INT,"String_Node_Str").var(INT,"String_Node_Str").transform(this.<MethodBuilder>debug("String_Node_Str")).exec().callOnThisNoParam("String_Node_Str").endExec().set("String_Node_Str").literal(0).endSet();
  for (int i=0; i < stateCount; i++) {
    final State state=recordReader.getState(i);
    String columnReader="String_Node_Str" + i + "String_Node_Str";
    readMethodBuilder=readMethodBuilder.label("String_Node_Str" + i).transform(this.<MethodBuilder>debug("String_Node_Str" + i));
    if (state.maxDefinitionLevel == 0) {
      readMethodBuilder=generateSwitch(readMethodBuilder,true,state);
    }
 else {
      readMethodBuilder=readMethodBuilder.set("String_Node_Str").get(columnReader).callNoParam("String_Node_Str").endSet().ifExp().get("String_Node_Str").isEqualTo().literal(state.maxDefinitionLevel).thenBlock().transform(new Function<ThenBuilder<MethodBuilder>,ThenBuilder<MethodBuilder>>(){
        public ThenBuilder<MethodBuilder> apply(        ThenBuilder<MethodBuilder> builder){
          return generateSwitch(builder,true,state);
        }
      }
).elseBlock().transform(new Function<ElseBuilder<MethodBuilder>,ElseBuilder<MethodBuilder>>(){
        public ElseBuilder<MethodBuilder> apply(        ElseBuilder<MethodBuilder> builder){
          return generateSwitch(builder,false,state);
        }
      }
).endIf();
    }
    int firstTransitionNextReader=recordReader.getNextReader(state.id,0);
    boolean allTheSame=true;
    for (int j=0; j <= state.maxRepetitionLevel; j++) {
      if (recordReader.getNextReader(state.id,j) != firstTransitionNextReader) {
        allTheSame=false;
        break;
      }
    }
    if (allTheSame) {
      int nextReader=firstTransitionNextReader;
      if (nextReader != (state.id + 1)) {
        String label=nextReader == recordReader.getStateCount() ? "String_Node_Str" : "String_Node_Str" + nextReader;
        readMethodBuilder=readMethodBuilder.gotoLabel(label);
      }
    }
 else {
      readMethodBuilder=readMethodBuilder.switchOn().get("String_Node_Str").switchBlock().transform(new Function<SwitchBuilder<MethodBuilder>,SwitchBuilder<MethodBuilder>>(){
        public SwitchBuilder<MethodBuilder> apply(        SwitchBuilder<MethodBuilder> builder){
          for (int i=0; i <= state.maxRepetitionLevel; i++) {
            int nextReader=recordReader.getNextReader(state.id,i);
            String label=nextReader == recordReader.getStateCount() ? "String_Node_Str" : "String_Node_Str" + nextReader;
            builder=builder.gotoLabel(i,label);
          }
          return builder;
        }
      }
).defaultCase().exec().callOnThis("String_Node_Str").literal("String_Node_Str").endCall().endExec().breakCase().endSwitch();
    }
  }
  FutureType testClass=readMethodBuilder.label("String_Node_Str").exec().callOnThisNoParam("String_Node_Str").endExec().endMethod().endClass();
  cl.define(testClass);
  try {
    Class<?> generated=(Class<?>)cl.loadClass(className);
    BaseRecordReader<T> compiledRecordReader=(BaseRecordReader<T>)generated.getConstructor().newInstance();
    compiledRecordReader.caseLookup=new State[stateCount];
    for (int i=0; i < stateCount; i++) {
      State state=recordReader.getState(i);
      try {
        generated.getField("String_Node_Str" + i + "String_Node_Str").set(compiledRecordReader,state.column);
      }
 catch (      NoSuchFieldException e) {
        throw new RuntimeException("String_Node_Str" + i,e);
      }
      compiledRecordReader.caseLookup[i]=state;
    }
    compiledRecordReader.recordMaterializer=recordReader.getMaterializer();
    compiledRecordReader.recordConsumer=recordReader.getRecordConsumer();
    return compiledRecordReader;
  }
 catch (  ClassNotFoundException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
catch (  InstantiationException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
catch (  IllegalAccessException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
catch (  IllegalArgumentException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
catch (  SecurityException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
catch (  InvocationTargetException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
catch (  NoSuchMethodException e) {
    throw new RuntimeException("String_Node_Str" + className + "String_Node_Str",e);
  }
}