Fix new Sonar smells

This commit is contained in:
Artem Bilan
2020-07-16 11:36:04 -04:00
parent b3111414fb
commit 8b16aede89
2 changed files with 6 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2020 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.
@@ -58,7 +58,7 @@ public final class IntegrationUtils {
/**
* Should be set to TRUE on CI plans and framework developer systems.
*/
public static final boolean fatalWhenNoBeanFactory =
public static final boolean FATAL_WHEN_NO_BEANFACTORY =
Boolean.parseBoolean(System.getenv("SI_FATAL_WHEN_NO_BEANFACTORY"));
private IntegrationUtils() {
@@ -96,7 +96,7 @@ public final class IntegrationUtils {
}
else {
LOGGER.debug("No 'beanFactory' supplied; cannot find MessageBuilderFactory, using default.");
if (fatalWhenNoBeanFactory) {
if (FATAL_WHEN_NO_BEANFACTORY) {
throw new IllegalStateException("All Message creators need a BeanFactory");
}
}

View File

@@ -182,7 +182,9 @@ public class KafkaProducerMessageHandler<K, V> extends AbstractReplyProducingMes
+ "configured to read uncommitted records");
}
determineSendTimeout();
this.deliveryTimeoutMsProperty = this.sendTimeoutExpression.getValue(Long.class) - TIMEOUT_BUFFER;
this.deliveryTimeoutMsProperty =
this.sendTimeoutExpression.getValue(Long.class) // NOSONAR - never null after determineSendTimeout()
- TIMEOUT_BUFFER;
}
private void determineSendTimeout() {