summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2016-01-25 15:02:32 +0200
committerVaadin Code Review <review@vaadin.com>2016-01-25 14:21:02 +0000
commit229832ffdb350a6c249fdce9871ddfe338887d5b (patch)
tree1db774f4b41fa48fed4a54ce19c5b8ff338f9093
parent4fd38bbe2215cdfbc33c724179cec83687a31cc4 (diff)
downloadvaadin-framework-229832ffdb350a6c249fdce9871ddfe338887d5b.tar.gz
vaadin-framework-229832ffdb350a6c249fdce9871ddfe338887d5b.zip
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
-rw-r--r--server/src/com/vaadin/data/util/GeneratedPropertyContainer.java5
1 files changed, 2 insertions, 3 deletions
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<Object> sortablePropertySet = new HashSet<Object>(