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 2020/09/17 07:01:28 UTC

[isis] branch master updated: ISIS-2430: minor: comments

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

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new d08018d  ISIS-2430: minor: comments
d08018d is described below

commit d08018d8219444cffd7613eb677d8518979429ec
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Sep 17 08:58:53 2020 +0200

    ISIS-2430: minor: comments
---
 .../org/apache/isis/core/metamodel/spec/ManagedObject.java  | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ManagedObject.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ManagedObject.java
index 2928a10..4a340a5 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ManagedObject.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ManagedObject.java
@@ -25,7 +25,6 @@ import java.util.function.Function;
 import javax.annotation.Nullable;
 
 import org.apache.isis.commons.internal.base._Lazy;
-import org.apache.isis.commons.internal.debug._Probe;
 import org.apache.isis.commons.internal.exceptions._Exceptions;
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
 import org.apache.isis.core.metamodel.objectmanager.ObjectManager;
@@ -122,12 +121,12 @@ public interface ManagedObject {
         
         //ISIS-2430 Cannot assume Action Param Spec to be correct when eagerly loaded
         //actual type in use (during runtime) might be a sub-class of the above
-        {
-            if(pojo==null 
-                    || pojo.getClass().equals(specification.getCorrespondingClass())
-                    ) {
-                return SimpleManagedObject.of(specification, pojo);
-            }
+        if(pojo==null 
+                || pojo.getClass().equals(specification.getCorrespondingClass())
+                ) {
+            // if actual type matches spec's, we assume, that we don't need to reload, 
+            // so this is a shortcut for performance reasons  
+            return SimpleManagedObject.of(specification, pojo);
         }
         
         //_Probe.errOut("upgrading spec %s on type %s", specification, pojo.getClass());