From 229832ffdb350a6c249fdce9871ddfe338887d5b Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 25 Jan 2016 15:02:32 +0200 Subject: Fix GeneratedPropertyContainer with non-Sortable Containers (#19511) Adds a missing throw to sort method and fixes getSortableContainerPropertyIds to return an empty collection if not sortable. Change-Id: I5df34234867762ce88e181a10ec015cd0336cd39 --- server/src/com/vaadin/data/util/GeneratedPropertyContainer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/data/util/GeneratedPropertyContainer.java b/server/src/com/vaadin/data/util/GeneratedPropertyContainer.java index e0b2bb7c19..98dd3ed0c1 100644 --- a/server/src/com/vaadin/data/util/GeneratedPropertyContainer.java +++ b/server/src/com/vaadin/data/util/GeneratedPropertyContainer.java @@ -489,7 +489,7 @@ public class GeneratedPropertyContainer extends AbstractContainer implements @Override public void sort(Object[] propertyId, boolean[] ascending) { if (sortableContainer == null) { - new UnsupportedOperationException( + throw new UnsupportedOperationException( "Wrapped container is not Sortable"); } @@ -538,8 +538,7 @@ public class GeneratedPropertyContainer extends AbstractContainer implements @Override public Collection getSortableContainerPropertyIds() { if (sortableContainer == null) { - new UnsupportedOperationException( - "Wrapped container is not Sortable"); + return Collections.emptySet(); } Set sortablePropertySet = new HashSet( -- cgit v1.2.3