<commit_before>package com.contentful.java.cma.gson;

import com.contentful.java.cma.model.CMAAsset;
import com.contentful.java.cma.model.CMAEntry;
import com.contentful.java.cma.model.CMAResource;
import com.contentful.java.cma.model.CMASystem;
import com.contentful.java.cma.model.CMAType;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

import java.lang.reflect.Type;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import static com.contentful.java.cma.model.CMAType.Link;

/**
 * Serialize an entry from Contentful
 */
public class EntrySerializer implements JsonSerializer<CMAEntry> {
  /**
   * Make sure all fields are mapped in the locale->value way.
   *
   * @param src     the source to be edited.
   * @param type    the type to be used.
   * @param context the json context to be changed.
   * @return a created json element.
   */
  @Override
  public JsonElement serialize(CMAEntry src, Type type, JsonSerializationContext context) {
    JsonObject fields = new JsonObject();
    for (Map.Entry<String, LinkedHashMap<String, Object>> field : src.getFields().entrySet()) {
      LinkedHashMap<String, Object> value = field.getValue();
      if (value == null) {
        continue;
      }
      String fieldId = field.getKey();
      JsonObject jsonField = serializeField(context, field.getValue());
      if (jsonField != null) {
        fields.add(fieldId, jsonField);
      }
    }

    JsonObject result = new JsonObject();
    result.add("fields", fields);

    final CMASystem sys = src.getSystem();
    if (sys != null) {
      result.add("sys", context.serialize(sys));<commit_msg>Fixing wrong use of arrows<commit_after>package com.contentful.java.cma.gson;

import com.contentful.java.cma.model.CMAAsset;
import com.contentful.java.cma.model.CMAEntry;
import com.contentful.java.cma.model.CMAResource;
import com.contentful.java.cma.model.CMASystem;
import com.contentful.java.cma.model.CMAType;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

import java.lang.reflect.Type;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import static com.contentful.java.cma.model.CMAType.Link;

/**
 * Serialize an entry from Contentful
 */
public class EntrySerializer implements JsonSerializer<CMAEntry> {
  /**
   * Make sure all fields are mapped in the locale - value way.
   *
   * @param src     the source to be edited.
   * @param type    the type to be used.
   * @param context the json context to be changed.
   * @return a created json element.
   */
  @Override
  public JsonElement serialize(CMAEntry src, Type type, JsonSerializationContext context) {
    JsonObject fields = new JsonObject();
    for (Map.Entry<String, LinkedHashMap<String, Object>> field : src.getFields().entrySet()) {
      LinkedHashMap<String, Object> value = field.getValue();
      if (value == null) {
        continue;
      }
      String fieldId = field.getKey();
      JsonObject jsonField = serializeField(context, field.getValue());
      if (jsonField != null) {
        fields.add(fieldId, jsonField);
      }
    }

    JsonObject result = new JsonObject();
    result.add("fields", fields);

    final CMASystem sys = src.getSystem();
    if (sys != null) {
      result.add("sys", context.serialize(sys));
{'fraction_non_alphanumeric': 0.11562150055991041, 'fraction_numerical': 0.0, 'mean_word_length': 3.695137976346912, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2495951', 'n_tokens_mistral': 1093, 'n_tokens_neox': 1101, 'n_words': 272}