Use parseInt without substring method
This commit is contained in:
committed by
Arjen Poutsma
parent
79d3f5c64c
commit
804b343cab
@@ -309,8 +309,8 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
|
||||
try {
|
||||
int separatorIndex = concurrency.indexOf('-');
|
||||
if (separatorIndex != -1) {
|
||||
setConcurrentConsumers(Integer.parseInt(concurrency.substring(0, separatorIndex)));
|
||||
setMaxConcurrentConsumers(Integer.parseInt(concurrency.substring(separatorIndex + 1)));
|
||||
setConcurrentConsumers(Integer.parseInt(concurrency, 0, separatorIndex, 10));
|
||||
setMaxConcurrentConsumers(Integer.parseInt(concurrency, separatorIndex + 1, concurrency.length(), 10));
|
||||
}
|
||||
else {
|
||||
setConcurrentConsumers(1);
|
||||
|
||||
@@ -126,7 +126,7 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta
|
||||
try {
|
||||
int separatorIndex = concurrency.indexOf('-');
|
||||
if (separatorIndex != -1) {
|
||||
setConcurrentConsumers(Integer.parseInt(concurrency.substring(separatorIndex + 1)));
|
||||
setConcurrentConsumers(Integer.parseInt(concurrency, separatorIndex + 1, concurrency.length(), 10));
|
||||
}
|
||||
else {
|
||||
setConcurrentConsumers(Integer.parseInt(concurrency));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -226,7 +226,7 @@ public class JmsActivationSpecConfig {
|
||||
try {
|
||||
int separatorIndex = concurrency.indexOf('-');
|
||||
if (separatorIndex != -1) {
|
||||
setMaxConcurrency(Integer.parseInt(concurrency.substring(separatorIndex + 1)));
|
||||
setMaxConcurrency(Integer.parseInt(concurrency, separatorIndex + 1, concurrency.length(), 10));
|
||||
}
|
||||
else {
|
||||
setMaxConcurrency(Integer.parseInt(concurrency));
|
||||
|
||||
Reference in New Issue
Block a user