jlahoda commented on a change in pull request #2612:
URL: https://github.com/apache/netbeans/pull/2612#discussion_r563497319



##########
File path: 
java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/RenameTransformer.java
##########
@@ -254,7 +254,7 @@ public boolean accept(Element e, TypeMirror type) {
             String useThis = null;
             String useSuper = null;
 
-            if (elementToFind!=null && elementToFind.getKind().isField()) {
+            if (elementToFind!=null && elementToFind.getKind().isField() && 
tree.getKind() != Tree.Kind.MEMBER_SELECT) {

Review comment:
       I think I agree with @jherkel - the code on lines 262-267 does not make 
much sense to me. If a reference to a field is qualified, it cannot clash with 
a local variable (AFAIK), even if the qualifier is different from `this`. I 
agree we should delete the whole `if` starting at 262. Maybe instead of 
`tree.getKind() != Tree.Kind.MEMBER_SELECT` do `&& tree.getKind() == 
Tree.Kind.IDENTIFIER`, because I believe that is the only case where the clash 
can occur.




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to