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

zhaojinchao 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 b2e8f52e522 Add test cases on URLArgumentLine (#33188)
b2e8f52e522 is described below

commit b2e8f52e522f5889b37e9ce0a92bbea5f2cedac6
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Oct 9 18:17:25 2024 +0800

    Add test cases on URLArgumentLine (#33188)
---
 .../apache/shardingsphere/infra/url/core/arg/URLArgumentLine.java | 8 ++++----
 .../shardingsphere/infra/url/core/arg/URLArgumentLineTest.java    | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/infra/url/core/src/main/java/org/apache/shardingsphere/infra/url/core/arg/URLArgumentLine.java
 
b/infra/url/core/src/main/java/org/apache/shardingsphere/infra/url/core/arg/URLArgumentLine.java
index fcbd8b1763e..e635017bef9 100644
--- 
a/infra/url/core/src/main/java/org/apache/shardingsphere/infra/url/core/arg/URLArgumentLine.java
+++ 
b/infra/url/core/src/main/java/org/apache/shardingsphere/infra/url/core/arg/URLArgumentLine.java
@@ -71,11 +71,11 @@ public final class URLArgumentLine {
         return rightTrim(result);
     }
     
-    private String rightTrim(final StringBuffer result) {
-        while (result.length() > 0 && 
Character.isWhitespace(result.charAt(result.length() - 1))) {
-            result.deleteCharAt(result.length() - 1);
+    private String rightTrim(final StringBuffer buffer) {
+        while (buffer.length() > 0 && 
Character.isWhitespace(buffer.charAt(buffer.length() - 1))) {
+            buffer.deleteCharAt(buffer.length() - 1);
         }
-        return result.toString();
+        return buffer.toString();
     }
     
     private String getArgumentValue(final String argName, final 
URLArgumentPlaceholderType type) {
diff --git 
a/infra/url/core/src/test/java/org/apache/shardingsphere/infra/url/core/arg/URLArgumentLineTest.java
 
b/infra/url/core/src/test/java/org/apache/shardingsphere/infra/url/core/arg/URLArgumentLineTest.java
index 898b7f4f084..ae9b61f8c88 100644
--- 
a/infra/url/core/src/test/java/org/apache/shardingsphere/infra/url/core/arg/URLArgumentLineTest.java
+++ 
b/infra/url/core/src/test/java/org/apache/shardingsphere/infra/url/core/arg/URLArgumentLineTest.java
@@ -32,7 +32,7 @@ class URLArgumentLineTest {
     
     private final String lineMultiple1 = 
"key1=$${value1::default_value1}:key2=$${value2::default_value2}:tail";
     
-    private final String lineMultiple2 = 
"key1=$${value1::}:key2=$${value2::}:tail";
+    private final String lineMultiple2 = 
"key1=$${value1::}:key2=$${value2::}:tail ";
     
     @Test
     void assertParseWithInvalidPattern() {

Reply via email to