diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php
index 558297b..1f0d248 100644
--- a/core/lib/Drupal/Core/Entity/Entity.php
+++ b/core/lib/Drupal/Core/Entity/Entity.php
@@ -13,6 +13,7 @@
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Config\Entity\Exception\ConfigEntityIdLengthException;
 use Drupal\Core\Entity\Exception\UndefinedLinkTemplateException;
+use Drupal\Core\Entity\TypedData\EntityDataDefinition;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Link;
@@ -43,7 +44,7 @@
   protected $enforceIsNew;
 
   /**
-   * A typed data object wrapping this entity.
+   * The typed data adapter for the entity.
    *
    * @var \Drupal\Core\TypedData\ComplexDataInterface
    */
@@ -547,8 +548,24 @@ public function toArray() {
    */
   public function getTypedData() {
     if (!isset($this->typedData)) {
-      $class = \Drupal::typedDataManager()->getDefinition('entity')['class'];
-      $this->typedData = $class::createFromEntity($this);
+      // Create the data definition and let the typed data manager instantiate
+      // the corresponding typed data object.
+      $definition = EntityDataDefinition::create($this->getEntityTypeId());
+      // Inject the field definitions used by the entity.
+      if (in_array('Drupal\Core\Entity\FieldableEntityInterface', class_implements($this))) {
+        $definition->setPropertyDefinitions($this->getFieldDefinitions());
+      }
+      // Some places in core create entities with fake/non-existing bundles. In
+      // such cases, setting the bundle on the definition would result in a
+      // non-existing data type, since derived 'entity:[entity_type]:[bundle]'
+      // data types are only created for bundles that actually exist. Not
+      // specifying it results in the (less specific but still valid)
+      // 'entity:[entity_type]' data type.
+      $bundles = $this->entityManager()->getBundleInfo($this->getEntityTypeId());
+      if (isset($bundles[$this->bundle()])) {
+        $definition->setBundles([ $this->bundle() ]);
+      }
+      $this->typedData = \Drupal::typedDataManager()->create($definition, $this);
     }
     return $this->typedData;
   }
diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
index 0fb2330..c46b442 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
@@ -9,8 +9,6 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\FieldableEntityInterface;
-use Drupal\Core\Entity\EntityInterface;
-use Drupal\Core\Entity\TypedData\EntityDataDefinition;
 use Drupal\Core\TypedData\ComplexDataInterface;
 use Drupal\Core\TypedData\Exception\MissingDataException;
 use Drupal\Core\TypedData\TypedData;
@@ -42,23 +40,6 @@ class EntityAdapter extends TypedData implements \IteratorAggregate, ComplexData
   protected $entity;
 
   /**
-   * Creates an instance wrapping the given entity.
-   *
-   * @param \Drupal\Core\Entity\EntityInterface|null $entity
-   *   The entity object to wrap.
-   *
-   * @return static
-   */
-  public static function createFromEntity(EntityInterface $entity) {
-    $definition = EntityDataDefinition::create()
-      ->setEntityTypeId($entity->getEntityTypeId())
-      ->setBundles([ $entity->bundle() ]);
-    $instance = new static($definition);
-    $instance->setValue($entity);
-    return $instance;
-  }
-
-  /**
    * {@inheritdoc}
    */
   public function getValue() {
diff --git a/core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php b/core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php
index 95f44a9..2bb0112 100644
--- a/core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php
+++ b/core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php
@@ -82,6 +82,11 @@ public function getPropertyDefinitions() {
     return $this->propertyDefinitions;
   }
 
+  public function setPropertyDefinitions(array $definitions) {
+    $this->propertyDefinitions = $definitions;
+    return $this;
+  }
+
   /**
    * {@inheritdoc}
    */
diff --git a/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php
index 5556c6e..7bb1a7a 100644
--- a/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php
@@ -7,11 +7,10 @@
 
 namespace Drupal\Tests\Core\Entity\TypedData;
 
-use Drupal\Core\Access\AccessResult;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Entity\Plugin\DataType\EntityAdapter;
+use Drupal\Core\Entity\TypedData\EntityDataDefinition;
 use Drupal\Core\Field\BaseFieldDefinition;
-use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Language\Language;
@@ -207,9 +206,20 @@ protected function setUp() {
       ->method('getFieldDefinitions')
       ->with($this->entityTypeId, $this->bundle)
       ->will($this->returnValue($this->fieldDefinitions));
-    $this->entity = $this->getMockForAbstractClass('\Drupal\Core\Entity\ContentEntityBase', array($values, $this->entityTypeId, $this->bundle));
+    $this->entity = $this->getMockBuilder('\Drupal\Core\Entity\ContentEntityBase')
+      ->setConstructorArgs(array($values, $this->entityTypeId, $this->bundle))
+      ->setMethods(array('getTypedData'))
+      ->getMockForAbstractClass();
 
-    $this->entityAdapter = EntityAdapter::createFromEntity($this->entity);
+    $entity_data_definition = EntityDataDefinition::create($this->entityTypeId)
+      ->setBundles([ $this->bundle ])
+      ->setPropertyDefinitions($this->fieldDefinitions);
+    $this->entityAdapter = EntityAdapter::createInstance($entity_data_definition);
+    $this->entityAdapter->setValue($this->entity);
+
+    $this->entity->expects($this->any())
+      ->method('getTypedData')
+      ->will($this->returnValue($this->entityAdapter));
   }
 
   /**
@@ -419,4 +429,5 @@ public function testGetIterator() {
     $this->entityAdapter->setValue(NULL);
     $this->assertEquals(new \ArrayIterator([]), $this->entityAdapter->getIterator());
   }
+
 }
