Use String indexOf(char) and lastIndexOf(char) where possible
Closes gh-11416
This commit is contained in:
@@ -108,7 +108,7 @@ class BindFailureAnalyzerTests {
|
||||
MutablePropertySources sources = context.getEnvironment().getPropertySources();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
for (String pair : environment) {
|
||||
int index = pair.indexOf("=");
|
||||
int index = pair.indexOf('=');
|
||||
String key = (index > 0) ? pair.substring(0, index) : pair;
|
||||
String value = (index > 0) ? pair.substring(index + 1) : "";
|
||||
map.put(key.trim(), value.trim());
|
||||
|
||||
@@ -119,7 +119,7 @@ class BindValidationFailureAnalyzerTests {
|
||||
MutablePropertySources sources = context.getEnvironment().getPropertySources();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
for (String pair : environment) {
|
||||
int index = pair.indexOf("=");
|
||||
int index = pair.indexOf('=');
|
||||
String key = (index > 0) ? pair.substring(0, index) : pair;
|
||||
String value = (index > 0) ? pair.substring(index + 1) : "";
|
||||
map.put(key.trim(), value.trim());
|
||||
|
||||
@@ -91,7 +91,7 @@ class UnboundConfigurationPropertyFailureAnalyzerTests {
|
||||
MutablePropertySources sources = context.getEnvironment().getPropertySources();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
for (String pair : environment) {
|
||||
int index = pair.indexOf("=");
|
||||
int index = pair.indexOf('=');
|
||||
String key = (index > 0) ? pair.substring(0, index) : pair;
|
||||
String value = (index > 0) ? pair.substring(index + 1) : "";
|
||||
map.put(key.trim(), value.trim());
|
||||
|
||||
Reference in New Issue
Block a user