Program: 53507
Project: 53507
Buggy source:
@SuppressWarnings("String_Node_Str") private Object resolveAnnotationValue(TreeLogger logger,Class<?> expectedType,Object value){
  if (expectedType.isArray()) {
    Class<?> componentType=expectedType.getComponentType();
    if (!value.getClass().isArray()) {
      logger.log(TreeLogger.WARN,"String_Node_Str" + componentType.getCanonicalName() + "String_Node_Str"+ value.getClass().getCanonicalName());
      return null;
    }
    if (componentType.isPrimitive()) {
      return value;
    }
    int n=Array.getLength(value);
    Object newArray=Array.newInstance(componentType,n);
    for (int i=0; i < n; ++i) {
      Object valueElement=Array.get(value,i);
      Object resolvedValue=resolveAnnotationValue(logger,componentType,valueElement);
      if (resolvedValue == null || !componentType.isAssignableFrom(resolvedValue.getClass())) {
        logger.log(TreeLogger.ERROR,"String_Node_Str" + componentType + "String_Node_Str"+ resolvedValue);
      }
 else {
        Array.set(newArray,i,resolvedValue);
      }
    }
    return newArray;
  }
 else   if (expectedType.isEnum()) {
    if (!(value instanceof AnnotationEnum)) {
      logger.log(TreeLogger.ERROR,"String_Node_Str" + "String_Node_Str" + value);
      return null;
    }
    AnnotationEnum annotEnum=(AnnotationEnum)value;
    Class<? extends Enum> enumType=expectedType.asSubclass(Enum.class);
    try {
      return Enum.valueOf(enumType,annotEnum.getValue());
    }
 catch (    IllegalArgumentException e) {
      logger.log(TreeLogger.WARN,"String_Node_Str" + annotEnum.getValue() + "String_Node_Str"+ enumType.getName()+ "String_Node_Str");
      return null;
    }
  }
 else   if (Annotation.class.isAssignableFrom(expectedType)) {
    if (!(value instanceof AnnotationData)) {
      logger.log(TreeLogger.WARN,"String_Node_Str" + expectedType.getCanonicalName() + "String_Node_Str"+ value.getClass().getCanonicalName());
      return null;
    }
    AnnotationData annotData=(AnnotationData)value;
    Class<? extends Annotation> annotationClass=getAnnotationClass(logger,annotData);
    if (!expectedType.isAssignableFrom(annotationClass)) {
      logger.log(TreeLogger.WARN,"String_Node_Str" + expectedType.getCanonicalName() + "String_Node_Str"+ annotationClass.getCanonicalName());
      return null;
    }
    return createAnnotation(logger,annotationClass,annotData);
  }
 else   if (expectedType.isPrimitive()) {
    Class<?> wrapper=getWrapperClass(expectedType);
    return wrapper.cast(value);
  }
 else {
    if (expectedType.isAssignableFrom(value.getClass())) {
      return value;
    }
    if (Class.class.equals(expectedType)) {
      if (!(value instanceof Type)) {
        logger.log(TreeLogger.WARN,"String_Node_Str" + "String_Node_Str" + value);
        return null;
      }
      Type valueType=(Type)value;
      try {
        return forName(valueType.getClassName());
      }
 catch (      ClassNotFoundException e) {
        logger.log(TreeLogger.ERROR,"String_Node_Str" + valueType.getClassName(),e);
        return null;
      }
    }
    return value;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private Object resolveAnnotationValue(TreeLogger logger,Class<?> expectedType,Object value){
  if (expectedType.isArray()) {
    Class<?> componentType=expectedType.getComponentType();
    if (!value.getClass().isArray()) {
      logger.log(TreeLogger.WARN,"String_Node_Str" + componentType.getCanonicalName() + "String_Node_Str"+ value.getClass().getCanonicalName());
      return null;
    }
    if (componentType.isPrimitive()) {
      return value;
    }
    int n=Array.getLength(value);
    Object newArray=Array.newInstance(componentType,n);
    for (int i=0; i < n; ++i) {
      Object valueElement=Array.get(value,i);
      Object resolvedValue=resolveAnnotationValue(logger,componentType,valueElement);
      if (resolvedValue == null || !componentType.isAssignableFrom(resolvedValue.getClass())) {
        logger.log(TreeLogger.ERROR,"String_Node_Str" + componentType + "String_Node_Str"+ resolvedValue);
      }
 else {
        Array.set(newArray,i,resolvedValue);
      }
    }
    return newArray;
  }
 else   if (expectedType.isEnum()) {
    if (!(value instanceof AnnotationEnum)) {
      logger.log(TreeLogger.ERROR,"String_Node_Str" + "String_Node_Str" + value);
      return null;
    }
    AnnotationEnum annotEnum=(AnnotationEnum)value;
    Class<? extends Enum> enumType=expectedType.asSubclass(Enum.class);
    try {
      return Enum.valueOf(enumType,annotEnum.getValue());
    }
 catch (    IllegalArgumentException e) {
      logger.log(TreeLogger.WARN,"String_Node_Str" + annotEnum.getValue() + "String_Node_Str"+ enumType.getName()+ "String_Node_Str");
      return null;
    }
  }
 else   if (Annotation.class.isAssignableFrom(expectedType)) {
    if (!(value instanceof AnnotationData)) {
      logger.log(TreeLogger.WARN,"String_Node_Str" + expectedType.getCanonicalName() + "String_Node_Str"+ value.getClass().getCanonicalName());
      return null;
    }
    AnnotationData annotData=(AnnotationData)value;
    Class<? extends Annotation> annotationClass=getAnnotationClass(logger,annotData);
    if (!expectedType.isAssignableFrom(annotationClass)) {
      logger.log(TreeLogger.WARN,"String_Node_Str" + expectedType.getCanonicalName() + "String_Node_Str"+ annotationClass.getCanonicalName());
      return null;
    }
    return createAnnotation(logger,annotationClass,annotData);
  }
 else   if (expectedType.isPrimitive()) {
    Class<?> wrapper=getWrapperClass(expectedType);
    return wrapper.cast(value);
  }
 else {
    if (expectedType.isAssignableFrom(value.getClass())) {
      return value;
    }
    if (Class.class.equals(expectedType)) {
      if (!(value instanceof Type)) {
        logger.log(TreeLogger.WARN,"String_Node_Str" + "String_Node_Str" + value);
        return null;
      }
      Type valueType=(Type)value;
      try {
        return forName(valueType.getClassName());
      }
 catch (      ClassNotFoundException e) {
        logger.log(TreeLogger.WARN,"String_Node_Str" + valueType.getClassName());
        return null;
      }
    }
    return value;
  }
}