summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <legioth@gmail.com>2017-02-14 15:00:06 +0200
committerHenri Sara <henri.sara@gmail.com>2017-02-14 15:00:06 +0200
commitc104bcebdeafa969fda772cb3d3157ff19e32c1e (patch)
treeee9251c3c5deab44408abd53d5b49307c16be43e
parent72c1956322c2e193f33696f9b1eb674fc4f81d15 (diff)
downloadvaadin-framework-c104bcebdeafa969fda772cb3d3157ff19e32c1e.tar.gz
vaadin-framework-c104bcebdeafa969fda772cb3d3157ff19e32c1e.zip
Clarify set/addSortComparator parameter name (#8562)
-rw-r--r--server/src/main/java/com/vaadin/data/provider/ListDataProvider.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/server/src/main/java/com/vaadin/data/provider/ListDataProvider.java b/server/src/main/java/com/vaadin/data/provider/ListDataProvider.java
index 039366418a..2f1e17d673 100644
--- a/server/src/main/java/com/vaadin/data/provider/ListDataProvider.java
+++ b/server/src/main/java/com/vaadin/data/provider/ListDataProvider.java
@@ -74,7 +74,7 @@ public class ListDataProvider<T>
/**
* Returns the underlying data items.
- *
+ *
* @return the underlying data items
*/
public Collection<T> getItems() {
@@ -134,12 +134,12 @@ public class ListDataProvider<T>
* @see #setSortOrder(ValueProvider, SortDirection)
* @see #addSortComparator(SerializableComparator)
*
- * @param sortOrder
+ * @param comparator
* a comparator to use, or <code>null</code> to clear any
* previously set sort order
*/
- public void setSortComparator(SerializableComparator<T> sortOrder) {
- this.sortOrder = sortOrder;
+ public void setSortComparator(SerializableComparator<T> comparator) {
+ this.sortOrder = comparator;
refreshAll();
}
@@ -180,20 +180,20 @@ public class ListDataProvider<T>
* @see #setSortComparator(SerializableComparator)
* @see #addSortOrder(ValueProvider, SortDirection)
*
- * @param sortOrder
+ * @param comparator
* a comparator to add, not <code>null</code>
*/
- public void addSortComparator(SerializableComparator<T> sortOrder) {
- Objects.requireNonNull(sortOrder, "Sort order to add cannot be null");
+ public void addSortComparator(SerializableComparator<T> comparator) {
+ Objects.requireNonNull(comparator, "Sort order to add cannot be null");
SerializableComparator<T> originalComparator = this.sortOrder;
if (originalComparator == null) {
- setSortComparator(sortOrder);
+ setSortComparator(comparator);
} else {
setSortComparator((a, b) -> {
int result = originalComparator.compare(a, b);
if (result == 0) {
- result = sortOrder.compare(a, b);
+ result = comparator.compare(a, b);
}
return result;
});