End the context for the current Map of URL (location where the module is loaded from), ModuleMetaData

@return Object which was removed (pop) from the stack.
331878
public Object endContext() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Map<URL, ModuleMetaData> mmdi = getModuleMetaDataMap();
            ModuleMetaData mmd = ((mmdi != null) && !mmdi.isEmpty()) ? mmdi.values().iterator().next() : null;
            Tr.debug(tc, "end context " + (mmd == null ? null : mmd.getJ2EEName()));
        }
        return threadContext.endContext();
    }
159548
private function clearContext()
    {
        $this->url = NULL;
        $this->params = array();
        $this->headers = array();
        Logger::log('Context service for ' . static::class . ' cleared!');
        $this->closeConnection();
    }
90933
public static function deleteMapping()
    {
        $instance = new static;

        $params = $instance->getBasicEsParams();

        return $instance->getElasticSearchClient()->indices()->deleteMapping($params);
    }
1053256
public Object endContext() { // modified to return object d131914
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            ComponentMetaData cmd = getComponentMetaData();
            Tr.debug(tc, "end context " + (cmd == null ? null : cmd.getJ2EEName()));
        }
        return threadContext.endContext(); //d131914
    }
431069
public function getEndpoint()
    {
        $basePath = $this->app['config']->get('api.base_path', self::DEFAULT_BASE_PATH);
        $basePath = $this->stripTrailingSlash($basePath);

        // determine the base URL for the API,
        // i.e. https://api.example.com/v1
        $urlBase = $this->app['config']->get('api.url');
        if ($urlBase) {
            $urlBase = $this->stripTrailingSlash($urlBase);
        } else {
            // no base URL was defined so we're going to generate one
            $urlBase = $this->app['base_url'];
            $urlBase = $this->stripTrailingSlash($urlBase).$basePath;
        }

        // get the requested path, strip any trailing '/'
        $path = $this->stripTrailingSlash($this->request->path());

        // strip out the base path (i.e. /api/v1) from the
        // requested path
        if ($basePath) {
            $path = str_replace($basePath, '', $path);
        }

        return $urlBase.$path;
    }
1234344
public function pop()
    {
        if (null !== $this->getDraft()) {
            return $this->getDraft()->pop();
        }

        $last = $this->last();

        if (null === $last) {
            return;
        }

        array_pop($this->_data);
        $content = null;
        if (isset($this->subcontentmap[$last->getUid()])) {
            $content = $this->_subcontent->get($this->subcontentmap[$last->getUid()]);
            $this->_subcontent->removeElement($content);
            unset($this->subcontentmap[$last->getUid()]);
        }

        $this->rewind();

        return $content;
    }
1368203
public function remove()
    {
        if($moduleMiddleware = $this->module->middleware())
        {
            $middleware = $this->load();
            $middleware = array_diff($middleware,$moduleMiddleware);
            return $this->set($middleware);
        }
        return true;
    }
1232213
public function get_context() {
        if ($this->itemtype == 'mod') {
            $modinfo = get_fast_modinfo($this->courseid);
            // Sometimes the course module cache is out of date and needs to be rebuilt.
            if (!isset($modinfo->instances[$this->itemmodule][$this->iteminstance])) {
                rebuild_course_cache($this->courseid, true);
                $modinfo = get_fast_modinfo($this->courseid);
            }
            // Even with a rebuilt cache the module does not exist. This means the
            // database is in an invalid state - we will log an error and return
            // the course context but the calling code should be updated.
            if (!isset($modinfo->instances[$this->itemmodule][$this->iteminstance])) {
                mtrace(get_string('moduleinstancedoesnotexist', 'error'));
                $context = \context_course::instance($this->courseid);
            } else {
                $cm = $modinfo->instances[$this->itemmodule][$this->iteminstance];
                $context = \context_module::instance($cm->id);
            }
        } else {
            $context = \context_course::instance($this->courseid);
        }
        return $context;
    }
358930
@Override
    public void endElement(String uri, String localName, String qName) throws SAXException {

        // <context-param>
        if (elements("web-app", "context-param")) {
            if (currentName != null && currentValue != null) {
                entries.put(currentName, currentValue);
            }
        }

        // remove the element from the stack
        String removedName = stack.pop();

        // check if the removed name is the expected one
        if (!removedName.equals(localName)) {
            throw new IllegalStateException("Found '" + removedName + "' but expected '" + localName + "' on the stack!");
        }

    }
991476
public function loadModuleData()
    {
        $moduleData = $GLOBALS['BE_USER']->getModuleData(self::KEY);

        $this->unsetModuleDataIfCanNotBeSerialized($moduleData);
        if (empty($moduleData) || !$moduleData) {
            $moduleData = GeneralUtility::makeInstance(ModuleData::class);
        } else {
            $moduleData = unserialize($moduleData);
        }

        return $moduleData;
    }
908351
@Override
    public void endMetaData(MetaData metadata)
    {
        this.builder.addBlock(new MetaDataBlock(this.builder.endBlockList(), metadata));
    }
1116115
public static function end()
	{
		$content = '';
		if (self::$open)
		{
			$content .= '</div></div>';
		}
		self::$open = false;
		$content .= '</div>';
		return $content;
	}
118710
public function end()
    {
        if (null !== $this->currentGroup) {
            $this->currentGroup = null;
        } elseif (null !== $this->currentTab) {
            $this->currentTab = null;
        } else {
            throw new \RuntimeException('No open tabs or groups, you cannot use end()');
        }

        return $this;
    }
1166163
@Override
    public N pop() {
        try {
            return stack[(--stackTop)&mask];
        } finally {
            // remove the reference to the element in the
            // stack to prevent hanging references from living forever
            stack[(stackTop&mask)] = null;
        }
    }
694430
public E pop() {
		modCount++;
		
		if (size == 0) {
			throw new NoSuchElementException();
		}
		
		size--;

		if (cntInBucket == 1) {
			cntInBucket = bucketSize;
			return buckets.removeLast()[0];
		}
		return buckets.getLast()[--cntInBucket];
	}
222332
public void removeWebApplication(DeployedModule deployedModule) {
        String contextRoot = deployedModule.getContextRoot();
        //begin 280649    SERVICE: clean up separation of core and shell    WASCC.web.webcontainer : reuse with other VirtualHost impls.
        removeWebApplication(deployedModule, contextRoot);
        //end 280649    SERVICE: clean up separation of core and shell    WASCC.web.webcontainer : reuse with other VirtualHost impls.

    }
1300912
public function whereUsedMetaBox()
    {
        if (empty(self::$enabled)) {
            return;
        }

        global $post;
        $module = $this;

        if (is_null($post)) {
            return;
        }

        $usage = self::getModuleUsage($post->ID);

        add_meta_box('modularity-usage', 'Module usage', function () use ($module, $usage) {
            if (count($usage) == 0) {
                echo '<p>' . __('This modules is not used yet.', 'modularity')  . '</p>';
                return;
            }

            echo '<p>' . __('This module is used on the following places:', 'modularity') . '</p><p><ul class="modularity-usage-list">';

            foreach ($usage as $page) {
                echo '<li><a href="' . get_permalink($page->post_id) . '">' . $page->post_title . '</a></li>';
            }

            echo '</ul></p>';
        }, self::$enabled, 'side', 'default');
    }