--------------------------------------------------------------------------------------------
768401
@SuppressWarnings("unchecked")
	public long addRecord(T record) throws IOException {

		if (recordsOutFile == null) {
			
			if (closed) {
				throw new IllegalStateException("The large record handler has been closed.");
			}
			if (recordsReader != null) {
				throw new IllegalStateException("The handler has already switched to sorting.");
			}
			
			LOG.debug("Initializing the large record spilling...");
			
			// initialize the utilities
			{
				final TypeComparator<?>[] keyComps = comparator.getFlatComparators();
				numKeyFields = keyComps.length;
				Object[] keyHolder = new Object[numKeyFields];
				
				comparator.extractKeys(record, keyHolder, 0);
				
				TypeSerializer<?>[] keySers = new TypeSerializer<?>[numKeyFields];
				TypeSerializer<?>[] tupleSers = new TypeSerializer<?>[numKeyFields + 1];
				
				int[] keyPos = new int[numKeyFields];
				
				for (int i = 0; i < numKeyFields; i++) {
					keyPos[i] = i;
					keySers[i] = createSerializer(keyHolder[i], i);
					tupleSers[i] = keySers[i];
				}
				// add the long serializer for the offset
				tupleSers[numKeyFields] = LongSerializer.INSTANCE;
				
				keySerializer = new TupleSerializer<Tuple>((Class<Tuple>) Tuple.getTupleClass(numKeyFields+1), tupleSers);
				keyComparator = new TupleComparator<Tuple>(keyPos, keyComps, keySers);
				
				keySerializerFactory = new RuntimeSerializerFactory<Tuple>(keySerializer, keySerializer.getTupleClass());

				keyTuple = keySerializer.createInstance();
			}
			
			// initialize the spilling
			final int totalNumSegments = memory.size();
			final int segmentsForKeys = (totalNumSegments >= 2*MAX_SEGMENTS_FOR_KEY_SPILLING) ? MAX_SEGMENTS_FOR_KEY_SPILLING : 
				Math.max(MIN_SEGMENTS_FOR_KEY_SPILLING, totalNumSegments - MAX_SEGMENTS_FOR_KEY_SPILLING);
				
			List<MemorySegment> recordsMemory = new ArrayList<MemorySegment>();
			List<MemorySegment> keysMemory = new ArrayList<MemorySegment>();
			
			for (int i = 0; i < segmentsForKeys; i++) {
				keysMemory.add(memory.get(i));
			}
			for (int i = segmentsForKeys; i < totalNumSegments; i++) {
				recordsMemory.add(memory.get(i));
			}
			
			recordsChannel = ioManager.createChannel();
			keysChannel = ioManager.createChannel();
			
			recordsOutFile = new FileChannelOutputView(
					ioManager.createBlockChannelWriter(recordsChannel), memManager,
					recordsMemory, memManager.getPageSize());
			
			keysOutFile = new FileChannelOutputView(
					ioManager.createBlockChannelWriter(keysChannel), memManager,
					keysMemory, memManager.getPageSize());
		}
		
		final long offset = recordsOutFile.getWriteOffset();
		if (offset < 0) {
			throw new RuntimeException("wrong offset");
		}
		
		Object[] keyHolder = new Object[numKeyFields];
		
		comparator.extractKeys(record, keyHolder, 0);
		for (int i = 0; i < numKeyFields; i++) {
			keyTuple.setField(keyHolder[i], i);
		}
		keyTuple.setField(offset, numKeyFields);
		
		keySerializer.serialize(keyTuple, keysOutFile);
		serializer.serialize(record, recordsOutFile);
		
		recordCounter++;
		
		return offset;
	}
1230373
public function commit()
    {
        $this->driver->inTransaction(
            function (Driver $driver, array $pendingQueries) {
                /** @var PendingQuery[] $pendingQueries */
                foreach ($pendingQueries as $item) {
                    $item->execute();
                }
            },
            $this->pendingQueries
        );
        $this->pendingQueries = [];
    }
810772
public function initialize()
    {
        if ($this->initialized || ! $this->association) {
            return;
        }

        $this->doInitialize();

        $this->initialized = true;
    }
439901
public function initializeObject()
    {
        if ($this->cache->has('fractions')) {
            $this->fractions = $this->cache->get('fractions');
        } else {
            $this->generateFractions();
            $this->cache->set('fractions', $this->fractions);
        }
    }
300090
public function process()
    {
        $rule = $this->getComponent();
        $context = $this->getContext();

        $processor = $this->getRuleProcessorFactory()->createProcessor($rule);
        $processor->setState($context);
        $processor->process();

        $this->trace($rule->getQtiClassName());
    }
255386
public function init()
	{
		parent::init();
		if($this->getLogPath()===null)
			$this->setLogPath(Yii::app()->getRuntimePath());
	}
948326
protected void initialize() {
		rows = cols = (int)Math.sqrt(matrix.length);
		map = new int[levels];
		for (int i = 0; i < levels; i++) {
			int v = 255 * i / (levels-1);
			map[i] = v;
		}
		div = new int[256];
		mod = new int[256];
		int rc = (rows*cols+1);
		for (int i = 0; i < 256; i++) {
			div[i] = (levels-1)*i / 256;
			mod[i] = i*rc/256;
		}
	}
249051
public function indexAction()
    {
        $this->view->data = array();
        $s = $this->_getSelectIndex();
        if ($this->_loadColumns) {
            foreach ($this->_loadColumns as $c) {
                $s->expr($c);
            }
        }
        foreach ($this->_model->getRows($s) as $row) {
            $this->view->data[] = $this->_loadDataFromRow($row);
        }
        $this->view->total = $this->_model->countRows($s);
    }
379123
public function initialize()
    {
        $this->initializeConnections();
        $this->_table and $this->setSource($this->_table);
        $this->keepSnapshots(true);
    }
950258
public function methodChanged(): void
    {
        assert($this->offsetExists(self::VAR_LINE_METHOD));

        if (self::METHOD_POST === $this->offsetGet(self::VAR_LINE_METHOD)) {
            $this->offsetSet(self::VAR_BODY, null);
            if ($this->offsetExists(self::VAR_PARSED_POST)
                && is_null($this->offsetGet(self::VAR_PARSED_POST))) {
                $this->offsetSet(self::VAR_PARSED_POST, new MutableArray());
            }
            if ($this->offsetExists(self::VAR_PARSED_FILES)
                && is_null($this->offsetGet(self::VAR_PARSED_FILES))) {
                $this->offsetSet(self::VAR_PARSED_FILES, new MutableArray());
            }
        } else if (self::METHOD_PUT === $this->offsetGet(self::VAR_LINE_METHOD)) {
            if ($this->offsetExists(self::VAR_BODY)
                && is_null($this->offsetGet(self::VAR_BODY))) {
                $this->offsetSet(self::VAR_BODY, '');
            }
            $this->offsetSet(self::VAR_PARSED_POST, null);
            $this->offsetSet(self::VAR_PARSED_FILES, null);
        } else {
            $this->offsetSet(self::VAR_BODY, null);
            $this->offsetSet(self::VAR_PARSED_POST, null);
            $this->offsetSet(self::VAR_PARSED_FILES, null);
        }
    }
228964
public function initialize()
    {
        $this->data = new stdClass();
        $this->data->type = null;
        $this->data->createdAt = null;
        $this->data->descriotion = null;
    }
595526
function(){
    var sourceMap = this.sourceMap_;
    var memberMap = this.members_;
    var curMember;
    var newMember;
    var curMemberId;
    var newMemberId;
    var sourceObject;
    var sourceObjectInfo;
    var inserted = [];
    var deleted = [];
    var delta;

    for (var sourceObjectId in sourceMap)
    {
      sourceObjectInfo = sourceMap[sourceObjectId];
      sourceObject = sourceObjectInfo.sourceObject;

      curMember = sourceObjectInfo.member;
      newMember = this.map ? this.map(sourceObject) : sourceObject;

      if (newMember instanceof DataObject == false || this.filter(newMember))
        newMember = null;

      if (!isEqual(curMember, newMember))
      {
        sourceObjectInfo.member = newMember;

        // if here is ref for member already
        if (curMember)
        {
          curMemberId = curMember.basisObjectId;

          // call callback on member ref add
          if (this.removeMemberRef)
            this.removeMemberRef(curMember, sourceObject);

          // decrease ref count
          memberMap[curMemberId]--;
        }

        // if new member exists, update map
        if (newMember)
        {
          newMemberId = newMember.basisObjectId;

          // call callback on member ref add
          if (this.addMemberRef)
            this.addMemberRef(newMember, sourceObject);

          if (newMemberId in memberMap)
          {
            // member is already in map -> increase ref count
            memberMap[newMemberId]++;
          }
          else
          {
            // add to map
            memberMap[newMemberId] = 1;

            // add to delta
            inserted.push(newMember);
          }
        }
      }
    }

    // get deleted delta
    for (curMemberId in this.items_)
      if (memberMap[curMemberId] == 0)
      {
        delete memberMap[curMemberId];
        deleted.push(this.items_[curMemberId]);
      }

    // if any changes, fire event
    if (delta = getDelta(inserted, deleted))
      this.emit_itemsChanged(delta);

    return delta;
  }
701946
public function initRuntime()
    {
        $this->runtimeInitialized = true;

        foreach ($this->getExtensions() as $extension) {
            $extension->initRuntime($this);
        }
    }
666137
private void init() {

        Measure currSonarMeasure = null;
        String currValue = null;

        setValues(new HashMap<HLAMeasure, String>());
        setValuesInt(new HashMap<HLAMeasure, Integer>());
        setValuesDouble(new HashMap<HLAMeasure, Double>());
        setMeasures(new ArrayList<HLAMeasure>());
        setVersion(getResource().getVersion());

        for (HLAMeasure currMeasure : HLAMeasure.values()) {

            LOG.debug("Analyzing measure " + currMeasure.getSonarName());
            currSonarMeasure = getResource().getMeasure(currMeasure.getSonarName());

            if (currSonarMeasure != null) {

                LOG.debug("Found measure for " + currMeasure.getSonarName());
                currValue = currSonarMeasure.getFormattedValue();
                LOG.debug("Value is: " + currValue);

                getValues().put(currMeasure, currValue != null ? currValue : VALUE_NOT_AVAILABLE);
                getValuesInt().put(currMeasure, currSonarMeasure.getIntValue());
                getValuesDouble().put(currMeasure, currSonarMeasure.getValue());
                getMeasures().add(currMeasure);
            }
        }
    }
91524
public function init() {
        parent::init();
        $this->db = Instance::ensure($this->db, Connection::className());
        $this->db->getCollection($this->itemTable)->createIndex(['name' => 1], ['unique' => true]);
        $this->db->getCollection($this->ruleTable)->createIndex(['name' => 1], ['unique' => true]);
    }
859111
private static function init() {
        self::$huffmanLookup = self::huffmanLookupInit();
        self::$huffmanCodes = self::huffmanCodesInit();
        self::$huffmanLengths = self::huffmanLengthsInit();

        foreach (\array_column(self::TABLE, 0) as $index => $name) {
            if (isset(self::$indexMap[$name])) {
                continue;
            }

            self::$indexMap[$name] = $index + 1;
        }
    }
1155837
public function init(): void
    {
        if ($this->sourcePath !== null) {
            $this->sourcePath = $this->findPath($this->sourcePath);
        }
        if ($this->basePath !== null) {
            $this->basePath = $this->findPath($this->basePath);
        }
        if ($this->baseUrl !== null) {
            $this->baseUrl = rtrim(Yii::getAlias($this->baseUrl), '/');
        }
    }