**********************************************************************
767099
public void beforeCompletion()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "beforeCompletion");

        if (_state != TransactionState.STATE_ACTIVE)
        {
            MessageStoreRuntimeException mre = new MessageStoreRuntimeException(nls.getFormattedMessage("TRAN_PROTOCOL_ERROR_SIMS1001", new Object[]{}, null));
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(tc, "Cannot complete Transaction. Transaction is complete or completing!", mre);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "beforeCompletion");
            throw mre;
        }

        for (int i = 0; i < _callbacks.size(); i++)
        {
            TransactionCallback callback = (TransactionCallback) _callbacks.get(i);
            callback.beforeCompletion(this);
        }

        // Do we have work to do?
        if (_workList != null)
        {
            try
            {
                _workList.preCommit(this);
            }
            catch (Throwable t)
            {
                FFDCFilter.processException(t, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransactionSynchronization.beforeCompletion", "1:103:1.4.1.1", this);

                // An error has occurred during preCommit
                // so we need to trigger a rollback of our
                // transaction and therefore our connection
                // by throwing a runtime exception.
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(tc, "Throwing exception in beforeCompletion to ensure rollback due to Exception in preCommit!", t);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "beforeCompletion");
                throw new MessageStoreRuntimeException(nls.getFormattedMessage("COMPLETION_EXCEPTION_SIMS1002", new Object[] {t}, null), t);
            }
        }

        // Need to change the state after we have 
        // called the callbacks and preCommitted 
        // the workList as they may trigger
        // an addWork call to add work to the
        // transaction.
        _state = TransactionState.STATE_COMMITTING_1PC;

        try
        {
            // Do we have work to do?
            if (_workList != null)
            {
                // Call the persistence layer to trigger our
                // database work on the shared connection.
                _persistence.beforeCompletion(this);
            }
        }
        catch (PersistenceException pe)
        {
            FFDCFilter.processException(pe, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransactionSynchronization.beforeCompletion", "1:134:1.4.1.1", this);
            // An error has occurred during the persistence
            // phase so we need to trigger a rollback of our
            // transaction and therefore our connection by
            // throwing a runtime exception.
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(tc, "Rollback-only set on transaction due to PersistenceException in beforeCompletion!", pe);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "beforeCompletion");
            throw new MessageStoreRuntimeException(nls.getFormattedMessage("COMPLETION_EXCEPTION_SIMS1002", new Object[] {pe}, null), pe);
        }
        catch (SevereMessageStoreException smse)
        {
            FFDCFilter.processException(smse, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransactionSynchronization.beforeCompletion", "1:145:1.4.1.1", this);
            // An error has occurred during the persistence
            // phase so we need to trigger a rollback of our
            // transaction and therefore our connection by
            // throwing a runtime exception.
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(tc, "Rollback-only set on transaction due to PersistenceException in beforeCompletion!", smse);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "beforeCompletion");
            throw new MessageStoreRuntimeException(nls.getFormattedMessage("COMPLETION_EXCEPTION_SIMS1002", new Object[] {smse}, null), smse);
        }
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "beforeCompletion");
    }
1009299
public function join($element)
	{
		if($element->slave!==null)
			$this->join($element->slave);
		if(!empty($element->relation->select))
			$this->selects[]=$element->getColumnSelect($element->relation->select);
		$this->conditions[]=$element->relation->condition;
		$this->orders[]=$element->relation->order;
		$this->joins[]=$element->getJoinCondition();
		$this->joins[]=$element->relation->join;
		$this->groups[]=$element->relation->group;
		$this->havings[]=$element->relation->having;

		if(is_array($element->relation->params))
		{
			if(is_array($this->params))
				$this->params=array_merge($this->params,$element->relation->params);
			else
				$this->params=$element->relation->params;
		}
		$this->elements[$element->id]=true;
	}
401588
public function Bind()
	{
		if ( ! is_null( $this->_childs ) )
		{
			foreach ( $this->_childs as $node)
			{
				$node->Bind();
			}
		}
	}
1317614
public function validate() : void
    {
        if (null === $this->is_valid) {
            if (null === $this->user_value && null !== $this->default_value) {
                // There is a preset value, and its not being changed
                $this->is_valid = true;
            } elseif (null != $this->validator && false != $this->validator) {
                $validator = $this->validator;
                $valids = array();
                $all_valid = true;
                $pieces = explode(',', $this->user_value);
                foreach ($pieces as $piece) {
                    $result = $validator::quickValidate($piece, $this->constraints);
                    if (null !== $result) {
                        $valids[] = $result;
                    } else {
                        $all_valid = false;
                    }
                }
                $this->user_value = implode(',', $valids);
                $this->is_valid = $all_valid;
                if (!$all_valid) {
                    $this->error = 'The provided value is not valid. Please enter a valid value.';
                }
            } else {
                // This field does not get validated
                $this->is_valid = true;
            }
        }

        // Check if the input is different from the default value
        if ($this->is_valid && null !== $this->user_value) {
            $this->is_changed = ($this->default_value != $this->user_value);
        }
    }
798330
public function notBetween()
    {
        $this->failIf(
            $this->data[0] >= $this->data[1] &&
            $this->data[0] <= $this->data[2]
        );
    }
159786
public function commit() : void
    {
        if (null === $this->is_valid) {
            $this->validate();
        }
        if ($this->is_valid && $this->user_value != null) {
            $this->default_value = $this->user_value;
        }
        $this->user_value = null;
        $this->is_valid = null;
        $this->is_changed = false;
    }
1374179
public function process()
    {
        parent::process();

        if ($this->value === null) {
            return;
        }

        $float_value = $this->getNumericValue($this->value);

        if ($float_value === null) {
            $this->addMessage($this->getValidationMessage('float'));
        } else {
            $this->value = $float_value;
        }
    }
1330059
public function validate($value, Constraint $constraint): void
    {
        if ($value !== null) {
            $type = $constraint->type;
            $values = $type::getValues();
            if (!\in_array($value, $values, true)) {
                $this->context->buildViolation($constraint->message)
                    ->setParameter('{{ type }}', $constraint->type)
                    ->setParameter('{{ value }}', $value)
                    ->addViolation();
            }
        }
    }
1174745
public function onBeforeWrite()
    {
        if (!$this->isInDB()) {
            $this->CreatorID = Member::currentUserID();
        }

        if (!$this->VersionNumber) {
            $versions = DataObject::get(
                'FileVersion', sprintf('"FileID" = %d', $this->FileID)
            );

            if ($versions) {
                $this->VersionNumber = $versions->Count() + 1;
            } else {
                $this->VersionNumber = 1;
            }
        }

        if (!$this->Filename) {
            $this->Filename = $this->saveCurrentVersion();
        }

        parent::onBeforeWrite();
    }
58582
private void checkIndices(int row, int col) {
        if (row < 0 || col < 0 || row >= rows || col >= columns) {
            throw new IndexOutOfBoundsException();
        }
    }
949124
public function onRender()
    {

        $meta = $this->dataStore->meta();
        $showColumnKeys = array();

        if ($this->columns == array()) {
            if ($row = $this->dataStore[0]) {
                $showColumnKeys = array_keys($row);
            } else if (count($meta["columns"]) > 0) {
                $showColumnKeys = array_keys($meta["columns"]);
            }
        } else {
            foreach ($this->columns as $cKey => $cValue) {

                if ($cKey === "{others}") {
                    $allKeys = array_keys($this->dataStore[0]);
                    foreach ($allKeys as $k) {
                        if (!in_array($k, $showColumnKeys)) {
                            $meta["columns"][$k] = array_merge($meta["columns"][$k], $cValue);
                            array_push($showColumnKeys, $k);
                        }
                    }
                } else {
                    if (gettype($cValue) == "array") {
                        if ($cKey === "#") {
                            $meta["columns"][$cKey] = array(
                                "type" => "number",
                                "label" => "#",
                                "start" => 1,
                            );
                        }

                        $meta["columns"][$cKey] = array_merge($meta["columns"][$cKey], $cValue);
                        if (!in_array($cKey, $showColumnKeys)) {
                            array_push($showColumnKeys, $cKey);
                        }
                    } else {
                        if ($cValue === "#") {
                            $meta["columns"][$cValue] = array(
                                "type" => "number",
                                "label" => "#",
                                "start" => 1,
                            );
                        }
                        if (!in_array($cValue, $showColumnKeys)) {
                            array_push($showColumnKeys, $cValue);
                        }
                    }

                }
            }
        }

        $cleanColumnKeys = array();
        foreach ($showColumnKeys as $key) {
            if (!in_array($key, $this->excludedColumns)) {
                array_push($cleanColumnKeys, $key);
            }
        }
        $showColumnKeys = $cleanColumnKeys;

        if (count($this->group) === 0 && count($this->sorting)>0) {
            $this->dataStore->sort($this->sorting);
        }

        //Prepare data
        $this->template(
            "Table",
            array(
                "showColumnKeys" => $showColumnKeys,
                "meta" => $meta,
            )
        );
    }
163931
public function initialize()
    {
        parent::initialize();
        $this->select = new SelectClause($this);
        $this->from   = new FromClause($this);
        $this->group  = new GroupClause($this);
    }
341406
public final void sample()
  {
    long sum = _sum.getAndSet(0);
    int count = _count.getAndSet(0);

    if (count != 0)
      _value =sum / (double) count;
    else
      _value = 0;
  }
378752
int doOne(int bid, int tid, int aid, int delta) {
	int aBalance = 0;

	if (Conn == null) {
	    bench.incrementFailedTransactionCount();
	    return 0;
	}
	try {
	    if (Benchmark.prepared_stmt) {
		pstmt1.setInt(1,delta);
		pstmt1.setInt(2,aid);
		pstmt1.executeUpdate();
		pstmt1.clearWarnings();

		pstmt2.setInt(1,aid);
		ResultSet RS = pstmt2.executeQuery();
		pstmt2.clearWarnings();

		while (RS.next()) {
		    aBalance = RS.getInt(1);
		}

		pstmt3.setInt(1,delta);
		pstmt3.setInt(2,tid);
		pstmt3.executeUpdate();
		pstmt3.clearWarnings();

		pstmt4.setInt(1,delta);
		pstmt4.setInt(2,bid);
		pstmt4.executeUpdate();
		pstmt4.clearWarnings();

		pstmt5.setInt(1,tid);
		pstmt5.setInt(2,bid);
		pstmt5.setInt(3,aid);
		pstmt5.setInt(4,delta);
		pstmt5.executeUpdate();
		pstmt5.clearWarnings();
	    } else {
		Statement Stmt = Conn.createStatement();

		String Query = "UPDATE accounts";
		Query += " SET Abalance = Abalance + " + delta;
		Query += " WHERE Aid = " + aid;

		Stmt.executeUpdate(Query);
		Stmt.clearWarnings();

		Query = "SELECT Abalance";
		Query += " FROM accounts";
		Query += " WHERE Aid = " + aid;

		ResultSet RS = Stmt.executeQuery(Query);
		Stmt.clearWarnings();

		while (RS.next()) {
		    aBalance = RS.getInt(1);
		}

		Query = "UPDATE tellers";
		Query += " SET Tbalance = Tbalance + " + delta;
		Query += " WHERE Tid = " + tid;

		Stmt.executeUpdate(Query);
		Stmt.clearWarnings();

		Query = "UPDATE branches";
		Query += " SET Bbalance = Bbalance + " + delta;
		Query += " WHERE Bid = " + bid;

		Stmt.executeUpdate(Query);
		Stmt.clearWarnings();

		Query = "INSERT INTO history(Tid, Bid, Aid, delta)";
		Query += " VALUES (";
		Query += tid + ",";
		Query += bid + ",";
		Query += aid + ",";
		Query += delta + ")";

		Stmt.executeUpdate(Query);
		Stmt.clearWarnings();

		Stmt.close();
	    }

	    if (Benchmark.transactions) {
		Conn.commit();
	    }
	    return aBalance;
	} catch (java.lang.Exception e) {
	    if (Benchmark.verbose) {
		System.out.println("Transaction failed: "
				   + e.getMessage());
		e.printStackTrace();
	    }
	    bench.incrementFailedTransactionCount();
	    if (Benchmark.transactions) {
		try {
		    Conn.rollback();
		} catch (SQLException e1) {
		}
	    }
	}
	return 0;
    }
684143
private void initChunkMap() {
        Statement stmt = null;
        Connection connection = null;

        try {
            Class.forName("org.sqlite.JDBC");
            connection = DriverManager.getConnection("jdbc:sqlite:" + databasePath);

            // retrieve chunk IDs from database
            String sql = "SELECT id, chromosome, start FROM chunk";
            stmt = connection.createStatement();
            ResultSet rs = stmt.executeQuery(sql);
            chunkIdMap = new HashMap<>();
            while (rs.next()) {
                chunkIdMap.put(rs.getString("chromosome") + "_" + rs.getInt("start"), rs.getInt("id"));
            }
        } catch (SQLException e) {
            logger.error(e.getClass().getName() + ": " + e.getMessage());
            cleanConnectionClose(connection, stmt);
        } catch (ClassNotFoundException e) {
            logger.error(e.getClass().getName() + ": " + e.getMessage());
            e.printStackTrace();
        }
    }
328688
public function execute()
    {
        if (!$this->isEmpty()) {
            $this->table->update($this->context + $this->values, $this->where)->run();
        }

        parent::execute();
    }
617827
public function initialize()
    {
        if ($this->isInitialize) {
            return ;
        }

        $this->isInitialize = true;

        $this->getEventManager()->trigger(self::EVENT_INITIALIZE, $this);
    }