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

Andi Huber reassigned ISIS-1331:
--------------------------------

    Assignee: Andi Huber

> 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)

Reply via email to