You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "dk2k (via GitHub)" <gi...@apache.org> on 2023/04/04 08:39:21 UTC

[GitHub] [camel] dk2k commented on a diff in pull request #9802: String.equalsTo("") replaced with String.isEmpty(). The latter is more efficient

dk2k commented on code in PR #9802:
URL: https://github.com/apache/camel/pull/9802#discussion_r1156921200


##########
components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConsumer.java:
##########
@@ -87,7 +87,7 @@ protected void doInit() {
 
         String rangeStartKey = endpoint.getRangeStartKey();
         String rangeEndKey = endpoint.getRangeEndKey();
-        if ("".equals(rangeStartKey) || "".equals(rangeEndKey)) {
+        if (rangeStartKey.isEmpty() || rangeEndKey.isEmpty()) {

Review Comment:
   True, but are nulls possible in them? I ask because previously the code would let two nulls (not the case if only one of them is null) into viewOptions in the line below:
   viewOptions.startKey(rangeEndKey).endKey(rangeEndKey);  
   
   Will add null checks anyway



-- 
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