Skip to content

Commit 53597f9

Browse files
committed
Remove dependency on StringUtils in SortedProperties
See gh-23018, gh-22383
1 parent 1cfedb2 commit 53597f9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

spring-core/src/main/java/org/springframework/core/SortedProperties.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
import java.util.Set;
3131
import java.util.TreeSet;
3232

33-
import org.springframework.util.StringUtils;
34-
3533
/**
3634
* Specialization of {@link Properties} that sorts properties alphanumerically
3735
* based on their keys.
@@ -94,7 +92,7 @@ public void store(OutputStream out, String comments) throws IOException {
9492
ByteArrayOutputStream baos = new ByteArrayOutputStream();
9593
super.store(baos, (this.omitComments ? null : comments));
9694
String contents = new String(baos.toByteArray(), StandardCharsets.ISO_8859_1);
97-
for (String line : StringUtils.tokenizeToStringArray(contents, EOL)) {
95+
for (String line : contents.split(EOL)) {
9896
if (!this.omitComments || !line.startsWith("#")) {
9997
out.write((line + EOL).getBytes(StandardCharsets.ISO_8859_1));
10098
}
@@ -106,7 +104,7 @@ public void store(Writer writer, String comments) throws IOException {
106104
StringWriter stringWriter = new StringWriter();
107105
super.store(stringWriter, (this.omitComments ? null : comments));
108106
String contents = stringWriter.toString();
109-
for (String line : StringUtils.tokenizeToStringArray(contents, EOL)) {
107+
for (String line : contents.split(EOL)) {
110108
if (!this.omitComments || !line.startsWith("#")) {
111109
writer.write(line + EOL);
112110
}

0 commit comments

Comments
 (0)