This is an automated email from the ASF dual-hosted git repository.

reschke pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new c45ea08a57 OAK-11881: Remove usage of Guava Maps.map() (#2475)
c45ea08a57 is described below

commit c45ea08a57e444b2db046690b59f99fb555d63f4
Author: Julian Reschke <resc...@apache.org>
AuthorDate: Thu Aug 28 14:04:59 2025 +0200

    OAK-11881: Remove usage of Guava Maps.map() (#2475)
---
 .../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..1cc5fb9547 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 Collections.unmodifiableMap(result);
         } else {
             return Collections.emptyMap();
         }

Reply via email to