<commit_before>package org.waveprotocol.mod.wavejs.js.generic;


import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;

import org.waveprotocol.mod.model.generic.MapType;
import org.waveprotocol.mod.model.generic.Type;
import org.waveprotocol.mod.wavejs.WaveJSUtils;


public class MapTypeJS extends JavaScriptObject implements MapType.Listener {



  public native static MapTypeJS create(MapType delegate) /*-{

  var jso = {

       _delegate: delegate,

       callbackMap: new Object(),

       eventHandlers: new Object(),

       registerEventHandler: function(event, handler) {
          this.eventHandlers[event] = handler;
       },

       unregisterEventHandler: function(event, handler) {
          this.eventHandlers[event] = null;
       },

       getDelegate: function() {
         return this._delegate;
       },

       get: function(key) {

         var _value = delegate.@org.waveprotocol.mod.model.generic.MapType::get(Ljava/lang/String;)(key);
         if (_value == null)
             return undefined;

         return @org.waveprotocol.mod.wavejs.js.generic.AdapterTypeJS::adapt(Lorg/waveprotocol/mod/model/generic/Type;)(_value);
       },

       put: function(key, value) {

          // Direct String creation
          if (typeof value === "string")  {

            var _value = delegate.@org.waveprotocol.mod.model.generic.MapType::put(Ljava/lang/String;Ljava/lang/String;)(key, value);
            if (_value == null)
              return undefined;

            return @org.waveprotocol.mod.wavejs.js.generic.AdapterTypeJS::adapt(Lorg/waveprotocol/mod/model/generic/Type;)(_value);

          } else {

            var _value = value.getDelegate();

            if (_value === "undefined" || _value == null)
              return undefined;

            _value = delegate.@org.waveprotocol.mod.model.generic.MapType::put(Ljava/lang/String;Lorg/waveprotocol/mod/model/generic/Type;)(key, _value);

            return @org.waveprotocol.mod.wavejs.js.generic.AdapterTypeJS::adapt(Lorg/waveprotocol/mod/model/generic/Type;)(_value);

          }
       },

       keySet: function() {
          var _keyset = delegate.@org.waveprotocol.mod.model.generic.MapType::keySet()();
          return @org.waveprotocol.mod.wavejs.WaveJSUtils::stringIterableToJs(Ljava/lang/Iterable;)(_keyset)
       },

       remove: function(key) {
          delegate.@org.waveprotocol.mod.model.generic.MapType::remove(Ljava/lang/String;)(key);
       }
<commit_msg>Added missing semicolon<commit_after>package org.waveprotocol.mod.wavejs.js.generic;


import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;

import org.waveprotocol.mod.model.generic.MapType;
import org.waveprotocol.mod.model.generic.Type;
import org.waveprotocol.mod.wavejs.WaveJSUtils;


public class MapTypeJS extends JavaScriptObject implements MapType.Listener {



  public native static MapTypeJS create(MapType delegate) /*-{

  var jso = {

       _delegate: delegate,

       callbackMap: new Object(),

       eventHandlers: new Object(),

       registerEventHandler: function(event, handler) {
          this.eventHandlers[event] = handler;
       },

       unregisterEventHandler: function(event, handler) {
          this.eventHandlers[event] = null;
       },

       getDelegate: function() {
         return this._delegate;
       },

       get: function(key) {

         var _value = delegate.@org.waveprotocol.mod.model.generic.MapType::get(Ljava/lang/String;)(key);
         if (_value == null)
             return undefined;

         return @org.waveprotocol.mod.wavejs.js.generic.AdapterTypeJS::adapt(Lorg/waveprotocol/mod/model/generic/Type;)(_value);
       },

       put: function(key, value) {

          // Direct String creation
          if (typeof value === "string")  {

            var _value = delegate.@org.waveprotocol.mod.model.generic.MapType::put(Ljava/lang/String;Ljava/lang/String;)(key, value);
            if (_value == null)
              return undefined;

            return @org.waveprotocol.mod.wavejs.js.generic.AdapterTypeJS::adapt(Lorg/waveprotocol/mod/model/generic/Type;)(_value);

          } else {

            var _value = value.getDelegate();

            if (_value === "undefined" || _value == null)
              return undefined;

            _value = delegate.@org.waveprotocol.mod.model.generic.MapType::put(Ljava/lang/String;Lorg/waveprotocol/mod/model/generic/Type;)(key, _value);

            return @org.waveprotocol.mod.wavejs.js.generic.AdapterTypeJS::adapt(Lorg/waveprotocol/mod/model/generic/Type;)(_value);

          }
       },

       keySet: function() {
          var _keyset = delegate.@org.waveprotocol.mod.model.generic.MapType::keySet()();
          return @org.waveprotocol.mod.wavejs.WaveJSUtils::stringIterableToJs(Ljava/lang/Iterable;)(_keyset);
       },

       remove: function(key) {
          delegate.@org.waveprotocol.mod.model.generic.MapType::remove(Ljava/lang/String;)(key);
       }

{'fraction_non_alphanumeric': 0.12914104344376115, 'fraction_numerical': 0.0, 'mean_word_length': 2.7486988847583644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 10, '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': '4737541', 'n_tokens_mistral': 1527, 'n_tokens_neox': 1470, 'n_words': 218}