[
https://issues.apache.org/jira/browse/ISIS-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16003417#comment-16003417
]
Dan Haywood commented on ISIS-1599:
-----------------------------------
Hmm.
Have taken a look at this, but it's not that easy to unpick.
* We are calling ActionModel#load(...) that basically invokes the action... the
ActionModel holds the argument values, the argument values having been
populated previously.
* Each argument's ObjectAdapter is obtained from a ScalarModel representing the
parameter type
* To obtain the corresponding adapter the ScalarModel's loadFromSuper is
called, that delegates up to the superclass, EntityModel.
* EntityModel in turn obtains the ObjectAdapter from the
adapterManager/persistence session.
In fact, scrub that.
We have ScalarModelWithMultiPending which interacts with ObjectAdapterMemento
... it reads the list of objects out of the select2 multiselect widget and
pushes them into the OAM. These are treated as a list and stay that way, and
we never look at the type of the parameter to which this ScalarModel refers.
To fix, I think that we'd need to extend ObjectAdapterMemento class to have
variants for set/sortedset as well as list.
> "Set" interface does not work as an action parameter's collection type
> -----------------------------------------------------------------------
>
> Key: ISIS-1599
> URL: https://issues.apache.org/jira/browse/ISIS-1599
> Project: Isis
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.14.0
> Reporter: Tadas Giniotis
> Priority: Minor
> Fix For: 1.17.0
>
>
> When using a Set<MyClass> as a parameter for an action -> it throws an
> exception when using that action. The same works correctly when using
> List<MyClass>.
> {quote}
> ...
> java.lang.IllegalArgumentException
> argument type mismatch
> sun.reflect.NativeMethodAccessorImpl#invoke0(null:-2)
> sun.reflect.NativeMethodAccessorImpl#invoke(null:-1)
> sun.reflect.DelegatingMethodAccessorImpl#invoke(null:-1)
> java.lang.reflect.Method#invoke(null:-1)
> org.apache.isis.core.metamodel.facets.actions.action.invocation.ActionInvocationFacetForDomainEventAbstract#invokeMethodElseFromCache(ActionInvocationFacetForDomainEventAbstract.java:408)
> org.apache.isis.core.metamodel.facets.actions.action.invocation.ActionInvocationFacetForDomainEventAbstract$2#execute(ActionInvocationFacetForDomainEventAbstract.java:262)
> org.apache.isis.core.metamodel.facets.actions.action.invocation.ActionInvocationFacetForDomainEventAbstract$2#execute(ActionInvocationFacetForDomainEventAbstract.java:223)
> org.apache.isis.applib.services.iactn.Interaction#executeInternal(Interaction.java:173)
> org.apache.isis.applib.services.iactn.Interaction#execute(Interaction.java:143)
>
> ...
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)