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

jacopoc pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git

commit afd2c1a29418e5fd28d6cc1e1c401990f1e51b6d
Author: Jacopo Cappellato <[email protected]>
AuthorDate: Thu Apr 16 12:00:21 2026 +0200

    Fixed: Replace deprecated StringUtils methods with native string operations 
to resolve compilation warnings
    
    (cherry picked from commit 685c1940e13f697063a7a7573f3cd2d768d774ca)
---
 .../base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java      | 3 ++-
 .../src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java | 4 ++--
 .../src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java     | 3 +--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java 
b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java
index 2c7fae4427..cf07507adf 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java
@@ -459,7 +459,8 @@ public class UtilCodec {
 
         // check for js events
         String onEvent = "on" + StringUtils.substringBetween(value, " on", 
"=");
-        if (JS_EVENT_LIST.stream().anyMatch(str -> 
StringUtils.containsIgnoreCase(str, onEvent))
+        String onEventLower = onEvent.toLowerCase(Locale.ROOT);
+        if (JS_EVENT_LIST.stream().anyMatch(s -> 
s.toLowerCase(Locale.ROOT).contains(onEventLower))
                 || value.contains("seekSegmentTime")) {
             String issueMsg = null;
             if (locale.equals(new Locale("test"))) { // labels are not 
available in testClasses Gradle task
diff --git 
a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java
 
b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java
index 520f911b3b..7a79af415e 100644
--- 
a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java
+++ 
b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java
@@ -43,7 +43,6 @@ import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.stream.StreamSource;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.ofbiz.base.location.FlexibleLocation;
 import org.apache.ofbiz.base.util.Debug;
 import org.apache.ofbiz.base.util.FileUtil;
@@ -290,7 +289,8 @@ public class UelFunctions {
 
     public static String replaceFirst(String str1, String str2, String str3) {
         if (null == str1) return null;
-        return StringUtils.replaceOnce(str1, str2, str3);
+        int idx = str1.indexOf(str2);
+        return idx < 0 ? str1 : str1.substring(0, idx) + str3 + 
str1.substring(idx + str2.length());
     }
 
     public static boolean startsWith(String str1, String str2) {
diff --git 
a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
 
b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
index aa00b03bba..84a60eec73 100644
--- 
a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
+++ 
b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
@@ -48,7 +48,6 @@ import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.ofbiz.base.location.FlexibleLocation;
 import org.apache.ofbiz.base.util.Debug;
 import org.apache.ofbiz.base.util.GeneralException;
@@ -809,7 +808,7 @@ public class WebToolsServices {
                         entityMap.put("title", entity.getTitle());
                         entityMap.put("description", entityDescription);
                         String entityLocation = entity.getLocation();
-                        entityLocation = 
StringUtils.replaceOnce(entityLocation, System.getProperty("ofbiz.home") + "/", 
"");
+                        entityLocation = 
entityLocation.replace(System.getProperty("ofbiz.home") + "/", "");
                         entityMap.put("location", entityLocation);
                         entityMap.put("javaNameList", javaNameList);
                         entityMap.put("relationsList", relationsList);

Reply via email to