ref #8321 cleaning up cotroller code
authorAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Thu, 6 Jun 2019 11:08:44 +0000 (13:08 +0200)
committerAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Thu, 27 Jun 2019 12:26:02 +0000 (14:26 +0200)
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/BaseListController.java

index d7e4d6fbeb28fbe62434fd4d332f00b197612b41..f403a7cdc24b18dde58d7b5ed7d05e5b82c46acf 100644 (file)
@@ -95,13 +95,13 @@ public abstract class BaseListController <T extends CdmBase, SERVICE extends ISe
     }\r
 \r
     @SuppressWarnings("unchecked")\r
-    @RequestMapping(method = {RequestMethod.GET,RequestMethod.POST}, params={"restriction"})\r
-    public final Pager<T> doPageByRestrictions(\r
+    @RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, params={"restriction"})\r
+    public Pager<T> doPageByRestrictions(\r
             @RequestParam(value = "pageNumber", required = false) Integer pageIndex,\r
             @RequestParam(value = "pageSize", required = false) Integer pageSize,\r
             @RequestParam(value = "class", required = false) Class type,\r
-            @RequestParam(value = "restriction", required = false) List<Restriction<?>> restrictions,\r
-            @RequestParam(value = "initStrategy", required = false) List<String> initStrategy,\r
+            @RequestParam(value = "restriction", required = true) List<Restriction<?>> restrictions,\r
+            @RequestParam(value = "initStrategy", required = true) List<String> initStrategy,\r
             @RequestParam(name="orderBy", defaultValue="BY_TITLE_CACHE_ASC", required=true) OrderHintPreset orderBy,\r
             HttpServletRequest request,\r
             HttpServletResponse response) throws IOException\r
@@ -115,8 +115,8 @@ public abstract class BaseListController <T extends CdmBase, SERVICE extends ISe
         if(type != null) {\r
             orderBy = orderBy.checkSuitableFor(type);\r
         }\r
-        ArrayList<Restriction<?>> restrictions2 = new ArrayList<>(restrictions);\r
-        return pageByRestrictions(type, initStrategy, orderBy, pagerParameters, restrictions2);\r
+\r
+        return pageByRestrictions(type, initStrategy, orderBy, pagerParameters, new ArrayList<>(restrictions));\r
     }\r
 \r
 \r