<commit_before>package edu.agh.mindmap.model

import scala.collection.mutable
import java.util.UUID

class MindNode private(val uuid: UUID,
                       val map: MindMap,
                       var parent: Option[MindNode],
                       var content: Option[String],
                       var hasConflict: Boolean,
                       var cloudTime: Option[Long]) {

  def children = _children.readOnly

  private val _children = new mutable.ArrayBuffer[MindNode]

}

object MindNode {

  def findRootOf(map: MindMap): MindNode = ???

  def create(map: MindMap) =
    new MindNode(UUID.randomUUID, map, None, None, false, None)

  def create(parent: MindNode) = {
    val child = new MindNode(UUID.randomUUID, parent.map, Some(parent), None, false, None)
    parent._children += child
    child
  }

}<commit_msg>Make MindNode's children an immutable *copy* instead<commit_after>package edu.agh.mindmap.model

import scala.collection.mutable
import java.util.UUID

class MindNode private(val uuid: UUID,
                       val map: MindMap,
                       var parent: Option[MindNode],
                       var content: Option[String],
                       var hasConflict: Boolean,
                       var cloudTime: Option[Long]) {

  def children = _children.toVector

  private val _children = new mutable.ArrayBuffer[MindNode]

}

object MindNode {

  def findRootOf(map: MindMap): MindNode = ???

  def create(map: MindMap) =
    new MindNode(UUID.randomUUID, map, None, None, false, None)

  def create(parent: MindNode) = {
    val child = new MindNode(UUID.randomUUID, parent.map, Some(parent), None, false, None)
    parent._children += child
    child
  }

}
{'fraction_non_alphanumeric': 0.09526592635885447, 'fraction_numerical': 0.0, 'mean_word_length': 2.4585858585858587, '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': '978569', 'n_tokens_mistral': 507, 'n_tokens_neox': 492, 'n_words': 136}