You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2023/05/26 17:04:33 UTC

[causeway] branch CAUSEWAY-3470 created (now c271458961)

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

danhaywood pushed a change to branch CAUSEWAY-3470
in repository https://gitbox.apache.org/repos/asf/causeway.git


      at c271458961 CAUSEWAY-3470: no longer contributes mixin members to mixin types

This branch includes the following new commits:

     new c271458961 CAUSEWAY-3470: no longer contributes mixin members to mixin types

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[causeway] 01/01: CAUSEWAY-3470: no longer contributes mixin members to mixin types

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-3470
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit c271458961fb9217ebe11815975750a65fac1aec
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri May 26 18:04:23 2023 +0100

    CAUSEWAY-3470: no longer contributes mixin members to mixin types
---
 .../specloader/specimpl/dflt/ObjectSpecificationDefault.java        | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java
index d8866d7cd4..830dffd177 100644
--- a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java
+++ b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java
@@ -200,6 +200,7 @@ implements FacetHolder {
     private Stream<ObjectAssociation> createAssociations() {
         return facetedMethodsBuilder.getAssociationFacetedMethods()
                 .stream()
+                .filter(x -> !isMixinContributedToMixin(x))
                 .map(this::createAssociation)
                 .filter(_NullSafe::isPresent);
     }
@@ -217,10 +218,15 @@ implements FacetHolder {
     private Stream<ObjectAction> createActions() {
         return facetedMethodsBuilder.getActionFacetedMethods()
                 .stream()
+                .filter(x -> !isMixinContributedToMixin(x))
                 .map(this::createAction)
                 .filter(_NullSafe::isPresent);
     }
 
+    private boolean isMixinContributedToMixin(FacetedMethod facetedMethod) {
+        return isMixin() && specForType(facetedMethod.getOwningType()).map(x -> x.isMixin()).orElse(false);
+    }
+
     private ObjectAction createAction(final FacetedMethod facetedMethod) {
         if (facetedMethod.getFeatureType().isAction()) {
             /* Assuming, that facetedMethod was already populated with ContributingFacet,