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

zhangliang 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 5dadc6d4594 Refactor PipelineContextUtils (#36254)
5dadc6d4594 is described below

commit 5dadc6d4594b64725859827c53e3fa7efda628aa
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Aug 11 19:29:28 2025 +0800

    Refactor PipelineContextUtils (#36254)
---
 .../infra/util/file/ConfigurationFileUtils.java             | 13 -------------
 .../it/data/pipeline/core/util/PipelineContextUtils.java    |  2 +-
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/file/ConfigurationFileUtils.java
 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/file/ConfigurationFileUtils.java
index ad50e0de679..143baeb8d91 100644
--- 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/file/ConfigurationFileUtils.java
+++ 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/file/ConfigurationFileUtils.java
@@ -25,7 +25,6 @@ import java.io.IOException;
 import java.net.URISyntaxException;
 import java.nio.file.Files;
 import java.nio.file.Paths;
-import java.util.stream.Collectors;
 
 /**
  * Configuration file utility class.
@@ -43,16 +42,4 @@ public final class ConfigurationFileUtils {
     public static String readFile(final String fileName) {
         return String.join(System.lineSeparator(), 
Files.readAllLines(Paths.get(ClassLoader.getSystemResource(fileName).toURI())));
     }
-    
-    /**
-     * Read file and ignore comments.
-     *
-     * @param fileName file name
-     * @return file content without comments
-     */
-    @SneakyThrows({IOException.class, URISyntaxException.class})
-    public static String readFileAndIgnoreComments(final String fileName) {
-        return 
Files.readAllLines(Paths.get(ClassLoader.getSystemResource(fileName).toURI()))
-                .stream().filter(each -> !each.isEmpty() && 
!each.startsWith("#")).map(each -> each + 
System.lineSeparator()).collect(Collectors.joining());
-    }
 }
diff --git 
a/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/util/PipelineContextUtils.java
 
b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/util/PipelineContextUtils.java
index f8c623338bf..af99c73ff5b 100644
--- 
a/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/util/PipelineContextUtils.java
+++ 
b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/util/PipelineContextUtils.java
@@ -107,7 +107,7 @@ public final class PipelineContextUtils {
             return;
         }
         ShardingSpherePipelineDataSourceConfiguration pipelineDataSourceConfig 
= new ShardingSpherePipelineDataSourceConfiguration(
-                
ConfigurationFileUtils.readFileAndIgnoreComments("config_sharding_sphere_jdbc_source.yaml"));
+                
ConfigurationFileUtils.readFile("config_sharding_sphere_jdbc_source.yaml"));
         YamlRootConfiguration rootConfig = (YamlRootConfiguration) 
pipelineDataSourceConfig.getDataSourceConfiguration();
         ModeConfiguration modeConfig = new 
YamlModeConfigurationSwapper().swapToObject(rootConfig.getMode());
         ContextManager contextManager = getContextManager(rootConfig);

Reply via email to