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 07:08:15 UTC

[GitHub] [camel] dk2k opened a new pull request, #9802: Dk2k string is empty

dk2k opened a new pull request, #9802:
URL: https://github.com/apache/camel/pull/9802

   String.equalsTo("") replaced with String.isEmpty(). The latter is more efficient


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


[GitHub] [camel] github-actions[bot] commented on pull request #9802: String.equalsTo("") replaced with String.isEmpty(). The latter is more efficient

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9802:
URL: https://github.com/apache/camel/pull/9802#issuecomment-1495552799

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 15 | 15 | 1 | 14 |


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


[GitHub] [camel] github-actions[bot] commented on pull request #9802: Dk2k string is empty

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9802:
URL: https://github.com/apache/camel/pull/9802#issuecomment-1495457735

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :warning: Please note that the changes on this PR may be **tested automatically**. 
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


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


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

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
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


[GitHub] [camel] davsclaus merged pull request #9802: String.equalsTo("") replaced with String.isEmpty(). The latter is more efficient

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #9802:
URL: https://github.com/apache/camel/pull/9802


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


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

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on code in PR #9802:
URL: https://github.com/apache/camel/pull/9802#discussion_r1156926711


##########
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()) {
             return;
         }
         viewOptions.startKey(rangeEndKey).endKey(rangeEndKey);

Review Comment:
   Not related but this sounds suspicious, `rangeStartKey` is not used



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


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

Posted by "dk2k (via GitHub)" <gi...@apache.org>.
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


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

Posted by "dk2k (via GitHub)" <gi...@apache.org>.
dk2k commented on code in PR #9802:
URL: https://github.com/apache/camel/pull/9802#discussion_r1157216584


##########
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()) {
             return;
         }
         viewOptions.startKey(rangeEndKey).endKey(rangeEndKey);

Review Comment:
   https://issues.apache.org/jira/browse/CAMEL-19248



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


[GitHub] [camel] github-actions[bot] commented on pull request #9802: String.equalsTo("") replaced with String.isEmpty(). The latter is more efficient

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9802:
URL: https://github.com/apache/camel/pull/9802#issuecomment-1496048121

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 15 | 15 | 0 | 15 |


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