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 da...@apache.org on 2025/01/20 08:47:44 UTC

(jackrabbit-oak) branch OAK-11407 created (now c270c04116)

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

daim pushed a change to branch OAK-11407
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


      at c270c04116 OAK-11407 : removed usage of Guava Strings.EMPTY_STRING

This branch includes the following new commits:

     new c270c04116 OAK-11407 : removed usage of Guava Strings.EMPTY_STRING

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-11407 : removed usage of Guava Strings.EMPTY_STRING

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c270c04116f186ffa52fb17b72d9291c085109bf
Author: Rishabh Kumar <di...@adobe.com>
AuthorDate: Mon Jan 20 14:17:30 2025 +0530

    OAK-11407 : removed usage of Guava Strings.EMPTY_STRING
---
 .../oak/security/authentication/ldap/impl/LdapProviderConfig.java  | 7 ++++---
 .../authentication/ldap/impl/LdapIdentityProviderTest.java         | 3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java b/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java
index 643ee0e377..ace4901223 100644
--- a/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java
+++ b/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.directory.api.util.Strings;
 import org.apache.jackrabbit.oak.spi.security.ConfigurationParameters;
 import org.jetbrains.annotations.NotNull;
@@ -1218,12 +1219,12 @@ public class LdapProviderConfig {
     //OAK-5490
     private String[] removeEmptyStrings(@NotNull String[] params) {
         List<String> list = Arrays.asList(params);
-        if (!list.contains(Strings.EMPTY_STRING)) {
+        if (!list.contains(StringUtils.EMPTY)) {
             return params;
         }
         List<String> resultList = new LinkedList<>(list);
-        while (resultList.contains(Strings.EMPTY_STRING)) {
-            resultList.remove(Strings.EMPTY_STRING);
+        while (resultList.contains(StringUtils.EMPTY)) {
+            resultList.remove(StringUtils.EMPTY);
         }
         String[] result = new String[resultList.size()];
         return resultList.toArray(result);
diff --git a/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProviderTest.java b/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProviderTest.java
index 5b9e810fd1..37edd89eb4 100644
--- a/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProviderTest.java
+++ b/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProviderTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.jackrabbit.oak.security.authentication.ldap.impl;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.jackrabbit.guava.common.collect.Iterables;
 import org.apache.jackrabbit.guava.common.collect.Iterators;
 import org.apache.directory.api.util.Strings;
@@ -267,7 +268,7 @@ public class LdapIdentityProviderTest extends AbstractLdapIdentityProviderTest {
 
     @Test
     public void testRemoveEmptyString() throws Exception {
-        providerConfig.setCustomAttributes(new String[] {"a", Strings.EMPTY_STRING, "b" });
+        providerConfig.setCustomAttributes(new String[] {"a", StringUtils.EMPTY, "b" });
         assertArrayEquals("Array must not contain empty strings", new String[] {"a", "b" }, providerConfig.getCustomAttributes());
     }