You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Andi Huber (JIRA)" <ji...@apache.org> on 2018/08/13 09:12:00 UTC
[jira] [Comment Edited] (ISIS-1599) "Set" interface does not work
as an action parameter's collection type
[ https://issues.apache.org/jira/browse/ISIS-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16577987#comment-16577987 ]
Andi Huber edited comment on ISIS-1599 at 8/13/18 9:11 AM:
-----------------------------------------------------------
Reopening, because by now it's only partly solved. We need to think about what we actually want here, either:
1) Simple behavior (as implemented with 1.16.x):
Any collection passed to an Action or 'Supporting Method' (as parameter) is an ArrayList, no matter the actual Collection type returned by the 'Supporting Methods'. This is counter-intuitive but once users are aware of, not much of an issue.
2) Advanced behavior:
For Action's and 'Supporting Method's' parameters (and possibly return types of these), we could support these concrete Interfaces:
* Collection
* List
* Set
* SortedSet
But no other. Metadata validation would throw an error, if any other Collection type is used or when there is a 'Supporting Method' return type to receiver parameter type mismatch. This is slightly more intuitive than option 1) and allows for a slightly more flexible domain model.
was (Author: hobrom):
Reopening, because by now it's only partly solved. We need to think about what we actually want here, either:
1) Simple behavior (as currently implemented):
Any collection passed to an Action or 'Supporting Method' (as parameter) is an ArrayList, no matter the actual Collection type returned by the 'Supporting Methods'. This is counter-intuitive but once users are aware of, not much of an issue.
2) Advanced behavior:
For Action's and 'Supporting Method's' parameters (and possibly return types of these), we could support these concrete Interfaces:
* Collection
* List
* Set
* SortedSet
But no other. Metadata validation would throw an error, if any other Collection type is used or when there is a 'Supporting Method' return type to receiver parameter type mismatch. This is slightly more intuitive than option 1) and allows for a slightly more flexible domain model.
> "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
> Assignee: Andi Huber
> Priority: Minor
> Fix For: 2.0.0-M2
>
>
> 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
(v7.6.3#76005)