Use more efficient singletonList in JdbcAclService

This commit is contained in:
Сергей Цыпанов 2020-06-24 17:24:08 +03:00 committed by Eleftheria Stein-Kousathana
parent 95f1f81010
commit 3c2a97ed29
1 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@
package org.springframework.security.acls.jdbc; package org.springframework.security.acls.jdbc;
import java.io.Serializable; import java.io.Serializable;
import java.util.Arrays; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -99,7 +99,7 @@ public class JdbcAclService implements AclService {
return new ObjectIdentityImpl(javaType, identifier); return new ObjectIdentityImpl(javaType, identifier);
}); });
if (objects.size() == 0) { if (objects.isEmpty()) {
return null; return null;
} }
@ -108,7 +108,7 @@ public class JdbcAclService implements AclService {
public Acl readAclById(ObjectIdentity object, List<Sid> sids) public Acl readAclById(ObjectIdentity object, List<Sid> sids)
throws NotFoundException { throws NotFoundException {
Map<ObjectIdentity, Acl> map = readAclsById(Arrays.asList(object), sids); Map<ObjectIdentity, Acl> map = readAclsById(Collections.singletonList(object), sids);
Assert.isTrue(map.containsKey(object), Assert.isTrue(map.containsKey(object),
() -> "There should have been an Acl entry for ObjectIdentity " + object); () -> "There should have been an Acl entry for ObjectIdentity " + object);