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/05 07:34:43 UTC

[GitHub] [camel] dk2k opened a new pull request, #9817: String.equalsTo("") replaced with String.isEmpty() in core and tooling

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

   String.equalsTo("") replaced with String.isEmpty(). The latter is more efficient. Separate commit for core and tooling
   In MavenDownloaderImpl combined two similar IF blocks and removed useless assignment


-- 
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 #9817: String.equalsTo("") replaced with String.isEmpty() in core and tooling

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


-- 
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 #9817: String.equalsTo("") replaced with String.isEmpty() in core and tooling

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


##########
tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenDownloaderImpl.java:
##########
@@ -731,10 +731,7 @@ Settings mavenConfiguration(
         // 3) ${user.home}/.m2/repository (if exists)
         // 4) /tmp/.m2/repository
         String localRepository = System.getProperty("maven.repo.local");
-        if (localRepository == null || "".equals(localRepository.trim())) {
-            localRepository = settings.getLocalRepository();

Review Comment:
   Why remove this?



-- 
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 #9817: String.equalsTo("") replaced with String.isEmpty() in core and tooling

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


##########
tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenDownloaderImpl.java:
##########
@@ -731,10 +731,7 @@ Settings mavenConfiguration(
         // 3) ${user.home}/.m2/repository (if exists)
         // 4) /tmp/.m2/repository
         String localRepository = System.getProperty("maven.repo.local");
-        if (localRepository == null || "".equals(localRepository.trim())) {
-            localRepository = settings.getLocalRepository();

Review Comment:
   My bad. I understand now
   



-- 
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 #9817: String.equalsTo("") replaced with String.isEmpty() in core and tooling

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


##########
tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenDownloaderImpl.java:
##########
@@ -731,10 +731,7 @@ Settings mavenConfiguration(
         // 3) ${user.home}/.m2/repository (if exists)
         // 4) /tmp/.m2/repository
         String localRepository = System.getProperty("maven.repo.local");
-        if (localRepository == null || "".equals(localRepository.trim())) {
-            localRepository = settings.getLocalRepository();

Review Comment:
   The first step. Another IF with the same condition below. Both get combined into one block.
   The second step. The assigned value isn't used before another value is assigned to localRepository => the firas assignment can be removed



-- 
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 #9817: String.equalsTo("") replaced with String.isEmpty() in core and tooling

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


##########
tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenDownloaderImpl.java:
##########
@@ -731,10 +731,7 @@ Settings mavenConfiguration(
         // 3) ${user.home}/.m2/repository (if exists)
         // 4) /tmp/.m2/repository
         String localRepository = System.getProperty("maven.repo.local");
-        if (localRepository == null || "".equals(localRepository.trim())) {
-            localRepository = settings.getLocalRepository();

Review Comment:
   Sorry I don't get it, what about the use case where `settings.getLocalRepository()` returns a non-empty value? In other words, if `settings.xml` has a local repository defined.



-- 
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 #9817: String.equalsTo("") replaced with String.isEmpty() in core and tooling

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


##########
tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenDownloaderImpl.java:
##########
@@ -731,10 +731,7 @@ Settings mavenConfiguration(
         // 3) ${user.home}/.m2/repository (if exists)
         // 4) /tmp/.m2/repository
         String localRepository = System.getProperty("maven.repo.local");
-        if (localRepository == null || "".equals(localRepository.trim())) {
-            localRepository = settings.getLocalRepository();

Review Comment:
   Sorry I don't get it, what about the use case where `settings.getLocalRepository()` returns a non-empty value?



-- 
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 #9817: String.equalsTo("") replaced with String.isEmpty() in core and tooling

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

   :no_entry_sign: There are (likely) no components to be tested in this PR


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