You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2025/08/26 12:00:49 UTC
(jackrabbit-oak) branch OAK-11881 created (now ca3f3ffd7c)
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a change to branch OAK-11881
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
at ca3f3ffd7c OAK-11881: Remove usage of Guava Maps.map()
This branch includes the following new commits:
new ca3f3ffd7c OAK-11881: Remove usage of Guava Maps.map()
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(jackrabbit-oak) 01/01: OAK-11881: Remove usage of Guava Maps.map()
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch OAK-11881
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
commit ca3f3ffd7cc99c0ef0ff8304ea3d8a885bde5937
Author: Julian Reschke <re...@apache.org>
AuthorDate: Tue Aug 26 13:00:25 2025 +0100
OAK-11881: Remove usage of Guava Maps.map()
---
.../authentication/credentials/SimpleCredentialsSupport.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/oak-security-spi/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/credentials/SimpleCredentialsSupport.java b/oak-security-spi/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/credentials/SimpleCredentialsSupport.java
index d070d1f6d0..2bdc78df98 100644
--- a/oak-security-spi/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/credentials/SimpleCredentialsSupport.java
+++ b/oak-security-spi/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/credentials/SimpleCredentialsSupport.java
@@ -16,16 +16,15 @@
*/
package org.apache.jackrabbit.oak.spi.security.authentication.credentials;
+import java.util.Arrays;
import java.util.Collections;
+import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import javax.jcr.Credentials;
import javax.jcr.SimpleCredentials;
-import org.apache.jackrabbit.guava.common.collect.Maps;
-
-import org.apache.jackrabbit.oak.commons.collections.SetUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -64,8 +63,11 @@ public final class SimpleCredentialsSupport implements CredentialsSupport {
@NotNull
public Map<String, ?> getAttributes(@NotNull Credentials credentials) {
if (credentials instanceof SimpleCredentials) {
- final SimpleCredentials sc = (SimpleCredentials) credentials;
- return Maps.asMap(Collections.unmodifiableSet(SetUtils.toLinkedSet(sc.getAttributeNames())), sc::getAttribute);
+ SimpleCredentials sc = (SimpleCredentials) credentials;
+ Map<String, Object> result = new LinkedHashMap<>();
+ Arrays.asList(sc.getAttributeNames()).forEach(
+ attributeName -> result.put(attributeName, sc.getAttribute(attributeName)));
+ return result;
} else {
return Collections.emptyMap();
}