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 2019/10/09 14:23:32 UTC

[isis] branch v2 updated: ISIS-2158: revert FacetAbstract temp. changes to previous version

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

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


The following commit(s) were added to refs/heads/v2 by this push:
     new 09bd3d7  ISIS-2158: revert FacetAbstract temp. changes to previous version
09bd3d7 is described below

commit 09bd3d7e352869a6d01834a599e7608c3ca17874
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Oct 9 16:23:24 2019 +0200

    ISIS-2158: revert FacetAbstract temp. changes to previous version
    
    - OpenJDK 11 build fails on this class - no idea why
---
 .../apache/isis/metamodel/facetapi/FacetAbstract.java  | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/core/metamodel/src/main/java/org/apache/isis/metamodel/facetapi/FacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/metamodel/facetapi/FacetAbstract.java
index 0689275..87a04f3 100644
--- a/core/metamodel/src/main/java/org/apache/isis/metamodel/facetapi/FacetAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/metamodel/facetapi/FacetAbstract.java
@@ -20,13 +20,14 @@
 package org.apache.isis.metamodel.facetapi;
 
 import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Stream;
 
+import org.apache.isis.commons.internal.assertions._Ensure;
 import org.apache.isis.metamodel.MetaModelContext;
 
 import static org.apache.isis.commons.internal.base._With.requires;
 
-import lombok.val;
-
 
 public abstract class FacetAbstract implements Facet, MetaModelContext.Delegating {
 
@@ -98,10 +99,10 @@ public abstract class FacetAbstract implements Facet, MetaModelContext.Delegatin
                     throw new IllegalArgumentException("illegal argument, expected underlying facet (a multi-valued facet) to have equivalent to the facet type (or facet types) of this facet");
                 }
             } else {
-//                _Ensure.ensureThatArg(
-//                        underlyingFacet.facetType(), 
-//                        type->Objects.equals(type, facetType), 
-//                        ()->String.format("type-missmatch: underlying facet's type '%s' must match this facet's type '%s'"));
+                _Ensure.ensureThatArg(
+                        underlyingFacet.facetType(), 
+                        type->Objects.equals(type, facetType), 
+                        ()->String.format("type-missmatch: underlying facet's type '%s' must match this facet's type '%s'"));
             }
         }
         this.underlyingFacet = underlyingFacet;
@@ -113,8 +114,9 @@ public abstract class FacetAbstract implements Facet, MetaModelContext.Delegatin
             return multiTypedFacet.containsFacetTypeOf(this.facetType);
         }
 
-        val thisAsMultiTyped = (MultiTypedFacet) this;
-        return thisAsMultiTyped.facetTypes()
+        final MultiTypedFacet thisAsMultiTyped = (MultiTypedFacet) this;
+        final Stream<Class<? extends Facet>> facetTypes = thisAsMultiTyped.facetTypes();
+        return facetTypes
                 .anyMatch(facetType->multiTypedFacet.containsFacetTypeOf(facetType));
     }