This is an automated email from the ASF dual-hosted git repository.
apupier 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 5cb1c8546a5e CAMEL-23542 - Fix main branch - revert requirements of
non null value in some ValidationException fields
5cb1c8546a5e is described below
commit 5cb1c8546a5e5fccb44464ad26b88a61d2f45fb1
Author: Aurélien Pupier <[email protected]>
AuthorDate: Mon May 18 14:10:03 2026 +0200
CAMEL-23542 - Fix main branch - revert requirements of non null value in
some ValidationException fields
it was introduced with
https://github.com/apache/camel/pull/23021#issuecomment-4441975797
Signed-off-by: Aurélien Pupier <[email protected]>
---
.../main/java/org/apache/camel/CamelExchangeException.java | 9 +++------
.../src/main/java/org/apache/camel/ValidationException.java | 12 ++++--------
.../main/java/org/apache/camel/spi/RestConfiguration.java | 2 +-
3 files changed, 8 insertions(+), 15 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 88a694bf65d1..d9a319841cf3 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
@@ -17,7 +17,6 @@
package org.apache.camel;
import java.io.Serial;
-import java.util.Objects;
import org.jspecify.annotations.Nullable;
@@ -34,8 +33,7 @@ public class CamelExchangeException extends CamelException {
* @param exchange the exchange that caused the error
*/
public CamelExchangeException(String message, @Nullable Exchange exchange)
{
- super(CamelExchangeException.createExceptionMessage(
- Objects.requireNonNull(message, "message"), exchange, null));
+ super(CamelExchangeException.createExceptionMessage(message, exchange,
null));
this.exchange = exchange;
}
@@ -45,9 +43,8 @@ public class CamelExchangeException extends CamelException {
* @param cause the cause of the failure
*/
public CamelExchangeException(String message, @Nullable Exchange exchange,
Throwable cause) {
- super(CamelExchangeException.createExceptionMessage(
- Objects.requireNonNull(message, "message"), exchange,
- Objects.requireNonNull(cause, "cause")),
+ super(CamelExchangeException.createExceptionMessage(message, exchange,
+ cause),
cause);
this.exchange = exchange;
}
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 b998434b83ea..f7cb8694801c 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,10 +16,6 @@
*/
package org.apache.camel;
-import java.util.Objects;
-
-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
@@ -31,8 +27,8 @@ public class ValidationException extends
CamelExchangeException {
* @param exchange the exchange that failed validation
* @param message the detail message
*/
- public ValidationException(@Nullable Exchange exchange, String message) {
- super(Objects.requireNonNull(message, "message"), exchange);
+ public ValidationException(Exchange exchange, String message) {
+ super(message, exchange);
}
/**
@@ -40,7 +36,7 @@ public class ValidationException extends
CamelExchangeException {
* @param exchange the exchange that failed validation
* @param cause the cause of the failure
*/
- public ValidationException(String message, @Nullable Exchange exchange,
Throwable cause) {
- super(Objects.requireNonNull(message, "message"), exchange,
Objects.requireNonNull(cause, "cause"));
+ public ValidationException(String message, Exchange exchange, 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 5152b66cca78..fb980a087c6a 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
@@ -707,6 +707,6 @@ public class RestConfiguration {
* Sets the client request validation levels when using
camel-openapi-validator.
*/
public void setValidationLevels(Map<String, String> validationLevels) {
- this.validationLevels = Objects.requireNonNull(validationLevels,
"validationLevels");
+ this.validationLevels = validationLevels;
}
}