You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "bvahdat (via GitHub)" <gi...@apache.org> on 2023/02/13 15:53:14 UTC

[GitHub] [camel] bvahdat commented on a diff in pull request #9339: avoid java assert keyword as disabled per default

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


##########
components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/consumer/KinesisDefaultResumeAdapter.java:
##########
@@ -46,8 +47,8 @@ public void setRequestBuilder(GetShardIteratorRequest.Builder resumable) {
 
     @Override
     public void resume() {
-        assert streamName != null;
-        assert resumable != null;

Review Comment:
   Thanks for your feedback.
   
   IMHO no matter if it's about a user-facing pubic or not-public logic, at the end of the day this code would run in a production environment where  typically Java assertion is not explicitly enabled. Then having these null guards using Java assertion would simply get skipped, then users would only see the **side effects** of these null values **later on** on their call stack and they / we would need to guess and find out the **root cause** (which was null values not being checked early enough). On the other hand having this check eagerly through `ObjectHelper#notNull` would not end up in such a scenarios.



-- 
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-unsubscribe@camel.apache.org

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