Use String indexOf(char) and lastIndexOf(char) where possible

Closes gh-11416
This commit is contained in:
Andy Wilkinson
2019-07-04 17:44:40 +01:00
parent 6a777a7f9b
commit 4b2a116fa7
7 changed files with 11 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 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.
@@ -28,7 +28,7 @@ public class SampleApplication {
if (!argument.startsWith("--spring.profiles.active=")) {
throw new IllegalArgumentException("Invalid argument " + argument);
}
int index = args[0].indexOf("=");
int index = args[0].indexOf('=');
String profile = argument.substring(index + 1);
System.out.println("I haz been run with profile(s) '" + profile + "'");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 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.
@@ -28,7 +28,7 @@ public class SampleApplication {
if (!argument.startsWith("--spring.profiles.active=")) {
throw new IllegalArgumentException("Invalid argument " + argument);
}
int index = args[0].indexOf("=");
int index = args[0].indexOf('=');
String profile = argument.substring(index + 1);
System.out.println("I haz been run with profile(s) '" + profile + "'");
}