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/01/17 15:16:45 UTC

[isis] branch master updated: ISIS-2265: (hot-)fixes MM lockdown being too aggressive

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 6df7a29  ISIS-2265: (hot-)fixes MM lockdown being too aggressive
6df7a29 is described below

commit 6df7a29d2fb2930aaa041ea8aa68327046c23db0
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Jan 17 16:16:36 2020 +0100

    ISIS-2265: (hot-)fixes MM lockdown being too aggressive
    
    do not die on those types, that fail quick-classification, just warn
    instead
---
 .../specloader/SpecificationLoaderDefault.java       | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderDefault.java
index cbae7c5..ff3d59e 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderDefault.java
@@ -456,12 +456,20 @@ public class SpecificationLoaderDefault implements SpecificationLoader {
 
         if(isMetamodelFullyIntrospected() 
                 && isisConfiguration.getCore().getMetaModel().getIntrospector().isLockAfterFullIntrospection()) {
-            throw _Exceptions.illegalState(
-                    "Cannot introspect class '%s' because the metamodel has been fully introspected and is now locked. " +
-                    "One reason this can happen is if you are attempting to invoke an action through the WrapperFactory " +
-                    "on a service class incorrectly annotated with Spring's @Service annotation instead of " +
-                    "@DomainService.",
-                    cls.getName());
+            
+            val typeRegistry = isisBeanTypeRegistryHolder.getIsisBeanTypeRegistry();
+            
+            log.warn("Missed class '{}' when the metamodel was fully introspected.", cls.getName());
+            
+            typeRegistry.ifToBeInspectedThen(cls, sort->{
+            
+                throw _Exceptions.illegalState(
+                        "Cannot introspect class '%s' of sort %s, because the metamodel has been fully introspected and is now locked. " +
+                        "One reason this can happen is if you are attempting to invoke an action through the WrapperFactory " +
+                        "on a service class incorrectly annotated with Spring's @Service annotation instead of " +
+                        "@DomainService.",
+                        cls.getName(), sort);
+            });
         }
 
         // ... and create the specs