Program: 85556
Project: 85556
Buggy source:
private EventTypeMetadata(Class<T> eventClass){
  Preconditions.checkNotNull(eventClass,"String_Node_Str");
  this.eventClass=eventClass;
  String typeName=eventClass.getSimpleName();
  if (!eventClass.isAnnotationPresent(EventType.class)) {
    addError("String_Node_Str",eventClass.getName(),EventType.class.getSimpleName());
  }
 else {
    EventType typeAnnotation=eventClass.getAnnotation(EventType.class);
    if (!typeAnnotation.value().isEmpty()) {
      typeName=typeAnnotation.value();
    }
  }
  this.typeName=typeName;
  List<EventFieldMetadata> uuidFields=newArrayList();
  List<EventFieldMetadata> timestampFields=newArrayList();
  List<EventFieldMetadata> hostFields=newArrayList();
  Map<String,EventFieldMetadata> fields=newTreeMap();
  for (  Method method : findAnnotatedMethods(eventClass,EventField.class)) {
    if (method.getParameterTypes().length != 0) {
      addError("String_Node_Str",EventField.class.getSimpleName(),method.toGenericString());
      continue;
    }
    EventDataType eventDataType=EventDataType.byType.get(method.getReturnType());
    if (eventDataType == null) {
      addError("String_Node_Str",EventField.class.getSimpleName(),method.toGenericString(),method.getReturnType());
      continue;
    }
    EventField eventField=method.getAnnotation(EventField.class);
    String fieldName=eventField.value();
    if (fieldName.isEmpty()) {
      String methodName=method.getName();
      if (methodName.length() > 3 && methodName.startsWith("String_Node_Str")) {
        fieldName=methodName.substring(3);
      }
 else       if (methodName.length() > 2 && methodName.startsWith("String_Node_Str")) {
        fieldName=methodName.substring(2);
      }
 else {
        fieldName=methodName;
      }
    }
    if (fields.containsKey(fieldName)) {
      addError("String_Node_Str",eventClass.getName(),EventField.class.getSimpleName(),fieldName);
      continue;
    }
    EventFieldMetadata eventFieldMetadata=new EventFieldMetadata(fieldName,method,EventDataType.byType.get(method.getReturnType()));
switch (eventField.fieldMapping()) {
case HOST:
      hostFields.add(eventFieldMetadata);
    break;
case TIMESTAMP:
  timestampFields.add(eventFieldMetadata);
break;
case UUID:
uuidFields.add(eventFieldMetadata);
break;
default :
fields.put(fieldName,eventFieldMetadata);
break;
}
}
for (Class<?> clazz=eventClass; (clazz != null) && !clazz.equals(Object.class); clazz=clazz.getSuperclass()) {
for (Method method : clazz.getDeclaredMethods()) {
if (method.isAnnotationPresent(EventField.class)) {
if (!Modifier.isPublic(method.getModifiers())) {
addError("String_Node_Str",EventField.class.getSimpleName(),method.toGenericString());
}
if (Modifier.isStatic(method.getModifiers())) {
addError("String_Node_Str",EventField.class.getSimpleName(),method.toGenericString());
}
}
}
}
if (!uuidFields.isEmpty() && uuidFields.size() > 1) {
addError("String_Node_Str",eventClass.getName(),EventField.class.getSimpleName(),EventField.EventFieldMapping.UUID);
}
this.uuidField=Iterables.getFirst(uuidFields,null);
if (!timestampFields.isEmpty() && timestampFields.size() > 1) {
addError("String_Node_Str",eventClass.getName(),EventField.class.getSimpleName(),EventField.EventFieldMapping.TIMESTAMP);
}
this.timestampField=Iterables.getFirst(timestampFields,null);
if (!hostFields.isEmpty() && hostFields.size() > 1) {
addError("String_Node_Str",eventClass.getName(),EventField.class.getSimpleName(),EventField.EventFieldMapping.HOST);
}
this.hostField=Iterables.getFirst(hostFields,null);
this.fields=ImmutableMap.copyOf(fields);
if (getErrors().isEmpty() && this.fields.isEmpty()) {
addError("String_Node_Str",eventClass.getName(),EventField.class.getSimpleName());
}
}

Fixed version (ground truth):
private EventTypeMetadata(Class<T> eventClass){
  Preconditions.checkNotNull(eventClass,"String_Node_Str");
  this.eventClass=eventClass;
  String typeName=eventClass.getSimpleName();
  if (!eventClass.isAnnotationPresent(EventType.class)) {
    addError("String_Node_Str",eventClass.getName(),EventType.class.getSimpleName());
  }
 else {
    EventType typeAnnotation=eventClass.getAnnotation(EventType.class);
    if (!typeAnnotation.value().isEmpty()) {
      typeName=typeAnnotation.value();
    }
  }
  this.typeName=typeName;
  List<EventFieldMetadata> uuidFields=newArrayList();
  List<EventFieldMetadata> timestampFields=newArrayList();
  List<EventFieldMetadata> hostFields=newArrayList();
  Map<String,EventFieldMetadata> fields=newTreeMap();
  for (  Method method : findAnnotatedMethods(eventClass,EventField.class)) {
    if (method.getParameterTypes().length != 0) {
      addError("String_Node_Str",EventField.class.getSimpleName(),method.toGenericString());
      continue;
    }
    EventDataType eventDataType=EventDataType.byType.get(method.getReturnType());
    if (eventDataType == null) {
      addError("String_Node_Str",EventField.class.getSimpleName(),method.toGenericString(),method.getReturnType());
      continue;
    }
    EventField eventField=method.getAnnotation(EventField.class);
    String fieldName=eventField.value();
    if (fieldName.isEmpty()) {
      String methodName=method.getName();
      if (methodName.length() > 3 && methodName.startsWith("String_Node_Str")) {
        fieldName=methodName.substring(3);
      }
 else       if (methodName.length() > 2 && methodName.startsWith("String_Node_Str")) {
        fieldName=methodName.substring(2);
      }
 else {
        fieldName=methodName;
      }
    }
    if (fields.containsKey(fieldName)) {
      addError("String_Node_Str",eventClass.getName(),EventField.class.getSimpleName(),fieldName);
      continue;
    }
    EventFieldMetadata eventFieldMetadata=new EventFieldMetadata(fieldName,method,EventDataType.byType.get(method.getReturnType()));
switch (eventField.fieldMapping()) {
case HOST:
      hostFields.add(eventFieldMetadata);
    break;
case TIMESTAMP:
  timestampFields.add(eventFieldMetadata);
break;
case UUID:
uuidFields.add(eventFieldMetadata);
break;
case DATA:
fields.put(fieldName,eventFieldMetadata);
break;
default :
throw new AssertionError("String_Node_Str" + eventField.fieldMapping());
}
}
for (Class<?> clazz=eventClass; (clazz != null) && !clazz.equals(Object.class); clazz=clazz.getSuperclass()) {
for (Method method : clazz.getDeclaredMethods()) {
if (method.isAnnotationPresent(EventField.class)) {
if (!Modifier.isPublic(method.getModifiers())) {
addError("String_Node_Str",EventField.class.getSimpleName(),method.toGenericString());
}
if (Modifier.isStatic(method.getModifiers())) {
addError("String_Node_Str",EventField.class.getSimpleName(),method.toGenericString());
}
}
}
}
if (!uuidFields.isEmpty() && uuidFields.size() > 1) {
addError("String_Node_Str",eventClass.getName(),EventField.class.getSimpleName(),EventField.EventFieldMapping.UUID);
}
this.uuidField=Iterables.getFirst(uuidFields,null);
if (!timestampFields.isEmpty() && timestampFields.size() > 1) {
addError("String_Node_Str",eventClass.getName(),EventField.class.getSimpleName(),EventField.EventFieldMapping.TIMESTAMP);
}
this.timestampField=Iterables.getFirst(timestampFields,null);
if (!hostFields.isEmpty() && hostFields.size() > 1) {
addError("String_Node_Str",eventClass.getName(),EventField.class.getSimpleName(),EventField.EventFieldMapping.HOST);
}
this.hostField=Iterables.getFirst(hostFields,null);
this.fields=ImmutableMap.copyOf(fields);
if (getErrors().isEmpty() && this.fields.isEmpty()) {
addError("String_Node_Str",eventClass.getName(),EventField.class.getSimpleName());
}
}