Program: 185271
Project: 185271
Buggy source:
public ThriftStructMetadata<T> build(){
  problems.throwIfHasErrors();
  ThriftMethodInjection builderMethodInjection=null;
  if (builderClass != null) {
    MethodInjection builderMethod=builderMethodInjections.get(0);
    builderMethodInjection=new ThriftMethodInjection(builderMethod.getMethod(),toThriftParameterInjections(builderMethod.getParameters()));
  }
  ConstructorInjection constructor=constructorInjections.get(0);
  Multimap<Short,FieldMetadata> fieldsById=Multimaps.index(fields,getThriftFieldId());
  Iterable<ThriftFieldMetadata> fieldsMetadata=Iterables.transform(fieldsById.asMap().values(),new Function<Collection<FieldMetadata>,ThriftFieldMetadata>(){
    @Override public ThriftFieldMetadata apply(    Collection<FieldMetadata> input){
      checkArgument(!input.isEmpty(),"String_Node_Str");
      short id=-1;
      String name=null;
      ThriftType type=null;
      ImmutableList.Builder<ThriftInjection> injections=ImmutableList.builder();
      ThriftExtraction extraction=null;
      for (      FieldMetadata fieldMetadata : input) {
        id=fieldMetadata.getId();
        name=fieldMetadata.getName();
        type=catalog.getThriftType(fieldMetadata.getJavaType(),fieldMetadata.getProtocolType());
        if (fieldMetadata instanceof FieldInjection) {
          FieldInjection fieldInjection=(FieldInjection)fieldMetadata;
          injections.add(new ThriftFieldInjection(fieldInjection.getId(),fieldInjection.getName(),fieldInjection.getField()));
        }
 else         if (fieldMetadata instanceof ParameterInjection) {
          ParameterInjection parameterInjection=(ParameterInjection)fieldMetadata;
          injections.add(new ThriftParameterInjection(parameterInjection.getId(),parameterInjection.getName(),parameterInjection.getParameterIndex()));
        }
 else         if (fieldMetadata instanceof FieldExtractor) {
          FieldExtractor fieldExtractor=(FieldExtractor)fieldMetadata;
          extraction=new ThriftFieldExtractor(fieldExtractor.getId(),fieldExtractor.getName(),fieldExtractor.getField());
        }
 else         if (fieldMetadata instanceof MethodExtractor) {
          MethodExtractor methodExtractor=(MethodExtractor)fieldMetadata;
          extraction=new ThriftMethodExtractor(methodExtractor.getId(),methodExtractor.getName(),methodExtractor.getMethod());
        }
      }
      ThriftFieldMetadata thriftFieldMetadata=new ThriftFieldMetadata(id,type,name,injections.build(),extraction);
      return thriftFieldMetadata;
    }
  }
);
  return new ThriftStructMetadata<>(structName,structClass,builderClass,builderMethodInjection,ImmutableList.copyOf(fieldsMetadata),new ThriftConstructorInjection(constructor.getConstructor(),toThriftParameterInjections(constructor.getParameters())),toThriftMethodInjections(methodInjections));
}

Fixed version (ground truth):
public ThriftStructMetadata<T> build(){
  problems.throwIfHasErrors();
  ThriftMethodInjection builderMethodInjection=null;
  if (builderClass != null) {
    MethodInjection builderMethod=builderMethodInjections.get(0);
    builderMethodInjection=new ThriftMethodInjection(builderMethod.getMethod(),toThriftParameterInjections(builderMethod.getParameters()));
  }
  ConstructorInjection constructor=constructorInjections.get(0);
  Multimap<Optional<Short>,FieldMetadata> fieldsById=Multimaps.index(fields,getThriftFieldId());
  Iterable<ThriftFieldMetadata> fieldsMetadata=Iterables.transform(fieldsById.asMap().values(),new Function<Collection<FieldMetadata>,ThriftFieldMetadata>(){
    @Override public ThriftFieldMetadata apply(    Collection<FieldMetadata> input){
      checkArgument(!input.isEmpty(),"String_Node_Str");
      short id=-1;
      String name=null;
      ThriftType type=null;
      ImmutableList.Builder<ThriftInjection> injections=ImmutableList.builder();
      ThriftExtraction extraction=null;
      for (      FieldMetadata fieldMetadata : input) {
        id=fieldMetadata.getId();
        name=fieldMetadata.getName();
        type=catalog.getThriftType(fieldMetadata.getJavaType(),fieldMetadata.getProtocolType());
        if (fieldMetadata instanceof FieldInjection) {
          FieldInjection fieldInjection=(FieldInjection)fieldMetadata;
          injections.add(new ThriftFieldInjection(fieldInjection.getId(),fieldInjection.getName(),fieldInjection.getField()));
        }
 else         if (fieldMetadata instanceof ParameterInjection) {
          ParameterInjection parameterInjection=(ParameterInjection)fieldMetadata;
          injections.add(new ThriftParameterInjection(parameterInjection.getId(),parameterInjection.getName(),parameterInjection.getParameterIndex()));
        }
 else         if (fieldMetadata instanceof FieldExtractor) {
          FieldExtractor fieldExtractor=(FieldExtractor)fieldMetadata;
          extraction=new ThriftFieldExtractor(fieldExtractor.getId(),fieldExtractor.getName(),fieldExtractor.getField());
        }
 else         if (fieldMetadata instanceof MethodExtractor) {
          MethodExtractor methodExtractor=(MethodExtractor)fieldMetadata;
          extraction=new ThriftMethodExtractor(methodExtractor.getId(),methodExtractor.getName(),methodExtractor.getMethod());
        }
      }
      ThriftFieldMetadata thriftFieldMetadata=new ThriftFieldMetadata(id,type,name,injections.build(),extraction);
      return thriftFieldMetadata;
    }
  }
);
  return new ThriftStructMetadata<>(structName,structClass,builderClass,builderMethodInjection,ImmutableList.copyOf(fieldsMetadata),new ThriftConstructorInjection(constructor.getConstructor(),toThriftParameterInjections(constructor.getParameters())),toThriftMethodInjections(methodInjections));
}