Refine use of substring operations

Closes gh-25445
This commit is contained in:
Juergen Hoeller
2020-08-07 14:50:44 +02:00
parent b254777744
commit ce4001dd40
15 changed files with 39 additions and 35 deletions

View File

@@ -106,8 +106,8 @@ public class TaskExecutorFactoryBean implements
int maxPoolSize;
int separatorIndex = this.poolSize.indexOf('-');
if (separatorIndex != -1) {
corePoolSize = Integer.valueOf(this.poolSize.substring(0, separatorIndex));
maxPoolSize = Integer.valueOf(this.poolSize.substring(separatorIndex + 1, this.poolSize.length()));
corePoolSize = Integer.parseInt(this.poolSize.substring(0, separatorIndex));
maxPoolSize = Integer.parseInt(this.poolSize.substring(separatorIndex + 1));
if (corePoolSize > maxPoolSize) {
throw new IllegalArgumentException(
"Lower bound of pool-size range must not exceed the upper bound");