diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/Disposables.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/Disposables.java index 33c23f3e6f..7a39f30aa3 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/Disposables.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/Disposables.java @@ -29,6 +29,8 @@ import org.springframework.beans.factory.DisposableBean; * case, the container does not automatically dispose of them. * * @author Gary Russell + * @author Artem Bilan + * * @since 5.1 * */ @@ -36,21 +38,20 @@ class Disposables implements DisposableBean { private final List disposables = new ArrayList<>(); - @SafeVarargs - @SuppressWarnings("varargs") public final void add(DisposableBean... disposablesToAdd) { this.disposables.addAll(Arrays.asList(disposablesToAdd)); } @Override public void destroy() { - this.disposables.forEach(d -> { + this.disposables.forEach((disposable) -> { try { - d.destroy(); + disposable.destroy(); } - catch (@SuppressWarnings("unused") Exception e) { + catch (@SuppressWarnings("unused") Exception ex) { // NOSONAR } }); } + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/LambdaMessageProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/LambdaMessageProcessor.java index 56ca5d8c4a..d53443942d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/LambdaMessageProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/LambdaMessageProcessor.java @@ -104,8 +104,8 @@ public class LambdaMessageProcessor implements MessageProcessor, BeanFac "An example of when this often occurs is if the lambda is configured to " + "receive a Message argument.", e.getCause()); } - throw new IllegalStateException( - "Could not invoke the method '" + this.method + "'", e.getCause()); // NOSONAR lost stack trace + throw new IllegalStateException( // NOSONAR lost stack trace + "Could not invoke the method '" + this.method + "'", e.getCause()); } catch (Exception e) { throw new IllegalStateException(