<commit_before>interface MenuItem {
  content: string;
  title?: string;
  isValid?: (Workspace) => any;
  isActive?: (Workspace) => bool;
  href: () => any;
}


class Workspace {
  public operationCounter = 0;
  public selection:NodeSelection;
  public tree:any = new Folder('MBeans');
  public treeResponse = {};
  public mbeanTypesToDomain = {};
  public mbeanServicesToDomain = {};
  public attributeColumnDefs = {};
  public treePostProcessors = [];
  public topLevelTabs = [];
  public subLevelTabs = [];
  public keyToNodeMap = {};
  public pluginRegisterHandle = null;
  public pluginUpdateCounter = null;
  public treeWatchRegisterHandle = null;
  public treeWatcherCounter = null;
  public treeElement = null;
  public connectFailure = null;

  constructor(public jolokia,
              public jmxTreeLazyLoadRegistry,
              public $location,
              public $compile:ng.ICompileService,
              public $templateCache:ng.ITemplateCacheService, 
              public localStorage:WindowLocalStorage,
              public $rootScope) {

  }

  /**
   * Creates a shallow copy child workspace with its own selection and location
   */
  public createChildWorkspace(location): Workspace {
    var child = new Workspace(this.jolokia, this.jmxTreeLazyLoadRegistry, this.$location, this.$compile, this.$templateCache, this.localStorage, this.$rootScope);
    // lets copy across all the properties just in case
    angular.forEach(this, (value, key) => child[key] = value);
    child.$location = location;
    return child;
  }

  getLocalStorage(key:string) {
    return this.localStorage[key];
  }

  setLocalStorage(key:string, value:any) {
    this.localStorage[key] = value;
  }

  public loadTree() {
    // Make an initial blocking call to ensure the JMX tree is populated while the
    // app is initializing...
    var initialLoadError = (response) => {
      console.log("Initial load failed: " + response);
      this.connectFailure = response;
      Core.$apply(this.$rootScope);
    };

    var flags = {error: initialLoadError, ajaxError: initialLoadError, maxDepth: 2};
    var data = this.jolokia.list(null, onSuccess(null, flags));

    if (data) {
      this.connectFailure = null;<commit_msg>Disable connect error dialog until we figure out a fix for #479<commit_after>interface MenuItem {
  content: string;
  title?: string;
  isValid?: (Workspace) => any;
  isActive?: (Workspace) => bool;
  href: () => any;
}


class Workspace {
  public operationCounter = 0;
  public selection:NodeSelection;
  public tree:any = new Folder('MBeans');
  public treeResponse = {};
  public mbeanTypesToDomain = {};
  public mbeanServicesToDomain = {};
  public attributeColumnDefs = {};
  public treePostProcessors = [];
  public topLevelTabs = [];
  public subLevelTabs = [];
  public keyToNodeMap = {};
  public pluginRegisterHandle = null;
  public pluginUpdateCounter = null;
  public treeWatchRegisterHandle = null;
  public treeWatcherCounter = null;
  public treeElement = null;
  public connectFailure = null;

  constructor(public jolokia,
              public jmxTreeLazyLoadRegistry,
              public $location,
              public $compile:ng.ICompileService,
              public $templateCache:ng.ITemplateCacheService, 
              public localStorage:WindowLocalStorage,
              public $rootScope) {

  }

  /**
   * Creates a shallow copy child workspace with its own selection and location
   */
  public createChildWorkspace(location): Workspace {
    var child = new Workspace(this.jolokia, this.jmxTreeLazyLoadRegistry, this.$location, this.$compile, this.$templateCache, this.localStorage, this.$rootScope);
    // lets copy across all the properties just in case
    angular.forEach(this, (value, key) => child[key] = value);
    child.$location = location;
    return child;
  }

  getLocalStorage(key:string) {
    return this.localStorage[key];
  }

  setLocalStorage(key:string, value:any) {
    this.localStorage[key] = value;
  }

  public loadTree() {
    // Make an initial blocking call to ensure the JMX tree is populated while the
    // app is initializing...
    var initialLoadError = (response) => {
      console.log("Initial load failed: " + response);
      this.connectFailure = response;
      Core.$apply(this.$rootScope);
    };

    //var flags = {error: initialLoadError, ajaxError: initialLoadError, maxDepth: 2};
    var flags = {maxDepth: 2};
    var data = this.jolokia.list(null, onSuccess(null, flags));

    if (data) {
      this.connectFailure = null;
{'fraction_non_alphanumeric': 0.10683666739942844, 'fraction_numerical': 0.0017586282699494395, 'mean_word_length': 3.396135265700483, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '3865636', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1273, 'n_words': 352}