From 610d928413d581f8fa355e82b3058c6ed3404072 Mon Sep 17 00:00:00 2001 From: iroqueta <46004974+iroqueta@users.noreply.github.com> Date: Wed, 6 Nov 2024 09:50:46 -0300 Subject: [PATCH] Update Apache Commons Lang lib version (#909) Issue: 202088 --- .../src/main/java/com/genexus/util/GxJsonReader.java | 8 ++------ common/pom.xml | 10 +++++----- common/src/main/java/com/genexus/BaseProvider.java | 2 +- common/src/main/java/com/genexus/CommonUtil.java | 2 +- .../java/com/genexus/util/ExpressionEvaluator.java | 2 +- common/src/main/java/com/genexus/xml/XMLWriter.java | 2 +- .../genexus/cloud/serverless/GXProcedureExecutor.java | 2 +- .../main/java/com/genexus/cache/redis/RedisClient.java | 2 +- .../com/genexus/db/cosmosdb/CosmosDBConnection.java | 2 +- .../com/genexus/db/dynamodb/DynamoDBConnection.java | 2 +- .../main/java/com/genexus/internet/SMTPSession.java | 2 +- .../messaging/queue/azure/AzureQueueFactory.java | 2 +- .../java/com/genexus/security/web/SecureToken.java | 2 +- .../com/genexus/security/web/SecureTokenHelper.java | 2 +- .../java/com/genexus/security/web/WebSecureToken.java | 9 +++++---- .../com/genexus/security/web/WebSecurityHelper.java | 2 +- .../com/genexus/security/web/jose/jwt/JWTSigner.java | 4 ++-- .../java/com/genexus/webpanels/GXWebObjectBase.java | 2 +- .../main/java/com/genexus/webpanels/GXWebPanel.java | 2 +- java/src/main/java/com/genexus/GXutil.java | 2 +- java/src/main/java/com/genexus/PrivateUtilities.java | 2 +- .../java/com/genexus/webpanels/HttpContextWeb.java | 2 +- 22 files changed, 32 insertions(+), 35 deletions(-) diff --git a/android/src/main/java/com/genexus/util/GxJsonReader.java b/android/src/main/java/com/genexus/util/GxJsonReader.java index ba1ba2dd2..1273e14fd 100644 --- a/android/src/main/java/com/genexus/util/GxJsonReader.java +++ b/android/src/main/java/com/genexus/util/GxJsonReader.java @@ -5,7 +5,7 @@ import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; -import org.apache.commons.lang.CharEncoding; +import java.nio.charset.StandardCharsets; import com.genexus.internet.StringCollection; import com.google.gson.stream.JsonReader; @@ -14,11 +14,7 @@ public class GxJsonReader { private JsonReader reader; public GxJsonReader(InputStream stream) { - try { - reader = new JsonReader(new InputStreamReader(stream, CharEncoding.UTF_8)); - } catch (UnsupportedEncodingException e) { - //TODO - } + reader = new JsonReader(new InputStreamReader(stream, StandardCharsets.UTF_8)); } public boolean readBeginArray() { diff --git a/common/pom.xml b/common/pom.xml index 7c47afdba..2c5e4c0eb 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -30,11 +30,11 @@ commons-codec 1.15 - - commons-lang - commons-lang - 2.6 - + + org.apache.commons + commons-lang3 + 3.17.0 + commons-io commons-io diff --git a/common/src/main/java/com/genexus/BaseProvider.java b/common/src/main/java/com/genexus/BaseProvider.java index c0ee6e758..35a020a86 100644 --- a/common/src/main/java/com/genexus/BaseProvider.java +++ b/common/src/main/java/com/genexus/BaseProvider.java @@ -12,7 +12,7 @@ import com.genexus.diagnostics.core.ILogger; import com.genexus.diagnostics.core.LogManager; import com.genexus.xml.XMLReader; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import com.genexus.GXSmartCacheProvider.DataUpdateStatus; import com.genexus.common.classes.AbstractGXFile; diff --git a/common/src/main/java/com/genexus/CommonUtil.java b/common/src/main/java/com/genexus/CommonUtil.java index c3bec6a30..1c0c0ec0a 100644 --- a/common/src/main/java/com/genexus/CommonUtil.java +++ b/common/src/main/java/com/genexus/CommonUtil.java @@ -12,7 +12,7 @@ import java.text.*; import java.util.*; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.lang.reflect.*; import java.security.*; diff --git a/common/src/main/java/com/genexus/util/ExpressionEvaluator.java b/common/src/main/java/com/genexus/util/ExpressionEvaluator.java index 31cb56020..619628969 100644 --- a/common/src/main/java/com/genexus/util/ExpressionEvaluator.java +++ b/common/src/main/java/com/genexus/util/ExpressionEvaluator.java @@ -3,7 +3,7 @@ import java.util.*; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import com.genexus.ModelContext; import com.genexus.common.interfaces.SpecificImplementation; diff --git a/common/src/main/java/com/genexus/xml/XMLWriter.java b/common/src/main/java/com/genexus/xml/XMLWriter.java index 64e2e27e6..f884bfba5 100644 --- a/common/src/main/java/com/genexus/xml/XMLWriter.java +++ b/common/src/main/java/com/genexus/xml/XMLWriter.java @@ -8,7 +8,7 @@ import com.genexus.CommonUtil; import java.util.*; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.math.BigDecimal; diff --git a/gxawsserverless/src/main/java/com/genexus/cloud/serverless/GXProcedureExecutor.java b/gxawsserverless/src/main/java/com/genexus/cloud/serverless/GXProcedureExecutor.java index 0825efd0a..dda50cc8e 100644 --- a/gxawsserverless/src/main/java/com/genexus/cloud/serverless/GXProcedureExecutor.java +++ b/gxawsserverless/src/main/java/com/genexus/cloud/serverless/GXProcedureExecutor.java @@ -8,7 +8,7 @@ import com.genexus.cloud.serverless.model.EventMessageResponse; import com.genexus.cloud.serverless.model.EventMessages; import com.genexus.db.DynamicExecute; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; diff --git a/gxcache-redis/src/main/java/com/genexus/cache/redis/RedisClient.java b/gxcache-redis/src/main/java/com/genexus/cache/redis/RedisClient.java index caed36db8..d88cff398 100644 --- a/gxcache-redis/src/main/java/com/genexus/cache/redis/RedisClient.java +++ b/gxcache-redis/src/main/java/com/genexus/cache/redis/RedisClient.java @@ -8,7 +8,7 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonAutoDetect; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.databind.DeserializationFeature; diff --git a/gxcosmosdb/src/main/java/com/genexus/db/cosmosdb/CosmosDBConnection.java b/gxcosmosdb/src/main/java/com/genexus/db/cosmosdb/CosmosDBConnection.java index 52cfecfa6..e8fd57fd7 100644 --- a/gxcosmosdb/src/main/java/com/genexus/db/cosmosdb/CosmosDBConnection.java +++ b/gxcosmosdb/src/main/java/com/genexus/db/cosmosdb/CosmosDBConnection.java @@ -7,7 +7,7 @@ import com.azure.cosmos.CosmosAsyncDatabase; import com.azure.cosmos.CosmosClientBuilder; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.sql.ResultSet; import java.util.Collections; diff --git a/gxdynamodb/src/main/java/com/genexus/db/dynamodb/DynamoDBConnection.java b/gxdynamodb/src/main/java/com/genexus/db/dynamodb/DynamoDBConnection.java index 80ce0cdb4..bd9565e33 100644 --- a/gxdynamodb/src/main/java/com/genexus/db/dynamodb/DynamoDBConnection.java +++ b/gxdynamodb/src/main/java/com/genexus/db/dynamodb/DynamoDBConnection.java @@ -1,7 +1,7 @@ package com.genexus.db.dynamodb; import com.genexus.db.service.ServiceConnection; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; diff --git a/gxmail/src/main/java/com/genexus/internet/SMTPSession.java b/gxmail/src/main/java/com/genexus/internet/SMTPSession.java index bca8915c3..628870f03 100644 --- a/gxmail/src/main/java/com/genexus/internet/SMTPSession.java +++ b/gxmail/src/main/java/com/genexus/internet/SMTPSession.java @@ -23,7 +23,7 @@ import com.genexus.diagnostics.core.ILogger; import com.genexus.diagnostics.core.LogManager; import org.apache.commons.codec.binary.Base64OutputStream; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import com.genexus.CommonUtil; import com.genexus.common.interfaces.SpecificImplementation; diff --git a/gxqueue-azure/src/main/java/com/genexus/messaging/queue/azure/AzureQueueFactory.java b/gxqueue-azure/src/main/java/com/genexus/messaging/queue/azure/AzureQueueFactory.java index 20afd9f73..e79c6d961 100644 --- a/gxqueue-azure/src/main/java/com/genexus/messaging/queue/azure/AzureQueueFactory.java +++ b/gxqueue-azure/src/main/java/com/genexus/messaging/queue/azure/AzureQueueFactory.java @@ -6,7 +6,7 @@ import com.genexus.diagnostics.core.LogManager; import com.genexus.messaging.queue.SimpleMessageQueue; import com.genexus.services.ServiceConfigurationException; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; public class AzureQueueFactory { diff --git a/gxweb/src/main/java/com/genexus/security/web/SecureToken.java b/gxweb/src/main/java/com/genexus/security/web/SecureToken.java index eb94d9ad0..76525863c 100644 --- a/gxweb/src/main/java/com/genexus/security/web/SecureToken.java +++ b/gxweb/src/main/java/com/genexus/security/web/SecureToken.java @@ -1,5 +1,5 @@ package com.genexus.security.web; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; import com.genexus.internet.IGxJSONAble; diff --git a/gxweb/src/main/java/com/genexus/security/web/SecureTokenHelper.java b/gxweb/src/main/java/com/genexus/security/web/SecureTokenHelper.java index 2283615a5..f6c90d21a 100644 --- a/gxweb/src/main/java/com/genexus/security/web/SecureTokenHelper.java +++ b/gxweb/src/main/java/com/genexus/security/web/SecureTokenHelper.java @@ -3,7 +3,7 @@ import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import com.fasterxml.jackson.databind.ObjectMapper; import com.genexus.diagnostics.core.ILogger; diff --git a/gxweb/src/main/java/com/genexus/security/web/WebSecureToken.java b/gxweb/src/main/java/com/genexus/security/web/WebSecureToken.java index cece09808..95c3229f3 100644 --- a/gxweb/src/main/java/com/genexus/security/web/WebSecureToken.java +++ b/gxweb/src/main/java/com/genexus/security/web/WebSecureToken.java @@ -2,7 +2,8 @@ import java.util.Date; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateUtils; import json.org.json.IJsonFormattable; import json.org.json.JSONException; @@ -22,12 +23,12 @@ public class WebSecureToken extends SecureToken { private JSONObject _jObj = new JSONObject(); - public WebSecureToken(){ - _expiration = org.apache.commons.lang.time.DateUtils.addDays(new Date(), TOKEN_DAYS_EXPIRATION); + public WebSecureToken(){ + _expiration = DateUtils.addDays(new Date(), TOKEN_DAYS_EXPIRATION); } public WebSecureToken(String pgmName, String issuer, String value) { - _expiration = org.apache.commons.lang.time.DateUtils.addDays(new Date(), TOKEN_DAYS_EXPIRATION); + _expiration = DateUtils.addDays(new Date(), TOKEN_DAYS_EXPIRATION); _pgmName = pgmName; _value = value; _issuer = issuer; diff --git a/gxweb/src/main/java/com/genexus/security/web/WebSecurityHelper.java b/gxweb/src/main/java/com/genexus/security/web/WebSecurityHelper.java index ae7e393c6..b6ce0af87 100644 --- a/gxweb/src/main/java/com/genexus/security/web/WebSecurityHelper.java +++ b/gxweb/src/main/java/com/genexus/security/web/WebSecurityHelper.java @@ -3,7 +3,7 @@ import java.util.Date; import com.genexus.GXutil; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.Logger; import com.genexus.security.web.SecureTokenHelper.SecurityMode; diff --git a/gxweb/src/main/java/com/genexus/security/web/jose/jwt/JWTSigner.java b/gxweb/src/main/java/com/genexus/security/web/jose/jwt/JWTSigner.java index 3e66093f5..7a0c9206b 100644 --- a/gxweb/src/main/java/com/genexus/security/web/jose/jwt/JWTSigner.java +++ b/gxweb/src/main/java/com/genexus/security/web/jose/jwt/JWTSigner.java @@ -19,7 +19,7 @@ import java.util.Map; import java.util.UUID; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -27,7 +27,7 @@ import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang.Validate; +import org.apache.commons.lang3.Validate; import org.bouncycastle.jce.provider.BouncyCastleProvider; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/gxweb/src/main/java/com/genexus/webpanels/GXWebObjectBase.java b/gxweb/src/main/java/com/genexus/webpanels/GXWebObjectBase.java index 780c53c61..5ea48d087 100644 --- a/gxweb/src/main/java/com/genexus/webpanels/GXWebObjectBase.java +++ b/gxweb/src/main/java/com/genexus/webpanels/GXWebObjectBase.java @@ -1,6 +1,6 @@ package com.genexus.webpanels; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import com.genexus.*; import com.genexus.configuration.ConfigurationManager; diff --git a/gxweb/src/main/java/com/genexus/webpanels/GXWebPanel.java b/gxweb/src/main/java/com/genexus/webpanels/GXWebPanel.java index dd71a86a5..205b70cb5 100644 --- a/gxweb/src/main/java/com/genexus/webpanels/GXWebPanel.java +++ b/gxweb/src/main/java/com/genexus/webpanels/GXWebPanel.java @@ -27,7 +27,7 @@ import json.org.json.JSONArray; import json.org.json.JSONException; import json.org.json.JSONObject; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; class DataIntegrityException extends Exception { diff --git a/java/src/main/java/com/genexus/GXutil.java b/java/src/main/java/com/genexus/GXutil.java index d141ccde4..25f988f1d 100644 --- a/java/src/main/java/com/genexus/GXutil.java +++ b/java/src/main/java/com/genexus/GXutil.java @@ -16,7 +16,7 @@ import com.genexus.util.*; import json.org.json.JSONObject; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; public final class GXutil { diff --git a/java/src/main/java/com/genexus/PrivateUtilities.java b/java/src/main/java/com/genexus/PrivateUtilities.java index 25013c9fd..a040064c7 100644 --- a/java/src/main/java/com/genexus/PrivateUtilities.java +++ b/java/src/main/java/com/genexus/PrivateUtilities.java @@ -272,7 +272,7 @@ public static String checkFileNameLength(String baseDir, String fileName, String int pathLength; int fileNameLength = fileName.length(); int extensionLength = extension.length(); - if (org.apache.commons.lang.SystemUtils.IS_OS_WINDOWS) + if (isWindowsPlatform()) { pathLength = baseDir.length() + fileNameLength + extensionLength; if (pathLength > 260) diff --git a/java/src/main/java/com/genexus/webpanels/HttpContextWeb.java b/java/src/main/java/com/genexus/webpanels/HttpContextWeb.java index dc21ad1a5..809410f48 100644 --- a/java/src/main/java/com/genexus/webpanels/HttpContextWeb.java +++ b/java/src/main/java/com/genexus/webpanels/HttpContextWeb.java @@ -22,7 +22,7 @@ import com.genexus.fileupload.IFileItemIterator; import com.genexus.fileupload.servlet.ServletFileUpload; import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.Logger; import com.genexus.internet.GXNavigationHelper;