diff -u b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php --- b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php +++ b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php @@ -199,28 +199,6 @@ } /** - * Adds a namespace to be scanned for annotation definitions. - * - * Use this with care as this resets the discovery and any definitions that - * may have been cached before this call. Generally, this should be called - * before any createInstance() or getDefinitions() calls. - * - * @param string $namespace - * The namespace to add. - * - * @return \Drupal\Component\Plugin\PluginManagerInterface - * A plugin manager for chaining. - */ - public function addAnnotationNamespace($namespace) { - if (!in_array($namespace, $this->additionalAnnotationNamespaces)) { - array_push($this->additionalAnnotationNamespaces, $namespace); - $this->discovery = NULL; - $this->setCachedDefinitions([]); - } - return $this; - } - - /** * Returns the cached plugin definitions of the decorated discovery class. * * @return array|null