orpiske commented on code in PR #9339:
URL: https://github.com/apache/camel/pull/9339#discussion_r1104814884


##########
core/camel-support/src/main/java/org/apache/camel/support/resume/AdapterHelper.java:
##########
@@ -41,9 +42,9 @@ private AdapterHelper() {
     }
 
     public static ResumeAdapter eval(CamelContext context, ResumeAware 
resumeAware, ResumeStrategy resumeStrategy) {
-        assert context != null;
-        assert resumeAware != null;
-        assert resumeStrategy != null;
+        ObjectHelper.notNull(context, "context");
+        ObjectHelper.notNull(resumeAware, "resumeAware");
+        ObjectHelper.notNull(resumeStrategy, "resumeStrategy");

Review Comment:
   The reasoning is the other way around: is to ensure that we catch misbehaved 
tests, tests that may affect this piece of code with these or any thing 
non-production that may be doing something nasty. 
   
   The nullity check for most of these is already performed by the calling 
code. This one is a good example of that:
   - 
[MasterConsumer.java](https://github.com/apache/camel/blob/main/components/camel-master/src/main/java/org/apache/camel/component/master/MasterConsumer.java#L143-L152)
   - 
[DefaultRoute.java](https://github.com/apache/camel/blob/main/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultRoute.java#L646-L649)
   
   So, the native assertion allow us to add a small layer of "protection" 
without adding too many runtime checks.



-- 
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: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to