Skip to content

Commit 8b16aed

Browse files
committed
Fix new Sonar smells
1 parent b311141 commit 8b16aed

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

spring-integration-core/src/main/java/org/springframework/integration/support/utils/IntegrationUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2019 the original author or authors.
2+
* Copyright 2014-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -58,7 +58,7 @@ public final class IntegrationUtils {
5858
/**
5959
* Should be set to TRUE on CI plans and framework developer systems.
6060
*/
61-
public static final boolean fatalWhenNoBeanFactory =
61+
public static final boolean FATAL_WHEN_NO_BEANFACTORY =
6262
Boolean.parseBoolean(System.getenv("SI_FATAL_WHEN_NO_BEANFACTORY"));
6363

6464
private IntegrationUtils() {
@@ -96,7 +96,7 @@ public static MessageBuilderFactory getMessageBuilderFactory(@Nullable BeanFacto
9696
}
9797
else {
9898
LOGGER.debug("No 'beanFactory' supplied; cannot find MessageBuilderFactory, using default.");
99-
if (fatalWhenNoBeanFactory) {
99+
if (FATAL_WHEN_NO_BEANFACTORY) {
100100
throw new IllegalStateException("All Message creators need a BeanFactory");
101101
}
102102
}

spring-integration-kafka/src/main/java/org/springframework/integration/kafka/outbound/KafkaProducerMessageHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ public KafkaProducerMessageHandler(final KafkaTemplate<K, V> kafkaTemplate) {
182182
+ "configured to read uncommitted records");
183183
}
184184
determineSendTimeout();
185-
this.deliveryTimeoutMsProperty = this.sendTimeoutExpression.getValue(Long.class) - TIMEOUT_BUFFER;
185+
this.deliveryTimeoutMsProperty =
186+
this.sendTimeoutExpression.getValue(Long.class) // NOSONAR - never null after determineSendTimeout()
187+
- TIMEOUT_BUFFER;
186188
}
187189

188190
private void determineSendTimeout() {

0 commit comments

Comments
 (0)