You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Dan Haywood (JIRA)" <ji...@apache.org> on 2018/08/12 17:13:03 UTC

[jira] [Closed] (ISIS-1331) If return a google guava collection from an autoComplete or choices, then throws exception due to unsupported classes.

     [ https://issues.apache.org/jira/browse/ISIS-1331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Haywood closed ISIS-1331.
-----------------------------

> If return a google guava collection from an autoComplete or choices, then throws exception due to unsupported classes.
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: ISIS-1331
>                 URL: https://issues.apache.org/jira/browse/ISIS-1331
>             Project: Isis
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.11.1
>            Reporter: Dan Haywood
>            Assignee: Andi Huber
>            Priority: Minor
>             Fix For: 2.0.0-M1
>
>
> For example, this seemingly innocuous code:
> {code}
>     public List<SimpleObject> autoComplete(@MinLength(2) String search) {
>         return
>                     FluentIterable.from(listAll())
>                     .filter(new Predicate<SimpleObject>() {
>                         @Override public boolean apply(@Nullable final SimpleObject object) {
>                             return object.getName().contains(search);
>                         }
>                     })
>                     .toList();
>     }
> {code}
> will fail.  to make it work, the developer needs to copy to an ArrayList, eg:
> {code}
>     public List<SimpleObject> autoComplete(@MinLength(2) String search) {
>         return
>                 Lists.newArrayList(
>                     FluentIterable.from(listAll())
>                     .filter(new Predicate<SimpleObject>() {
>                         @Override public boolean apply(@Nullable final SimpleObject object) {
>                             return object.getName().contains(search);
>                         }
>                     })
>                     .toList()
>                 );
>     }
> {code}
> One possible solution is for the framework to do this automatically, for List, Set, Collection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)