mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-02 23:39:34 +00:00
Merge pull request #49816 from quaff
* patch-209: Do not use String#replaceAll() with a non-regex pattern Closes gh-49816
This commit is contained in:
+1
-1
@@ -92,7 +92,7 @@ final class PemCertificateParser {
|
||||
}
|
||||
|
||||
private static byte[] decodeBase64(String content) {
|
||||
byte[] bytes = content.replaceAll("\r", "").replaceAll("\n", "").getBytes();
|
||||
byte[] bytes = content.replace("\r", "").replace("\n", "").getBytes();
|
||||
return Base64.getDecoder().decode(bytes);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -240,7 +240,7 @@ final class PemPrivateKeyParser {
|
||||
}
|
||||
|
||||
private static byte[] decodeBase64(String content) {
|
||||
byte[] contentBytes = content.replaceAll("\r", "").replaceAll("\n", "").getBytes();
|
||||
byte[] contentBytes = content.replace("\r", "").replace("\n", "").getBytes();
|
||||
return Base64.getDecoder().decode(contentBytes);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -482,7 +482,7 @@ class LifecycleTests {
|
||||
return (invocation) -> {
|
||||
ContainerConfig config = invocation.getArgument(0, ContainerConfig.class);
|
||||
ArrayNode command = getCommand(config);
|
||||
String name = command.get(0).asText().substring(1).replaceAll("/", "-");
|
||||
String name = command.get(0).asText().substring(1).replace('/', '-');
|
||||
this.configs.put(name, config);
|
||||
if (invocation.getArguments().length > 2) {
|
||||
this.content.put(name, invocation.getArgument(2, ContainerContent.class));
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ public class PemFileWriter {
|
||||
Path writeFile(String name, String... contents) throws IOException {
|
||||
Path path = Paths.get(this.tempDir.toString(), name);
|
||||
for (String content : contents) {
|
||||
Files.write(path, content.replaceAll(EXAMPLE_SECRET_QUALIFIER, "").getBytes(), StandardOpenOption.CREATE,
|
||||
Files.write(path, content.replace(EXAMPLE_SECRET_QUALIFIER, "").getBytes(), StandardOpenOption.CREATE,
|
||||
StandardOpenOption.APPEND);
|
||||
}
|
||||
return path;
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ final class PemCertificateParser {
|
||||
}
|
||||
|
||||
private static byte[] decodeBase64(String content) {
|
||||
byte[] bytes = content.replaceAll("\r", "").replaceAll("\n", "").getBytes();
|
||||
byte[] bytes = content.replace("\r", "").replace("\n", "").getBytes();
|
||||
return Base64.getDecoder().decode(bytes);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -240,7 +240,7 @@ final class PemPrivateKeyParser {
|
||||
}
|
||||
|
||||
private static byte[] decodeBase64(String content) {
|
||||
byte[] contentBytes = content.replaceAll("\r", "").replaceAll("\n", "").getBytes();
|
||||
byte[] contentBytes = content.replace("\r", "").replace("\n", "").getBytes();
|
||||
return Base64.getDecoder().decode(contentBytes);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user