Skip to content

Commit 034d987

Browse files
committed
Checkstyle fixes
1 parent b85d809 commit 034d987

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/support/DefaultMessagePropertiesConverter.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.springframework.amqp.core.MessageProperties;
3434
import org.springframework.util.CollectionUtils;
3535
import org.springframework.util.StringUtils;
36-
import org.springframework.util.NumberUtils;
3736

3837
/**
3938
* Default implementation of the {@link MessagePropertiesConverter} strategy.
@@ -45,6 +44,7 @@
4544
* @author Artem Bilan
4645
* @author Ngoc Nhan
4746
* @author Johan Kaving
47+
* @author Raul Avila
4848
*
4949
* @since 1.0
5050
*/
@@ -148,13 +148,11 @@ else if (MessageProperties.RETRY_COUNT.equals(key)) {
148148
if (target.getRetryCount() == 0) {
149149
List<Map<String, ?>> xDeathHeader = target.getXDeathHeader();
150150
if (!CollectionUtils.isEmpty(xDeathHeader)) {
151-
Object countValue = xDeathHeader.get(0).get("count");
151+
Object value = xDeathHeader.get(0).get("count");
152152

153-
if(countValue != null) {
154-
target.setRetryCount(
155-
NumberUtils.convertNumberToTargetClass((Number) countValue, Long.class));
153+
if (value instanceof Number numberValue) {
154+
target.setRetryCount(numberValue.longValue());
156155
}
157-
158156
}
159157
}
160158

0 commit comments

Comments
 (0)