<commit_before>package org.realityforge.replicant.client.json.gwt;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsonUtils;
import org.realityforge.replicant.client.Change;
import org.realityforge.replicant.client.ChangeSet;

/**
 * An overlay type representing the change set received from the client.
 */
public final class JsoChangeSet
  extends JavaScriptObject
  implements ChangeSet
{
  protected JsoChangeSet()
  {
  }

  @Override
  public final native int getSequence() /*-{
    return this.last_id;
  }-*/;

  @Override
  public final native int getChangeCount()/*-{
    return this.changes.length;
  }-*/;

  @Override
  public final Change getChange( final int index )
  {
    return getChange0( index );
  }

  private native JsoChange getChange0( final int index )/*-{
    return this.changes[ index ];
  }-*/;

  //public static native JsoChangeSet asChangeSet( String json ) /*-{
  //  return eval( '(' + json + ')' );
  //}-*/;

  public static ChangeSet asChangeSet( final String json )
  {
    return asChangeSet0( json );
  }<commit_msg>Remove commented out guff<commit_after>package org.realityforge.replicant.client.json.gwt;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsonUtils;
import org.realityforge.replicant.client.Change;
import org.realityforge.replicant.client.ChangeSet;

/**
 * An overlay type representing the change set received from the client.
 */
public final class JsoChangeSet
  extends JavaScriptObject
  implements ChangeSet
{
  protected JsoChangeSet()
  {
  }

  @Override
  public final native int getSequence() /*-{
    return this.last_id;
  }-*/;

  @Override
  public final native int getChangeCount()/*-{
    return this.changes.length;
  }-*/;

  @Override
  public final Change getChange( final int index )
  {
    return getChange0( index );
  }

  private native JsoChange getChange0( final int index )/*-{
    return this.changes[ index ];
  }-*/;

  public static ChangeSet asChangeSet( final String json )
  {
    return asChangeSet0( json );
  }
{'fraction_non_alphanumeric': 0.1111111111111111, 'fraction_numerical': 0.0028735632183908046, 'mean_word_length': 3.571115973741794, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3438659', 'n_tokens_mistral': 671, 'n_tokens_neox': 641, 'n_words': 169}