Bug 513530 - AdaptorManager cannot return an immutable list of Resources
Summary: AdaptorManager cannot return an immutable list of Resources
Status: NEW
Alias: None
Product: Lyo
Classification: Technology
Component: Tools (show other bugs)
Version: 2.1.0   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 2.x.x   Edit
Assignee: Jad El-khoury CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-12 13:03 EDT by Andrii Berezovskyi CLA
Modified: 2017-03-12 13:03 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrii Berezovskyi CLA 2017-03-12 13:03:41 EDT
If we return an immutable list (e.g. https://google.github.io/guava/releases/snapshot/api/docs/com/google/common/collect/ImmutableList.html), the generated adaptor will break due to the subsequent List.remove calls by the framework (https://docs.oracle.com/javase/8/docs/api/java/util/List.html#remove-int-).

We should instead call List.sublist (https://docs.oracle.com/javase/8/docs/api/java/util/List.html#subList-int-int-) and document the n+1 behaviour in some generated Javadoc.