Simple test case:

==========================
public class Test {
    int someVar;

    public Test(int aVar) {
        someVar = aVar;
        System.out.println("value = " + someVar);
    }

    public static void main(String[] args) {
        new Test(42);
    }
}
==========================


Put cursor on "someVar" and rename to "aVar" (identical to the constructor
arg).  The first line of the constructor correctly changes to:
    this.aVar = aVar;

The problem is on the next line.  The reference to someVar in the call to
println is also changed to this.aVar, however IDEA now thinks it points to
the argument aVar, even though it has "this." prepended!  It marks an error
"Cannot resolve println(?)".

Also, hover the mouse pointer over this.aVar with CTRL key held down, the
tooltip will say that aVar points to the parameter.

Is corrected with a simple edit (like put a space between "th" and "is."
then delete it -- the reparse will catch it.


This test case has a slightly different result than what I saw in the wild,
but, I'm assuming the root cause is the same.  In the wild, the variable
declaration was greyed-out and the tooltip message told me the variable was
never assigned, although a similar "ref" to "this.ref" transformation took
place...

-sms


_______________________________________________
Eap-bugs mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-bugs

Reply via email to