danhaywood commented on code in PR #1019:
URL: https://github.com/apache/isis/pull/1019#discussion_r926795472
##########
core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/IdentifierUtil.java:
##########
@@ -109,19 +120,39 @@ public Identifier memberIdentifierFor(
/**
* Whether given command corresponds to given objectMember.
* <p>
- * Is related to {@link #logicalMemberIdentifierFor(ObjectMember)}.
+ * Is related to {@link
#logicalMemberIdentifierForDeclaredMember(ObjectMember)}.
*/
public boolean isCommandForMember(
final @Nullable Command command,
+ final @NonNull InteractionHead interactionHead,
final @Nullable ObjectMember objectMember) {
return command!=null
&& objectMember!=null
- && logicalMemberIdentifierFor(objectMember)
+ && logicalMemberIdentifierFor(interactionHead, objectMember)
.equals(command.getLogicalMemberIdentifier());
}
// -- HELPER
+ private String logicalMemberIdentifierFor(
+ final @NonNull InteractionHead interactionHead,
+ final ObjectMember objectMember) {
+ if (objectMember instanceof ObjectAction) {
+ ObjectAction objectAction = (ObjectAction) objectMember;
+ if (objectAction.isDeclaredOnMixin()) {
+ if (interactionHead instanceof ActionInteractionHead) {
+ ObjectAction objectActionOnMixee =
((ActionInteractionHead) interactionHead).getMetaModel();
+ ObjectSpecification specificationOfMixee =
interactionHead.getOwner().getSpecification();
+ return logicalMemberIdentifierFor(specificationOfMixee,
objectActionOnMixee);
+ }
+ }
+ // we fall through to the declared case, which isn't correct; but
don't think it matters because
Review Comment:
I did some further clean-up, everywhere now calls the overload that passes
in an `InteractionHead` and so we are abstracted from whether the identifier is
for a mixin or for a regular action. (The integ tests for command log and
execution log helped pick up the missing cases).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]