From b1506079ac9ed971d9c658043f83fa5886564f3a Mon Sep 17 00:00:00 2001 From: jcardus Date: Thu, 8 Jul 2021 03:04:17 +0100 Subject: inline list --- src/main/java/org/traccar/api/resource/PermissionsResource.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/traccar/api/resource/PermissionsResource.java b/src/main/java/org/traccar/api/resource/PermissionsResource.java index 7502e9134..0acca5273 100644 --- a/src/main/java/org/traccar/api/resource/PermissionsResource.java +++ b/src/main/java/org/traccar/api/resource/PermissionsResource.java @@ -18,6 +18,7 @@ package org.traccar.api.resource; import java.sql.SQLException; import java.util.ArrayList; +import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; @@ -59,9 +60,7 @@ public class PermissionsResource extends BaseResource { @POST public Response add(LinkedHashMap entity) throws SQLException, ClassNotFoundException { - List> list = new ArrayList<>(); - list.add(entity); - return add(list); + return add(Collections.singletonList(entity)); } @Path("bulk") @@ -85,9 +84,7 @@ public class PermissionsResource extends BaseResource { @DELETE public Response remove(LinkedHashMap entity) throws SQLException, ClassNotFoundException { - List> list = new ArrayList<>(); - list.add(entity); - return remove(list); + return remove(Collections.singletonList(entity)); } @DELETE -- cgit v1.2.3