Program: 2509
Project: 2509
Buggy source:
private static void exportFields(Context context,Object view,BufferedWriter out,Class<?> klass,String prefix) throws IOException {
  final Field[] fields=getExportedPropertyFields(klass);
  int count=fields.length;
  for (int i=0; i < count; i++) {
    final Field field=fields[i];
    try {
      Object fieldValue=null;
      final Class<?> type=field.getType();
      final ExportedProperty property=sAnnotations.get(field);
      String categoryPrefix=property.category().length() != 0 ? property.category() + "String_Node_Str" : "String_Node_Str";
      if (type == int.class) {
        if (property.resolveId() && context != null) {
          final int id=field.getInt(view);
          fieldValue=resolveId(context,id);
        }
 else {
          final FlagToString[] flagsMapping=property.flagMapping();
          if (flagsMapping.length > 0) {
            final int intValue=field.getInt(view);
            final String valuePrefix=categoryPrefix + prefix + field.getName()+ '_';
            exportUnrolledFlags(out,flagsMapping,intValue,valuePrefix);
          }
          final IntToString[] mapping=property.mapping();
          if (mapping.length > 0) {
            final int intValue=field.getInt(view);
            int mappingCount=mapping.length;
            for (int j=0; j < mappingCount; j++) {
              final IntToString mapped=mapping[j];
              if (mapped.from() == intValue) {
                fieldValue=mapped.to();
                break;
              }
            }
            if (fieldValue == null) {
              fieldValue=intValue;
            }
          }
        }
      }
 else       if (type == int[].class) {
        final int[] array=(int[])field.get(view);
        final String valuePrefix=categoryPrefix + prefix + field.getName()+ '_';
        final String suffix="String_Node_Str";
        exportUnrolledArray(context,out,property,array,valuePrefix,suffix);
        return;
      }
 else       if (!type.isPrimitive()) {
        if (property.deepExport()) {
          dumpViewProperties(context,field.get(view),out,prefix + property.prefix());
          continue;
        }
      }
      if (fieldValue == null) {
        fieldValue=field.get(view);
      }
      writeEntry(out,categoryPrefix + prefix,field.getName(),"String_Node_Str",fieldValue);
    }
 catch (    IllegalAccessException e) {
    }
  }
}

Fixed version (ground truth):
private static void exportFields(Context context,Object view,BufferedWriter out,Class<?> klass,String prefix) throws IOException {
  final Field[] fields=getExportedPropertyFields(klass);
  int count=fields.length;
  for (int i=0; i < count; i++) {
    final Field field=fields[i];
    try {
      Object fieldValue=null;
      final Class<?> type=field.getType();
      final ExportedProperty property=sAnnotations.get(field);
      String categoryPrefix=property.category().length() != 0 ? property.category() + "String_Node_Str" : "String_Node_Str";
      if (type == int.class || type == byte.class) {
        if (property.resolveId() && context != null) {
          final int id=field.getInt(view);
          fieldValue=resolveId(context,id);
        }
 else {
          final FlagToString[] flagsMapping=property.flagMapping();
          if (flagsMapping.length > 0) {
            final int intValue=field.getInt(view);
            final String valuePrefix=categoryPrefix + prefix + field.getName()+ '_';
            exportUnrolledFlags(out,flagsMapping,intValue,valuePrefix);
          }
          final IntToString[] mapping=property.mapping();
          if (mapping.length > 0) {
            final int intValue=field.getInt(view);
            int mappingCount=mapping.length;
            for (int j=0; j < mappingCount; j++) {
              final IntToString mapped=mapping[j];
              if (mapped.from() == intValue) {
                fieldValue=mapped.to();
                break;
              }
            }
            if (fieldValue == null) {
              fieldValue=intValue;
            }
          }
        }
      }
 else       if (type == int[].class) {
        final int[] array=(int[])field.get(view);
        final String valuePrefix=categoryPrefix + prefix + field.getName()+ '_';
        final String suffix="String_Node_Str";
        exportUnrolledArray(context,out,property,array,valuePrefix,suffix);
        return;
      }
 else       if (!type.isPrimitive()) {
        if (property.deepExport()) {
          dumpViewProperties(context,field.get(view),out,prefix + property.prefix());
          continue;
        }
      }
      if (fieldValue == null) {
        fieldValue=field.get(view);
      }
      writeEntry(out,categoryPrefix + prefix,field.getName(),"String_Node_Str",fieldValue);
    }
 catch (    IllegalAccessException e) {
    }
  }
}