Refactor | Rename

I'm not sure when this started happening, but I just noticed it in IDEA v10 (am running 10.0.3) ...

Suppose I have:

private static final String FOO = "foo";

Later in the code, I reference FOO:

System.out.println(FOO);

If I select the FOO declaration and choose Refactor | Rename (Shift-F6), the refactor dialog appears immediately. However, if I select the FOO reference in the println() call and choose Refactor | Rename, it's taking 1 to 2 minutes (yes, minutes) for the rename dialog to open.

Only the static field is renamed, but it feels like the refactoring is initially looking way beyond the scope of the variable being renamed. (The project has >50K artifacts in it, so if it's looking through indexes of those, I'm not surprised it takes so long.)

Is anyone else seeing this?

jack

5 comments
Comment actions Permalink

Hello jack,

If there's really such a delay, there should be a series of thread dumps
logged in the IntelliJ IDEA logs directory. Filing a YouTrack issue with
the thread dumps attached will help us find the problem fairly quickly.

I'm not sure when this started happening, but I just noticed it in
IDEA v10 (am running 10.0.3) ...

Suppose I have:

private static final String FOO = "foo";

Later in the code, I reference FOO:

System.out.println(FOO);

If I select the FOO declaration and choose Refactor | Rename
(Shift-F6), the refactor dialog appears immediately. However, if I
select the FOO reference in the println() call and choose Refactor |
Rename, it's taking 1 to 2 minutes (yes, minutes) for the rename
dialog to open.

Only the static field is renamed, but it feels like the refactoring is
initially looking way beyond the scope of the variable being renamed.
(The project has >50K artifacts in it, so if it's looking through
indexes of those, I'm not surprised it takes so long.)

Is anyone else seeing this?


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Thanks Dmitry.

I should note that these long delays also happen when I try to do a Code | Generate.

I'll reproduce this and send the logs.

jack

0
Comment actions Permalink

Dmitry,

Attached is a zip file with the thread dumps that were written when doing a rename of a field from within a method that references that field. It took ~1 minute for the rename dialog to open.

jack



Attachment(s):
20110428-141204-10.zip
0
Comment actions Permalink

On Thu, 28 Apr 2011 20:23:41 MSD, madjack <no_reply@jetbrains.com>
wrote, quoted or indirectly quoted someone who said :

>If I select the FOO declaration and choose Refactor | Rename (Shift-F6), the refactor dialog appears immediately. However, if I select the FOO reference in the println() call and choose Refactor | Rename, it's taking 1 to 2 minutes (yes, minutes) for the rename dialog to open.

I am not seeing this.  I am using 64-bit Java, 64-bit Intellij.  3
gigs of RAM. Is your machine ram-starved?

I see that sort of thing in Browsers when they go after local pages. I
suspect Google javascripts are the culprit.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Politicians complain that Kindles and iBooks are killing jobs by
destroying the paper book industry.  I see it that they have create a way
to produce books for less than a third the cost without destroying forests
and emitting greenhouse gases in the process.  They have created wealth. 
They are encouraging literacy and cutting the costs of education. 


0
Comment actions Permalink

>> I am not seeing this.  I am using 64-bit Java, 64-bit Intellij.  3 gigs of RAM.

I've also allocated 3GB to IDEA64.

>> Is your machine ram-starved?

I'm pretty sure it's not. My machine has 24GB of RAM. :-)

jack

0

Please sign in to leave a comment.