Replace string arguments with char

Optimize method calls by replacing single character String arguments
with char.

Closes gh-11680
This commit is contained in:
andrey.onufreyko
2018-01-18 23:33:56 +03:00
committed by Phillip Webb
parent 2735f57b0d
commit b19dcb13e2
19 changed files with 24 additions and 24 deletions

View File

@@ -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()) {

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}