This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 23db0da261d6 CAMEL-23542: Restore @Nullable annotations removed by the 
requireNonNull revert
23db0da261d6 is described below

commit 23db0da261d68bb4ae0175d9b6b07df2f7ee83b6
Author: Guillaume Nodet <[email protected]>
AuthorDate: Tue May 19 10:57:51 2026 +0200

    CAMEL-23542: Restore @Nullable annotations removed by the requireNonNull 
revert
    
    - Restore @Nullable on message and exchange params in 
CamelExchangeException and ValidationException
    - Add @Nullable on Throwable cause param in CamelExchangeException
    - Restore @Nullable on setValidationLevels param in RestConfiguration
---
 .../src/main/java/org/apache/camel/CamelExchangeException.java      | 4 ++--
 .../src/main/java/org/apache/camel/ValidationException.java         | 6 ++++--
 .../src/main/java/org/apache/camel/spi/RestConfiguration.java       | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git 
a/core/camel-api/src/main/java/org/apache/camel/CamelExchangeException.java 
b/core/camel-api/src/main/java/org/apache/camel/CamelExchangeException.java
index ca7c7100468b..8996fb6622fd 100644
--- a/core/camel-api/src/main/java/org/apache/camel/CamelExchangeException.java
+++ b/core/camel-api/src/main/java/org/apache/camel/CamelExchangeException.java
@@ -38,7 +38,7 @@ public class CamelExchangeException extends CamelException {
      * @param message  the detail message
      * @param exchange the exchange that caused the error
      */
-    public CamelExchangeException(String message, @Nullable Exchange exchange) 
{
+    public CamelExchangeException(@Nullable String message, @Nullable Exchange 
exchange) {
         super(CamelExchangeException.createExceptionMessage(message, exchange, 
null));
         this.exchange = exchange;
     }
@@ -48,7 +48,7 @@ public class CamelExchangeException extends CamelException {
      * @param exchange the exchange that caused the error
      * @param cause    the cause of the failure
      */
-    public CamelExchangeException(String message, @Nullable Exchange exchange, 
Throwable cause) {
+    public CamelExchangeException(@Nullable String message, @Nullable Exchange 
exchange, @Nullable Throwable cause) {
         super(CamelExchangeException.createExceptionMessage(message, exchange,
                 cause),
               cause);
diff --git 
a/core/camel-api/src/main/java/org/apache/camel/ValidationException.java 
b/core/camel-api/src/main/java/org/apache/camel/ValidationException.java
index f7cb8694801c..f67ffda5447f 100644
--- a/core/camel-api/src/main/java/org/apache/camel/ValidationException.java
+++ b/core/camel-api/src/main/java/org/apache/camel/ValidationException.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel;
 
+import org.jspecify.annotations.Nullable;
+
 /**
  * The base class for any validation exception, such as
  * {@link 
org.apache.camel.support.processor.validation.SchemaValidationException} so 
that it is easy to treat all
@@ -27,7 +29,7 @@ public class ValidationException extends 
CamelExchangeException {
      * @param exchange the exchange that failed validation
      * @param message  the detail message
      */
-    public ValidationException(Exchange exchange, String message) {
+    public ValidationException(@Nullable Exchange exchange, @Nullable String 
message) {
         super(message, exchange);
     }
 
@@ -36,7 +38,7 @@ public class ValidationException extends 
CamelExchangeException {
      * @param exchange the exchange that failed validation
      * @param cause    the cause of the failure
      */
-    public ValidationException(String message, Exchange exchange, Throwable 
cause) {
+    public ValidationException(@Nullable String message, @Nullable Exchange 
exchange, @Nullable Throwable cause) {
         super(message, exchange, cause);
     }
 }
diff --git 
a/core/camel-api/src/main/java/org/apache/camel/spi/RestConfiguration.java 
b/core/camel-api/src/main/java/org/apache/camel/spi/RestConfiguration.java
index fb980a087c6a..f965a1133ec0 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/RestConfiguration.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/RestConfiguration.java
@@ -706,7 +706,7 @@ public class RestConfiguration {
     /**
      * Sets the client request validation levels when using 
camel-openapi-validator.
      */
-    public void setValidationLevels(Map<String, String> validationLevels) {
+    public void setValidationLevels(@Nullable Map<String, String> 
validationLevels) {
         this.validationLevels = validationLevels;
     }
 }

Reply via email to