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

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

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


##########
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:
   Warning this will throw an NPE if `rangeStartKey` or `rangeEndKey` is null



##########
components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/name/ServiceInterfaceStrategy.java:
##########
@@ -170,7 +170,7 @@ private void analyzeServiceInterface(Class<?> serviceInterface) {
                 }
                 inTypeNameToQName.put(ti.getTypeName(), ti.getElName());
             }
-            if (info.getSoapAction() != null && !"".equals(info.getSoapAction())) {
+            if (info.getSoapAction() != null && !info.getSoapAction().isEmpty()) {

Review Comment:
   Maybe you could also move `info.getSoapAction()` into a local variable to prevent multiple calls



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