diff --git a/core/lib/Drupal/Core/Controller/ControllerBase.php b/core/lib/Drupal/Core/Controller/ControllerBase.php
index b89a09a..bd740c1 100644
--- a/core/lib/Drupal/Core/Controller/ControllerBase.php
+++ b/core/lib/Drupal/Core/Controller/ControllerBase.php
@@ -265,10 +265,15 @@ protected function languageManager() {
   /**
    * Returns the service container.
    *
+   * This method is marked private to prevent sub-classes from retrieving
+   * services from the container through it. Instead,
+   * \Drupal\Core\DependencyInjection\ContainerInjectionInterface should be used
+   * for injecting services.
+   *
    * @return \Symfony\Component\DependencyInjection\ContainerInterface $container
    *   The service container.
    */
-  protected function container() {
+  private function container() {
     return \Drupal::getContainer();
   }
 
diff --git a/core/lib/Drupal/Core/Form/FormBase.php b/core/lib/Drupal/Core/Form/FormBase.php
index 2fad298..4197fbc 100644
--- a/core/lib/Drupal/Core/Form/FormBase.php
+++ b/core/lib/Drupal/Core/Form/FormBase.php
@@ -207,10 +207,15 @@ public function setUrlGenerator(UrlGeneratorInterface $url_generator) {
   /**
    * Returns the service container.
    *
+   * This method is marked private to prevent sub-classes from retrieving
+   * services from the container through it. Instead,
+   * \Drupal\Core\DependencyInjection\ContainerInjectionInterface should be used
+   * for injecting services.
+   *
    * @return \Symfony\Component\DependencyInjection\ContainerInterface $container
    *   The service container.
    */
-  protected function container() {
+  private function container() {
     return \Drupal::getContainer();
   }
 
diff --git a/core/modules/locale/lib/Drupal/locale/Controller/LocaleController.php b/core/modules/locale/lib/Drupal/locale/Controller/LocaleController.php
index 4cc6dec..675d840 100644
--- a/core/modules/locale/lib/Drupal/locale/Controller/LocaleController.php
+++ b/core/modules/locale/lib/Drupal/locale/Controller/LocaleController.php
@@ -51,8 +51,8 @@ public function checkTranslation() {
    */
   public function translatePage() {
     return array(
-      'filter' => drupal_get_form(TranslateFilterForm::create($this->container())),
-      'form' => drupal_get_form(TranslateEditForm::create($this->container())),
+      'filter' => drupal_get_form(TranslateFilterForm::create(\Drupal::getContainer())),
+      'form' => drupal_get_form(TranslateEditForm::create(\Drupal::getContainer())),
     );
   }
 
diff --git a/core/modules/system/tests/modules/error_test/lib/Drupal/error_test/Controller/ErrorTestController.php b/core/modules/system/tests/modules/error_test/lib/Drupal/error_test/Controller/ErrorTestController.php
index 052bd5a..ba2b6e9 100644
--- a/core/modules/system/tests/modules/error_test/lib/Drupal/error_test/Controller/ErrorTestController.php
+++ b/core/modules/system/tests/modules/error_test/lib/Drupal/error_test/Controller/ErrorTestController.php
@@ -7,12 +7,41 @@
 namespace Drupal\error_test\Controller;
 
 use Drupal\Core\Controller\ControllerBase;
+use Drupal\Core\Database\Connection;
+use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Controller routines for error_test routes.
  */
 
-class ErrorTestController extends ControllerBase {
+class ErrorTestController extends ControllerBase implements ContainerInjectionInterface {
+
+  /**
+   * The database connection.
+   *
+   * @var \Drupal\Core\Database\Connection;
+   */
+  protected $database;
+
+  /**
+   * Constructs a \Drupal\error_test\Controller\ErrorTestController object.
+   *
+   * @param \Drupal\Core\Database\Connection $database
+   *   The database connection.
+   */
+  public function __construct(Connection $database) {
+    $this->database = $database;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('database')
+    );
+  }
 
   /**
    * Generate warnings to test the error handler.
@@ -42,7 +71,7 @@ public function triggerException() {
    */
   public function triggerPDOException() {
     define('SIMPLETEST_COLLECT_ERRORS', FALSE);
-    $this->container()->get('database')->query('SELECT * FROM bananas_are_awesome');
+    $this->database->query('SELECT * FROM bananas_are_awesome');
   }
 
 }
