1 /* |
1 /* |
2 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
65 |
65 |
66 Stream.of(helloWorld.split(",")) |
66 Stream.of(helloWorld.split(",")) |
67 .forEach(System.out::println); |
67 .forEach(System.out::println); |
68 |
68 |
69 // Common concatenation patterns |
69 // Common concatenation patterns |
70 String const_I = "string" + args.length; |
70 String SS = String.valueOf(args.length) + String.valueOf(args.length); |
71 String const_S = "string" + String.valueOf(args.length); |
71 String CS = "string" + String.valueOf(args.length); |
72 String S_const = String.valueOf(args.length) + "string"; |
72 String SC = String.valueOf(args.length) + "string"; |
73 String S_S = String.valueOf(args.length) + String.valueOf(args.length); |
73 String SCS = String.valueOf(args.length) + "string" + String.valueOf(args.length); |
74 String const_J = "string" + System.currentTimeMillis(); |
74 String CSS = "string" + String.valueOf(args.length) + String.valueOf(args.length); |
75 String I_const = args.length + "string"; |
75 String CSCS = "string" + String.valueOf(args.length) + "string" + String.valueOf(args.length); |
76 String J_const = System.currentTimeMillis() + "string"; |
76 String SCSC = String.valueOf(args.length) + "string" + String.valueOf(args.length) + "string"; |
|
77 String CSCSC = "string" + String.valueOf(args.length) + "string" + String.valueOf(args.length) + "string"; |
|
78 String SCSCS = String.valueOf(args.length) + "string" + String.valueOf(args.length) + "string" + String.valueOf(args.length); |
|
79 String CI = "string" + args.length; |
|
80 String IC = args.length + "string"; |
|
81 String CIC = "string" + args.length + "string"; |
|
82 String CICI = "string" + args.length + "string" + args.length; |
|
83 String CJ = "string" + System.currentTimeMillis(); |
|
84 String JC = System.currentTimeMillis() + "string"; |
|
85 String CJC = "string" + System.currentTimeMillis() + "string"; |
|
86 String CJCJ = "string" + System.currentTimeMillis() + "string" + System.currentTimeMillis(); |
|
87 String CJCJC = "string" + System.currentTimeMillis() + "string" + System.currentTimeMillis() + "string"; |
77 |
88 |
78 String newDate = DateTimeFormatter.ISO_LOCAL_DATE_TIME.format( |
89 String newDate = DateTimeFormatter.ISO_LOCAL_DATE_TIME.format( |
79 LocalDateTime.now(ZoneId.of("GMT"))); |
90 LocalDateTime.now(ZoneId.of("GMT"))); |
80 |
91 |
81 String oldDate = String.format("%s%n", |
92 String oldDate = String.format("%s%n", |