Avoid regex pattern matching for simple String replacement steps
Issue: SPR-17279
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -183,7 +183,7 @@ public class DateTimeFormatterFactory {
|
||||
// Using strict parsing to align with Joda-Time and standard DateFormat behavior:
|
||||
// otherwise, an overflow like e.g. Feb 29 for a non-leap-year wouldn't get rejected.
|
||||
// However, with strict parsing, a year digit needs to be specified as 'u'...
|
||||
String patternToUse = this.pattern.replace("yy", "uu");
|
||||
String patternToUse = StringUtils.replace(this.pattern, "yy", "uu");
|
||||
dateTimeFormatter = DateTimeFormatter.ofPattern(patternToUse).withResolverStyle(ResolverStyle.STRICT);
|
||||
}
|
||||
else if (this.iso != null && this.iso != ISO.NONE) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,6 +24,7 @@ import java.util.List;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* ClassFileTransformer-based weaver, allowing for a list of transformers to be
|
||||
@@ -73,7 +74,7 @@ public class WeavingTransformer {
|
||||
* @return (possibly transformed) class byte definition
|
||||
*/
|
||||
public byte[] transformIfNecessary(String className, byte[] bytes) {
|
||||
String internalName = className.replace(".", "/");
|
||||
String internalName = StringUtils.replace(className, ".", "/");
|
||||
return transformIfNecessary(className, internalName, bytes, null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user