gnodet commented on code in PR #23194:
URL: https://github.com/apache/camel/pull/23194#discussion_r3235190072


##########
core/camel-api/src/main/java/org/apache/camel/ResolveEndpointFailedException.java:
##########
@@ -18,35 +18,33 @@
 
 import java.util.Objects;
 
-import org.jspecify.annotations.Nullable;
-
 import static org.apache.camel.util.URISupport.sanitizeUri;
 
 /**
  * A runtime exception thrown if an {@link Endpoint} cannot be resolved via URI
  */
 public class ResolveEndpointFailedException extends RuntimeCamelException {
 
-    private final @Nullable String uri;
+    private final String uri;
 
-    public ResolveEndpointFailedException(@Nullable String uri, Throwable 
cause) {
-        super("Failed to resolve endpoint: " + sanitizeUri(uri) + " due to: "
+    public ResolveEndpointFailedException(String uri, Throwable cause) {
+        super("Failed to resolve endpoint: " + 
sanitizeUri(Objects.requireNonNull(uri, "uri")) + " due to: "

Review Comment:
   That's how the JDK handles it, and it's consistent with the rest of the 
codebase (not completely, but mostly). `NullPointerException("uri must not be 
null")` doesn't add information over `NullPointerException("uri")` — the "must 
not be null" part is already conveyed by the exception type itself. The 
parameter name is the useful signal; the rest is noise.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to