You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/04/26 14:00:56 UTC
[shardingsphere] branch master updated: Use System.lineSeparator() instead of System.getProperty("line.separator") (#17132)
This is an automated email from the ASF dual-hosted git repository.
zhonghongsheng 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 b4399f7edba Use System.lineSeparator() instead of System.getProperty("line.separator") (#17132)
b4399f7edba is described below
commit b4399f7edba07d844b70bff9576bd3b1fa63db58
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Tue Apr 26 22:00:48 2022 +0800
Use System.lineSeparator() instead of System.getProperty("line.separator") (#17132)
---
.../segment/projection/impl/SubqueryProjectionConverter.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/shardingsphere-infra/shardingsphere-infra-federation/shardingsphere-infra-federation-optimizer/src/main/java/org/apache/shardingsphere/infra/federation/optimizer/converter/segment/projection/impl/SubqueryProjectionConverter.java b/shardingsphere-infra/shardingsphere-infra-federation/shardingsphere-infra-federation-optimizer/src/main/java/org/apache/shardingsphere/infra/federation/optimizer/converter/segment/projection/impl/SubqueryProjectionConverter.java
index f6590eda440..d0f51ce6800 100644
--- a/shardingsphere-infra/shardingsphere-infra-federation/shardingsphere-infra-federation-optimizer/src/main/java/org/apache/shardingsphere/infra/federation/optimizer/converter/segment/projection/impl/SubqueryProjectionConverter.java
+++ b/shardingsphere-infra/shardingsphere-infra-federation/shardingsphere-infra-federation-optimizer/src/main/java/org/apache/shardingsphere/infra/federation/optimizer/converter/segment/projection/impl/SubqueryProjectionConverter.java
@@ -40,8 +40,6 @@ import java.util.Optional;
*/
public final class SubqueryProjectionConverter implements SQLSegmentConverter<SubqueryProjectionSegment, SqlNode> {
- private static final String LINE_SEPARATOR = System.getProperty("line.separator");
-
@Override
public Optional<SqlNode> convertToSQLNode(final SubqueryProjectionSegment segment) {
if (null == segment) {
@@ -66,7 +64,7 @@ public final class SubqueryProjectionConverter implements SQLSegmentConverter<Su
int startIndex = getStartIndex(sqlNode) - 1;
int stopIndex = getStopIndex(sqlNode) + 1;
String text = "(" + sqlNode + ")";
- String originalText = text.replace(LINE_SEPARATOR, " ").replace(Quoting.BACK_TICK.string, "");
+ String originalText = text.replace(System.lineSeparator(), " ").replace(Quoting.BACK_TICK.string, "");
return Optional.of(new SubqueryProjectionSegment(new SubquerySegment(startIndex, stopIndex, selectStatement), originalText));
}
return Optional.empty();