Description
For example, this seemingly innocuous 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(); }
will fail. to make it work, the developer needs to copy to an ArrayList, eg:
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() ); }
One possible solution is for the framework to do this automatically, for List, Set, Collection.
Attachments
Issue Links
- Is contained by
-
CAUSEWAY-1599 "Set" interface does not work as an action parameter's collection type
- Closed