diff --git a/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/Camel.java b/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/Camel.java index 2529265bcd..6542989318 100644 --- a/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/Camel.java +++ b/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/Camel.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 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. @@ -19,8 +19,7 @@ package org.springframework.integration.camel.dsl; import org.apache.camel.ExchangePattern; import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.LambdaRouteBuilder; - -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * Factory class for Apache Camel components DSL. diff --git a/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/CamelMessageHandlerSpec.java b/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/CamelMessageHandlerSpec.java index cb2438e153..cc32773695 100644 --- a/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/CamelMessageHandlerSpec.java +++ b/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/CamelMessageHandlerSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2025 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. @@ -23,6 +23,7 @@ import java.util.function.Function; import org.apache.camel.ExchangePattern; import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.LambdaRouteBuilder; +import org.jspecify.annotations.Nullable; import org.springframework.expression.Expression; import org.springframework.integration.camel.outbound.CamelMessageHandler; @@ -30,7 +31,6 @@ import org.springframework.integration.camel.support.CamelHeaderMapper; import org.springframework.integration.dsl.MessageHandlerSpec; import org.springframework.integration.expression.FunctionExpression; import org.springframework.integration.mapping.HeaderMapper; -import org.springframework.lang.Nullable; import org.springframework.messaging.Message; import org.springframework.util.Assert; diff --git a/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/package-info.java b/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/package-info.java index d89c111545..9bd3466601 100644 --- a/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/package-info.java +++ b/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/package-info.java @@ -2,6 +2,5 @@ * Provides supporting classes for JavaDSL with Apache Camel components. */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.integration.camel.dsl; diff --git a/spring-integration-camel/src/main/java/org/springframework/integration/camel/outbound/CamelMessageHandler.java b/spring-integration-camel/src/main/java/org/springframework/integration/camel/outbound/CamelMessageHandler.java index 73fc8f0377..04a3697349 100644 --- a/spring-integration-camel/src/main/java/org/springframework/integration/camel/outbound/CamelMessageHandler.java +++ b/spring-integration-camel/src/main/java/org/springframework/integration/camel/outbound/CamelMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2025 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. @@ -28,6 +28,7 @@ import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.LambdaRouteBuilder; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.model.RouteDefinition; +import org.jspecify.annotations.Nullable; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanInitializationException; @@ -40,7 +41,6 @@ import org.springframework.integration.expression.ValueExpression; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.mapping.HeaderMapper; import org.springframework.integration.support.AbstractIntegrationMessageBuilder; -import org.springframework.lang.Nullable; import org.springframework.messaging.Message; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -68,6 +68,7 @@ import org.springframework.util.StringUtils; */ public class CamelMessageHandler extends AbstractReplyProducingMessageHandler { + @SuppressWarnings("NullAway.Init") private ProducerTemplate producerTemplate; private Expression exchangePatternExpression = new ValueExpression<>(ExchangePattern.InOnly); @@ -83,6 +84,7 @@ public class CamelMessageHandler extends AbstractReplyProducingMessageHandler { @Nullable private Expression exchangePropertiesExpression; + @SuppressWarnings("NullAway.Init") private StandardEvaluationContext evaluationContext; public CamelMessageHandler() { @@ -197,6 +199,7 @@ public class CamelMessageHandler extends AbstractReplyProducingMessageHandler { } @Override + @Nullable protected Object handleRequestMessage(Message requestMessage) { ExchangePattern exchangePattern = this.exchangePatternExpression.getValue(this.evaluationContext, requestMessage, ExchangePattern.class); diff --git a/spring-integration-camel/src/main/java/org/springframework/integration/camel/outbound/package-info.java b/spring-integration-camel/src/main/java/org/springframework/integration/camel/outbound/package-info.java index 7206e2501a..19ea69d3d2 100644 --- a/spring-integration-camel/src/main/java/org/springframework/integration/camel/outbound/package-info.java +++ b/spring-integration-camel/src/main/java/org/springframework/integration/camel/outbound/package-info.java @@ -2,6 +2,5 @@ * Provides classes for Apache Camel outbound channel adapters. */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.integration.camel.outbound; diff --git a/spring-integration-camel/src/main/java/org/springframework/integration/camel/support/package-info.java b/spring-integration-camel/src/main/java/org/springframework/integration/camel/support/package-info.java index c7a863cc77..bed359ce73 100644 --- a/spring-integration-camel/src/main/java/org/springframework/integration/camel/support/package-info.java +++ b/spring-integration-camel/src/main/java/org/springframework/integration/camel/support/package-info.java @@ -2,6 +2,5 @@ * Provides supporting classes for Apache Camel channel adapters. */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.integration.camel.support;