Program: 7445
Project: 7445
Buggy source:
/** 
 * Creates all   {@link ProcessSpecification} for the process methods of the flowlet class.
 * @param flowletType Type of the flowlet class represented by {@link TypeToken}.
 * @param processMethodFactory A {@link ProcessMethodFactory} for creating {@link ProcessMethod}.
 * @param processSpecFactory A {@link ProcessSpecificationFactory} for creating {@link ProcessSpecification}.
 * @param result A {@link Collection} for storing newly created {@link ProcessSpecification}.
 * @return The same {@link Collection} as the {@code result} parameter.
 */
@SuppressWarnings("String_Node_Str") private Collection<ProcessSpecification> createProcessSpecification(BasicFlowletContext flowletContext,TypeToken<? extends Flowlet> flowletType,ProcessMethodFactory processMethodFactory,ProcessSpecificationFactory processSpecFactory,Collection<ProcessSpecification> result) throws NoSuchMethodException {
  Set<FlowletMethod> seenMethods=Sets.newHashSet();
  for (  TypeToken<?> type : flowletType.getTypes().classes()) {
    if (type.getRawType().equals(Object.class)) {
      break;
    }
    for (    Method method : type.getRawType().getDeclaredMethods()) {
      if (!seenMethods.add(new FlowletMethod(method,flowletType))) {
        continue;
      }
      ProcessInput processInputAnnotation=method.getAnnotation(ProcessInput.class);
      Tick tickAnnotation=method.getAnnotation(Tick.class);
      if (processInputAnnotation == null && tickAnnotation == null) {
        continue;
      }
      int maxRetries=(tickAnnotation == null) ? processInputAnnotation.maxRetries() : tickAnnotation.maxRetries();
      ProcessMethod processMethod=processMethodFactory.create(method,maxRetries);
      Set<String> inputNames;
      Schema schema;
      TypeToken<?> dataType;
      ConsumerConfig consumerConfig;
      int batchSize=1;
      if (tickAnnotation != null) {
        inputNames=ImmutableSet.of();
        consumerConfig=new ConsumerConfig(0,0,1,DequeueStrategy.FIFO,null);
        schema=Schema.of(Schema.Type.NULL);
        dataType=TypeToken.of(void.class);
      }
 else {
        inputNames=Sets.newHashSet(processInputAnnotation.value());
        if (inputNames.isEmpty()) {
          inputNames.add(FlowletDefinition.ANY_INPUT);
        }
        dataType=flowletType.resolveType(method.getGenericParameterTypes()[0]);
        consumerConfig=getConsumerConfig(flowletContext,method);
        Integer processBatchSize=getBatchSize(method);
        if (processBatchSize != null) {
          if (dataType.getRawType().equals(Iterator.class)) {
            Preconditions.checkArgument(dataType.getType() instanceof ParameterizedType,"String_Node_Str");
            dataType=flowletType.resolveType(((ParameterizedType)dataType.getType()).getActualTypeArguments()[0]);
          }
          batchSize=processBatchSize;
        }
        try {
          schema=schemaGenerator.generate(dataType.getType());
        }
 catch (        UnsupportedTypeException e) {
          throw Throwables.propagate(e);
        }
      }
      ProcessSpecification processSpec=processSpecFactory.create(inputNames,schema,dataType,processMethod,consumerConfig,batchSize,tickAnnotation);
      if (processSpec != null) {
        result.add(processSpec);
      }
    }
  }
  Preconditions.checkArgument(!result.isEmpty(),"String_Node_Str" + flowletType);
  return result;
}

Fixed version (ground truth):
/** 
 * Creates all   {@link ProcessSpecification} for the process methods of the flowlet class.
 * @param flowletType Type of the flowlet class represented by {@link TypeToken}.
 * @param processMethodFactory A {@link ProcessMethodFactory} for creating {@link ProcessMethod}.
 * @param processSpecFactory A {@link ProcessSpecificationFactory} for creating {@link ProcessSpecification}.
 * @param result A {@link Collection} for storing newly created {@link ProcessSpecification}.
 * @return The same {@link Collection} as the {@code result} parameter.
 */
@SuppressWarnings("String_Node_Str") private <T extends Collection<ProcessSpecification<?>>>T createProcessSpecification(BasicFlowletContext flowletContext,TypeToken<? extends Flowlet> flowletType,ProcessMethodFactory processMethodFactory,ProcessSpecificationFactory processSpecFactory,T result) throws NoSuchMethodException {
  Set<FlowletMethod> seenMethods=Sets.newHashSet();
  for (  TypeToken<?> type : flowletType.getTypes().classes()) {
    if (type.getRawType().equals(Object.class)) {
      break;
    }
    for (    Method method : type.getRawType().getDeclaredMethods()) {
      if (!seenMethods.add(new FlowletMethod(method,flowletType))) {
        continue;
      }
      ProcessInput processInputAnnotation=method.getAnnotation(ProcessInput.class);
      Tick tickAnnotation=method.getAnnotation(Tick.class);
      if (processInputAnnotation == null && tickAnnotation == null) {
        continue;
      }
      int maxRetries=(tickAnnotation == null) ? processInputAnnotation.maxRetries() : tickAnnotation.maxRetries();
      ProcessMethod processMethod=processMethodFactory.create(method,maxRetries);
      Set<String> inputNames;
      Schema schema;
      TypeToken<?> dataType;
      ConsumerConfig consumerConfig;
      int batchSize=1;
      if (tickAnnotation != null) {
        inputNames=ImmutableSet.of();
        consumerConfig=new ConsumerConfig(0,0,1,DequeueStrategy.FIFO,null);
        schema=Schema.of(Schema.Type.NULL);
        dataType=TypeToken.of(void.class);
      }
 else {
        inputNames=Sets.newHashSet(processInputAnnotation.value());
        if (inputNames.isEmpty()) {
          inputNames.add(FlowletDefinition.ANY_INPUT);
        }
        dataType=flowletType.resolveType(method.getGenericParameterTypes()[0]);
        consumerConfig=getConsumerConfig(flowletContext,method);
        Integer processBatchSize=getBatchSize(method);
        if (processBatchSize != null) {
          if (dataType.getRawType().equals(Iterator.class)) {
            Preconditions.checkArgument(dataType.getType() instanceof ParameterizedType,"String_Node_Str");
            dataType=flowletType.resolveType(((ParameterizedType)dataType.getType()).getActualTypeArguments()[0]);
          }
          batchSize=processBatchSize;
        }
        try {
          schema=schemaGenerator.generate(dataType.getType());
        }
 catch (        UnsupportedTypeException e) {
          throw Throwables.propagate(e);
        }
      }
      ProcessSpecification processSpec=processSpecFactory.create(inputNames,schema,dataType,processMethod,consumerConfig,batchSize,tickAnnotation);
      if (processSpec != null) {
        result.add(processSpec);
      }
    }
  }
  Preconditions.checkArgument(!result.isEmpty(),"String_Node_Str" + flowletType);
  return result;
}