You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by GitBox <gi...@apache.org> on 2021/10/09 16:52:33 UTC

[GitHub] [ant] bodewig commented on a change in pull request #165: Use object equals instead of ==, which does a character-by-character comparison when the strings are different objects

bodewig commented on a change in pull request #165:
URL: https://github.com/apache/ant/pull/165#discussion_r725510314



##########
File path: src/main/org/apache/tools/ant/Project.java
##########
@@ -1831,7 +1831,7 @@ public static Project getProject(final Object o) {
             final String st = state.get(root);
             if (st == null) {
                 tsort(root, targetTable, state, visiting, ret);
-            } else if (st == VISITING) {
+            } else if (st.equals(VISITING)) {

Review comment:
       the == check is correct as we set the value ourselves and really are nt interested in "visiting" states set in any other way.

##########
File path: src/main/org/apache/tools/ant/taskdefs/PathConvert.java
##########
@@ -420,7 +420,7 @@ private String mapElement(String elem) {
             // Note I'm using "!=" to see if we got a new object back from
             // the apply method.
 
-            if (newElem != elem) {
+            if (!newElem.equals(elem)) {

Review comment:
       have you seen the comment above that line?




-- 
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: dev-unsubscribe@ant.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org