You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2018/09/05 15:31:31 UTC

[isis] 04/05: ISIS-1976: let ObjectAdapterContext.replaceRootAdapter(ObjectAdapter, RootAndCollectionAdapters) no longer use OA's replacePojo

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch ISIS-1976-rethink-object-adapters
in repository https://gitbox.apache.org/repos/asf/isis.git

commit b83de867d4bf9ad4a1bbdc5a3fbff3ec27ce328a
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Sep 5 16:16:10 2018 +0200

    ISIS-1976: let ObjectAdapterContext.replaceRootAdapter(ObjectAdapter,
    RootAndCollectionAdapters) no longer use OA's replacePojo
    
    Task-Url: https://issues.apache.org/jira/browse/ISIS-1976
---
 .../system/persistence/adaptermanager/ObjectAdapterContext.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/adaptermanager/ObjectAdapterContext.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/adaptermanager/ObjectAdapterContext.java
index a13a6cc..e7fd814 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/adaptermanager/ObjectAdapterContext.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/adaptermanager/ObjectAdapterContext.java
@@ -427,8 +427,8 @@ public class ObjectAdapterContext {
 
             if (collectionPojoActuallyOnPojo != collectionPojoWrappedByAdapter) {
                 pojoAdapterMap.remove(collectionAdapter);
-                collectionAdapter.friend().replacePojo(collectionPojoActuallyOnPojo);
-                pojoAdapterMap.add(collectionPojoActuallyOnPojo, collectionAdapter);
+                final ObjectAdapter newCollectionAdapter = collectionAdapter.withPojo(collectionPojoActuallyOnPojo);
+                pojoAdapterMap.add(collectionPojoActuallyOnPojo, newCollectionAdapter);
             }
         }
         
@@ -470,8 +470,12 @@ public class ObjectAdapterContext {
     @Deprecated
     public void remapRecreatedPojo(ObjectAdapter adapter, final Object pojo) {
         removeAdapterFromCache(adapter);
+        
         adapter.friend().replacePojo(pojo);
         mapAndInjectServices(adapter);
+        
+        //final ObjectAdapter newAdapter = adapter.withPojo(pojo);
+        //mapAndInjectServices(newAdapter);
     }