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

panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new b637a6f  Remove dependency of StringUtils from common lang3  (#16026)
b637a6f is described below

commit b637a6f71519d7884916a5c8cfd42697b05793ed
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Mar 13 12:49:59 2022 +0800

    Remove dependency of StringUtils from common lang3  (#16026)
---
 .../metadata/persist/service/impl/DataSourcePersistServiceTest.java | 3 +--
 .../proxy/frontend/mysql/err/MySQLErrPacketFactory.java             | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git 
a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/service/impl/DataSourcePersistServiceTest.java
 
b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/service/impl/DataSourcePersistServiceTest.java
index 91c1d7a..7777b01 100644
--- 
a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/service/impl/DataSourcePersistServiceTest.java
+++ 
b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/service/impl/DataSourcePersistServiceTest.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.mode.metadata.persist.service.impl;
 
 import lombok.SneakyThrows;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.shardingsphere.infra.datasource.props.DataSourceProperties;
 import 
org.apache.shardingsphere.infra.datasource.props.DataSourcePropertiesCreator;
 import org.apache.shardingsphere.mode.persist.PersistRepository;
@@ -63,7 +62,7 @@ public final class DataSourcePersistServiceTest {
     @SneakyThrows({IOException.class, URISyntaxException.class})
     private String readDataSourceYaml(final String path) {
         return 
Files.readAllLines(Paths.get(ClassLoader.getSystemResource(path).toURI()))
-                .stream().filter(each -> StringUtils.isNotBlank(each) && 
!each.startsWith("#")).map(each -> each + 
System.lineSeparator()).collect(Collectors.joining());
+                .stream().filter(each -> !"".equals(each.trim()) && 
!each.startsWith("#")).map(each -> each + 
System.lineSeparator()).collect(Collectors.joining());
     }
     
     private void assertDataSourceProperties(final DataSourceProperties actual, 
final DataSourceProperties expected) {
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactory.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactory.java
index 824c35a..5a3d825 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactory.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactory.java
@@ -17,9 +17,10 @@
 
 package org.apache.shardingsphere.proxy.frontend.mysql.err;
 
+import com.google.common.base.Strings;
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
-import org.apache.commons.lang3.StringUtils;
+import 
org.apache.shardingsphere.data.pipeline.core.exception.PipelineJobNotFoundException;
 import org.apache.shardingsphere.db.protocol.error.CommonErrorCode;
 import 
org.apache.shardingsphere.db.protocol.mysql.constant.MySQLServerErrorCode;
 import 
org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLErrPacket;
@@ -40,7 +41,6 @@ import 
org.apache.shardingsphere.proxy.backend.text.distsql.ral.common.exception
 import 
org.apache.shardingsphere.proxy.frontend.exception.FrontendTooManyConnectionsException;
 import 
org.apache.shardingsphere.proxy.frontend.exception.UnsupportedCommandException;
 import 
org.apache.shardingsphere.proxy.frontend.exception.UnsupportedPreparedStatementException;
-import 
org.apache.shardingsphere.data.pipeline.core.exception.PipelineJobNotFoundException;
 import 
org.apache.shardingsphere.proxy.frontend.mysql.command.query.exception.UnknownCharacterSetException;
 import 
org.apache.shardingsphere.sharding.route.engine.exception.NoSuchTableException;
 import 
org.apache.shardingsphere.sharding.route.engine.exception.TableExistsException;
@@ -137,7 +137,7 @@ public final class MySQLErrPacketFactory {
     }
     
     private static String getErrorMessage(final SQLException cause) {
-        if (null != cause.getNextException() && 
StringUtils.isBlank(cause.getMessage())) {
+        if (null != cause.getNextException() && 
Strings.isNullOrEmpty(cause.getMessage())) {
             return cause.getNextException().getMessage();
         }
         return cause.getMessage();

Reply via email to