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/04 20:26:03 UTC

[isis] 21/24: ISIS-1976: PersistentSession: remove virtually unreachable code

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 93ac9f22e98e9d10c5767fe37894f10f30cb652e
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Sep 4 08:29:12 2018 +0200

    ISIS-1976: PersistentSession: remove virtually unreachable code
    
    Task-Url: https://issues.apache.org/jira/browse/ISIS-1976
---
 .../system/persistence/PersistenceSession5.java       | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/core/plugins/jdo-datanucleus-5/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession5.java b/core/plugins/jdo-datanucleus-5/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession5.java
index 2d0f87c..f10fb70 100644
--- a/core/plugins/jdo-datanucleus-5/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession5.java
+++ b/core/plugins/jdo-datanucleus-5/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession5.java
@@ -923,7 +923,7 @@ implements IsisLifecycleListener.PersistenceSessionLifecycleManagement {
                 makePersistentTransactionAssumed(adapter);
 
                 // clear out the map of transient -> persistent
-                PersistenceSession5.this.persistentByTransient.clear();
+                // already empty // PersistenceSession5.this.persistentByTransient.clear();
             }
 
         });
@@ -1050,30 +1050,15 @@ implements IsisLifecycleListener.PersistenceSessionLifecycleManagement {
         persistenceManager.flush();
     }
 
-
-    // -- getAggregateRoot, remappedFrom
-
-    private Map<Oid, Oid> persistentByTransient = _Maps.newHashMap();
+    // -- getAggregateRoot
 
     @Override
     public ObjectAdapter getAggregateRoot(final ParentedCollectionOid collectionOid) {
         final Oid rootOid = collectionOid.getRootOid();
         ObjectAdapter rootadapter = objectAdapterContext.lookupAdapterFor(rootOid);
-        if(rootadapter == null) {
-            final Oid parentOidNowPersisted = remappedFrom(rootOid);
-            rootadapter = objectAdapterContext.lookupAdapterFor(parentOidNowPersisted);
-        }
         return rootadapter;
     }
 
-    /**
-     * To support ISIS-234; keep track, for the duration of the transaction only,
-     * of the old transient {@link Oid}s and their corresponding persistent {@link Oid}s.
-     */
-    private Oid remappedFrom(final Oid transientOid) {
-        return persistentByTransient.get(transientOid);
-    }
-
     // -- AdapterManager implementation
 
     @Override