{@inheritDoc} Once this method has been called, any subsequent calls will
have no effect and will not throw an exception.
487518
public synchronized void finish() {
        if (!isFinished) {
            isFinished = true;
            try {
                writer.close();
                // Re-open as a random access file so we can overwrite the 3 int
                // header that specifies the number of dimensions and values.
                // Note that the location of the matrix data is dependent on
                // whether the matrix is to be transposed.
                RandomAccessFile matrixRaf =
                    new RandomAccessFile(matrixFile, "rw");

                // Write the header in the first 100 characters.  The header is
                // the number rows, the number of columns, and the number of non
                // zeros on a single line with spaces between them.
                StringBuilder sb = new StringBuilder();
                sb.append(curRow).append(" ");
                sb.append(numCols).append(" ");
                sb.append(nonZeroValues).append(" ");
                matrixRaf.write(sb.toString().getBytes());
            } catch (IOException ioe) {
                throw new IOError(ioe);
            }
        }
    }
554178
private void setMethod(Method method, Object targetObject, Object value) throws UnmarshalException {
		try {
			method.invoke(targetObject, value);
		} catch (IllegalArgumentException e) {
			throw new UnmarshalException(e);
		} catch (IllegalAccessException e) {
			throw new UnmarshalException(e);
		} catch (InvocationTargetException e) {
			throw new UnmarshalException(e);
		}
	}
202374
@Override
    public void execute() {
        if ((str == null || str.isEmpty()) && !FindContext.isAvailable()) {
            try {
                str = editor.readLine("Find previous:");
                editor.findPrevious(str);
                FindContext.setLastSearch(str);
            } catch (IOException e) {
                //noop
            }
        } else if (FindContext.isAvailable()) {
            editor.findPrevious(FindContext.getLastSearch());
        } else {
            editor.findPrevious(str);
            FindContext.setLastSearch(str);
        }
    }
327922
@Override
    @SuppressWarnings({ "PMD.EmptySynchronizedBlock", "PMD.EmptyCatchBlock",
        "PMD.AvoidCatchingThrowable" })
    public void run() {
        try {
            registerAsGenerator();
            while (!Thread.currentThread().isInterrupted()) {
                try {
                    selector.select();
                    Set<SelectionKey> selected = selector.selectedKeys();
                    for (SelectionKey key : selected) {
                        ((NioHandler) key.attachment())
                            .handleOps(key.readyOps());
                    }
                    selected.clear();
                    synchronized (selectorGate) {
                        // Delay next iteration if another thread has the lock.
                        // "Find bugs" complains, but this is really okay.
                    }
                } catch (InterruptedIOException | InterruptedException
                        | Error e) {
                    break;
                } catch (Throwable e) {
                    // Ignore anything else, this loop is crucial.
                }
            }
        } finally {
            unregisterAsGenerator();
        }
    }
1022934
private function assertMethodExists(string $method): void
    {
        if (!method_exists($this, $method)) {
            throw new MethodDoesNotExistException(
                sprintf("Specified method \"%s\" does not exist", $method)
            );
        }
    }
104278
@Override
    public final void afterPropertiesSet() throws Exception {
        if (this.getLocator() != null) {
            this.logger.warn(
                    "Static "
                            + this.getClass().getName()
                            + " reference has already been set and setInstance is being called");
        }
        this.setLocator(this);
    }
97095
public function throwsExactly()
    {
        try {
            $this->data[0]();
        } catch (Exception $exception) {
            $exceptionClass = get_class($exception);
            if ($exceptionClass === $this->data[1]) {
                return;
            } else {
                throw new DidNotMatchException(
                    "Expected exactly {$this->data[1]} to be thrown, " .
                    "but $exceptionClass was thrown."
                );
            }
        }
        throw new DidNotMatchException(
            "Expected exactly {$this->data[1]} to be thrown, " .
            "but nothing was thrown."
        );
    }
1046964
@Override
    protected void after() {
        super.after();
        if (adminSession != null) {
            LOG.info("Logging off {}", adminSession.getUserID());
            adminSession.logout();
            adminSession = null;
        }
        if (anonSession != null) {
            LOG.info("Logging off {}", anonSession.getUserID());
            anonSession.logout();
            anonSession = null;
        }
        for (final Session session : userSessions.values()) {
            LOG.info("Logging off {}", session.getUserID());
            session.logout();
        }
        userSessions.clear();
        LOG.info("Closed all sessions");
    }
1305345
public function afterSave(Event $event, EntityInterface $entity): void
    {
        $action = $entity->isNew() ? ModelHistory::ACTION_CREATE : ModelHistory::ACTION_UPDATE;

        $dirtyFields = null;
        if ($action === ModelHistory::ACTION_UPDATE && isset($this->_dirtyFields[$entity->id])) {
            $dirtyFields = $this->_dirtyFields[$entity->id];
            unset($this->_dirtyFields[$entity->id]);
        }

        $this->ModelHistory->add($entity, $action, $this->_getUserId(), [
            'dirtyFields' => $dirtyFields
        ]);
    }
314793
public function onKernelException(GetResponseForExceptionEvent $event): void
    {
        $exception = $event->getException();

        if (!$exception instanceof AccessDeniedException) {
            return;
        }

        $event->setException(new AccessDeniedHttpException($exception->getMessage(), $exception));
    }
627353
public function _after(\Codeception\TestInterface $test)
    {
        if ($this->applicationUsesDatabase()) {
            $db = $this->app['db'];

            if ($db instanceof \Illuminate\Database\DatabaseManager) {
                if ($this->config['cleanup']) {
                    $db->rollback();
                    $this->debugSection('Database', 'Transaction cancelled; all changes reverted.');
                }

                /**
                 * Close all DB connections in order to prevent "Too many connections" issue
                 *
                 * @var \Illuminate\Database\Connection $connection
                 */
                foreach ($db->getConnections() as $connection) {
                    $connection->disconnect();
                }
            }

            // Remove references to Faker in factories to prevent memory leak
            unset($this->app[\Faker\Generator::class]);
            unset($this->app[\Illuminate\Database\Eloquent\Factory::class]);
        }
    }
1034523
public function reject(Exception $exception): void
    {
        $this->exception = $exception;
        $this->state = Promise::REJECTED;

        while (count($this->onRejected) > 0) {
            $callback = array_shift($this->onRejected);
            try {
                $exception = call_user_func($callback, $this->exception);
                $this->exception = $exception;
            } catch (Exception $exception) {
                $this->exception = $exception;
            }
        }
    }
653941
public function afterExecuteRoute() {
        /** @var \Bullhorn\FastRest\Api\Services\Output\OutputInterface $output */
        $output = $this->getDI()->get(OutputInterface::DI_NAME);
        if(!($output instanceof OutputInterface)) {
            throw new \Exception('The Output must implement: ' . OutputInterface::class);
        }
        $object = $this->getOutputObject();
        $errors = $this->getErrors();
        $code = $this->getStatusCode();

        $object = $this->addErrorsAndStatus($errors, $code, $object);
        $this->response->setStatusCode($object->statusCode, 'Check Document Body For More Details');
        $output->output($object, $this->response);
        $this->view->disable();
    }
452791
public function execute($objectContext)
    {
        if (method_exists($objectContext, $this->method))
        {
            if (!empty($this->parameters))
            {
                $objectContext->{$this->method}($this->parameters);
            }
            else
            {
                $objectContext->{$this->method}($this->parameters);
            }
        }
    }
1092067
protected static function execute()
    {
        try {
            $instance = static::getInstance();

            $reflectionMethod = new ReflectionMethod($instance, static::$method);

            return $reflectionMethod->invokeArgs($instance, static::$arguments);
        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        }
    }
1002869
@Override
    public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws CacheException {
        log.debug("region access strategy nonstrict-read-write entity afterUpdate() {} {}", getInternalRegion().getCacheNamespace(), key);
        getInternalRegion().evict(key);
        return false;
    }
1274749
public function execute()
    {
        
        if (null === $this->statement) {
            throw new Exception('The database statement resource is not currently set.');
        }
        if ($this->statement->execute()) {
            
            if (($metaData = $this->statement->result_metadata()) !== false) {
                foreach ($metaData->fetch_fields() as $col) {
                    ${$col->name}   = null;
                    $results[]      = &${$col->name};
                    $cols[]         = $col->name;
                }
                
                call_user_func_array([$this->statement, 'bind_result'], $results);
                
                $this->stmt_results = $results;
                $this->stmt_cols = $cols;
            }
            return true;
        }
        return false;
    }