diff --git a/src/main/java/xyz/zhouxy/plusone/commons/util/PagingAndSortingQueryParams.java b/src/main/java/xyz/zhouxy/plusone/commons/util/PagingAndSortingQueryParams.java index b34bea2..3f4a88b 100644 --- a/src/main/java/xyz/zhouxy/plusone/commons/util/PagingAndSortingQueryParams.java +++ b/src/main/java/xyz/zhouxy/plusone/commons/util/PagingAndSortingQueryParams.java @@ -51,10 +51,11 @@ public class PagingAndSortingQueryParams { } public PagingAndSortingQueryParams(String... sortableColNames) { + Set sortableColNameSet = new HashSet<>(sortableColNames.length); for (String colName : sortableColNames) { Assert.isNotBlank(colName, "Column name must has text."); + sortableColNameSet.add(colName); } - Set sortableColNameSet = new HashSet<>(sortableColNames.length); this.sortableColNames = Collections.unmodifiableSet(sortableColNameSet); }