Replace string arguments with char
Optimize method calls by replacing single character String arguments with char. Closes gh-11680
This commit is contained in:
committed by
Phillip Webb
parent
2735f57b0d
commit
b19dcb13e2
@@ -891,7 +891,7 @@ public class RabbitProperties {
|
||||
}
|
||||
|
||||
private String parseVirtualHost(String input) {
|
||||
int hostIndex = input.indexOf("/");
|
||||
int hostIndex = input.indexOf('/');
|
||||
if (hostIndex >= 0) {
|
||||
this.virtualHost = input.substring(hostIndex + 1);
|
||||
if (this.virtualHost.isEmpty()) {
|
||||
|
||||
@@ -132,7 +132,7 @@ abstract class RedisConnectionConfiguration {
|
||||
String password = null;
|
||||
if (uri.getUserInfo() != null) {
|
||||
password = uri.getUserInfo();
|
||||
int index = password.lastIndexOf(":");
|
||||
int index = password.lastIndexOf(':');
|
||||
if (index >= 0) {
|
||||
password = password.substring(index + 1);
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ class DataSourceBeanCreationFailureAnalyzer
|
||||
protected FailureAnalysis analyze(Throwable rootFailure,
|
||||
DataSourceBeanCreationException cause) {
|
||||
String message = cause.getMessage();
|
||||
String description = message.substring(0, message.indexOf(".")).trim();
|
||||
String action = message.substring(message.indexOf(".") + 1).trim();
|
||||
String description = message.substring(0, message.indexOf('.')).trim();
|
||||
String action = message.substring(message.indexOf('.') + 1).trim();
|
||||
return new FailureAnalysis(description, action, cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ public class ServerProperties {
|
||||
|
||||
public String getServletPrefix() {
|
||||
String result = this.path;
|
||||
int index = result.indexOf("*");
|
||||
int index = result.indexOf('*');
|
||||
if (index != -1) {
|
||||
result = result.substring(0, index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user