Skip to content

Commit 77891b4

Browse files
kexianjuncarryxyh
authored andcommitted
replace ‘\n’ with lineSeparator (#3058)
replace \n to System.lineSeparator
1 parent 7d3c6bc commit 77891b4

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/impl/Ls.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public String execute(CommandContext commandContext, String[] args) {
4444

4545
public String listProvider() {
4646
StringBuilder stringBuilder = new StringBuilder();
47-
stringBuilder.append("As Provider side:\n");
47+
stringBuilder.append("As Provider side:" + System.lineSeparator());
4848
Collection<ProviderModel> ProviderModelList = ApplicationModel.allProviderModels();
4949

5050
TTable tTable = new TTable(new TTable.ColumnDefine[]{
@@ -66,7 +66,7 @@ public String listProvider() {
6666

6767
public String listConsumer() {
6868
StringBuilder stringBuilder = new StringBuilder();
69-
stringBuilder.append("As Consumer side:\n");
69+
stringBuilder.append("As Consumer side:" + System.lineSeparator());
7070
Collection<ConsumerModel> consumerModelList = ApplicationModel.allConsumerModels();
7171

7272
TTable tTable = new TTable(new TTable.ColumnDefine[]{

dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/server/DubboLogo.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
public class DubboLogo {
2020
public static final String dubbo =
21-
" ___ __ __ ___ ___ ____ \n" +
22-
" / _ \\ / / / // _ ) / _ ) / __ \\ \n" +
23-
" / // // /_/ // _ |/ _ |/ /_/ / \n" +
24-
"/____/ \\____//____//____/ \\____/ \n";
21+
" ___ __ __ ___ ___ ____ " + System.lineSeparator() +
22+
" / _ \\ / / / // _ ) / _ ) / __ \\ " + System.lineSeparator() +
23+
" / // // /_/ // _ |/ _ |/ /_/ / " + System.lineSeparator() +
24+
"/____/ \\____//____//____/ \\____/ " + System.lineSeparator();
2525
}

dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/textui/TKv.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private String filterEmptyLine(String content) {
7171
line = " ";
7272
}
7373
}
74-
sb.append(line).append('\n');
74+
sb.append(line).append(System.lineSeparator());
7575
}
7676
} finally {
7777
if (null != scanner) {

dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/textui/TLadder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public String rendering() {
4848
if (deep == 0) {
4949
ladderSB
5050
.append(item)
51-
.append("\n");
51+
.append(System.lineSeparator());
5252
}
5353

5454
// need separator for others
@@ -57,7 +57,7 @@ public String rendering() {
5757
.append(repeat(STEP_CHAR, deep * INDENT_STEP))
5858
.append(LADDER_CHAR)
5959
.append(item)
60-
.append("\n");
60+
.append(System.lineSeparator());
6161
}
6262

6363
deep++;

dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/textui/TTable.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ public String rendering() {
7676
// print first separation line
7777
if (isFirstRow
7878
&& border.has(Border.BORDER_OUTER_TOP)) {
79-
tableSB.append(drawSeparationLine(widthCacheArray)).append("\n");
79+
tableSB.append(drawSeparationLine(widthCacheArray)).append(System.lineSeparator());
8080
}
8181

8282
// print inner separation lines
8383
if (!isFirstRow
8484
&& border.has(Border.BORDER_INNER_H)) {
85-
tableSB.append(drawSeparationLine(widthCacheArray)).append("\n");
85+
tableSB.append(drawSeparationLine(widthCacheArray)).append(System.lineSeparator());
8686
}
8787

8888
// draw one line
@@ -92,7 +92,7 @@ public String rendering() {
9292
// print ending separation line
9393
if (isLastRow
9494
&& border.has(Border.BORDER_OUTER_BOTTOM)) {
95-
tableSB.append(drawSeparationLine(widthCacheArray)).append("\n");
95+
tableSB.append(drawSeparationLine(widthCacheArray)).append(System.lineSeparator());
9696
}
9797

9898
}
@@ -157,7 +157,7 @@ private String drawRow(int[] widthCacheArray, int rowIndex) {
157157
if (border.has(Border.BORDER_OUTER_RIGHT)) {
158158
segmentSB.append("|");
159159
}
160-
segmentSB.append("\n");
160+
segmentSB.append(System.lineSeparator());
161161
}
162162

163163
}

dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/textui/TTree.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void callback(int deep, boolean isLast, String prefix, Node node) {
9292
.append(hasChild ? "|" : EMPTY)
9393
.append(repeat(' ', costPrefixLength))
9494
.append(scanner.nextLine())
95-
.append("\n");
95+
.append(System.lineSeparator());
9696
}
9797
}
9898
} finally {

0 commit comments

Comments
 (0)