Program: 9938
Project: 9938
Buggy source:
private Component toComponentConfig(ComponentConfig annotation,Class<?> clazz) throws Exception {
  Component config=new Component();
  if (annotation.id().length() > 0) {
    config.setId(annotation.id());
  }
  Class<?> type=annotation.type() == void.class ? clazz : annotation.type();
  config.setType(type.getName());
  if (annotation.template().length() > 0) {
    config.setTemplate(annotation.template());
  }
  if (annotation.lifecycle() != void.class) {
    config.setLifecycle(annotation.lifecycle().getName());
  }
  if (annotation.decorator().length() > 0) {
    config.setDecorator(annotation.decorator());
  }
  config.setInitParams(toInitParams(annotation.initParams()));
  EventConfig[] eventAnnotations=annotation.events();
  List<Event> events;
  if (eventAnnotations.length != 0) {
    events=new ArrayList<Event>();
    for (    EventConfig eventAnnotation : eventAnnotations) {
      events.add(toEventConfig(eventAnnotation));
    }
  }
 else {
    events=Collections.emptyList();
  }
  config.setEvents(events);
  EventInterceptorConfig[] eventInterceptorAnnotations=annotation.eventInterceptors();
  List<EventInterceptor> eventInterceptors;
  if (eventInterceptorAnnotations.length != 0) {
    eventInterceptors=new ArrayList<EventInterceptor>();
    for (    EventInterceptorConfig eventAnnotation : eventInterceptorAnnotations) {
      eventInterceptors.add(toEventInterceptorConfig(eventAnnotation));
    }
  }
 else {
    eventInterceptors=Collections.emptyList();
  }
  config.setEventInterceptors(eventInterceptors);
  ValidatorConfig[] validatorAnnotations=annotation.validators();
  List<Validator> validators;
  if (validatorAnnotations.length != 0) {
    validators=new ArrayList<Validator>();
    for (    ValidatorConfig ele : validatorAnnotations) {
      validators.add(toValidator(ele));
    }
  }
 else {
    validators=Collections.emptyList();
  }
  config.setValidators(validators);
  return config;
}

Fixed version (ground truth):
private Component toComponentConfig(ComponentConfig annotation,Class<?> clazz) throws Exception {
  Component config=new Component();
  if (annotation.id().length() > 0) {
    config.setId(annotation.id());
  }
  Class<?> type=annotation.type() == void.class ? clazz : annotation.type();
  config.setType(type.getName());
  if (annotation.template().length() > 0) {
    config.setTemplate(annotation.template());
  }
  if (annotation.lifecycle() != void.class) {
    config.setLifecycle(annotation.lifecycle().getName());
  }
  if (annotation.decorator().length() > 0) {
    config.setDecorator(annotation.decorator());
  }
  config.setInitParams(toInitParams(annotation.initParams()));
  EventConfig[] eventAnnotations=annotation.events();
  ArrayList<Event> events;
  if (eventAnnotations.length != 0) {
    events=new ArrayList<Event>();
    for (    EventConfig eventAnnotation : eventAnnotations) {
      events.add(toEventConfig(eventAnnotation));
    }
  }
 else {
    events=new ArrayList<Event>();
  }
  config.setEvents(events);
  EventInterceptorConfig[] eventInterceptorAnnotations=annotation.eventInterceptors();
  ArrayList<EventInterceptor> eventInterceptors;
  if (eventInterceptorAnnotations.length != 0) {
    eventInterceptors=new ArrayList<EventInterceptor>();
    for (    EventInterceptorConfig eventAnnotation : eventInterceptorAnnotations) {
      eventInterceptors.add(toEventInterceptorConfig(eventAnnotation));
    }
  }
 else {
    eventInterceptors=new ArrayList<EventInterceptor>();
  }
  config.setEventInterceptors(eventInterceptors);
  ValidatorConfig[] validatorAnnotations=annotation.validators();
  ArrayList<Validator> validators;
  if (validatorAnnotations.length != 0) {
    validators=new ArrayList<Validator>();
    for (    ValidatorConfig ele : validatorAnnotations) {
      validators.add(toValidator(ele));
    }
  }
 else {
    validators=new ArrayList<Validator>();
  }
  config.setValidators(validators);
  return config;
}