From 3db7de6eac975f75e76fafc1352f09cf2ac6fa53 Mon Sep 17 00:00:00 2001 From: Denis Anisimov Date: Fri, 16 Sep 2016 21:57:40 +0300 Subject: Make CheckBoxGroup.SimpleMultiSelectModel return a selection copy #293. getSelectedItems() must return a copy to fulfill the contract specified in SelectionModel: it must be a snapshot of the current state and safe to iterate over while changing selection. Change-Id: Ie2f15eb626dd80df2036bcb2d4e9387fc31389c9 --- server/src/main/java/com/vaadin/ui/CheckBoxGroup.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'server/src/main') diff --git a/server/src/main/java/com/vaadin/ui/CheckBoxGroup.java b/server/src/main/java/com/vaadin/ui/CheckBoxGroup.java index 8525dc6cbb..d5b2c5a851 100644 --- a/server/src/main/java/com/vaadin/ui/CheckBoxGroup.java +++ b/server/src/main/java/com/vaadin/ui/CheckBoxGroup.java @@ -71,7 +71,7 @@ public class CheckBoxGroup extends AbstractMultiSelect { @Override public Set getSelectedItems() { - return Collections.unmodifiableSet(selection); + return Collections.unmodifiableSet(new LinkedHashSet<>(selection)); } @Override -- cgit v1.2.3