This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256857 - Refactor: Rename->Prepare takes endlessly long - 60 secs per 10%
Summary: Refactor: Rename->Prepare takes endlessly long - 60 secs per 10%
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.2
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-29 17:41 UTC by NukemBy
Modified: 2016-03-25 13:23 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
endless-refactor-prepare.npss (604.23 KB, application/octet-stream)
2015-11-29 17:41 UTC, NukemBy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NukemBy 2015-11-29 17:41:26 UTC
Created attachment 157545 [details]
endless-refactor-prepare.npss

I'm doing refactoring in my Java code and renaming of one of the methods takes unacceptably long time. After I click 'Refactor' button in the 'Rename' dialog, it starts showing progress bar and at stage 'Prepare' it reaches 10% in around 1 minute. I actually could not wait until the end because it seems it goes further event slower.

Self profiler is attached.
Comment 1 NukemBy 2015-11-29 17:48:13 UTC
Missed to add more details - method belongs to the class in the root of the hierarchy of around 20 other classes. It is named like

- static void MyRootClass.initContext(context)

subclasses also define static method with same name and all of them invoke initializers from super classes - i.e. MyRootClass.initContext() is invoked in around 10 other places.

Not sure if this code layout is relevant to the problem.

PS: project is a Gradle project.
Comment 2 NukemBy 2015-11-29 17:50:02 UTC
"Find Usages" on this method also runs pretty long, but acceptably long - around 10 secs or less.
Comment 3 NukemBy 2015-11-29 18:02:10 UTC
Damn, it seems I've found the root problem - during refactoring "import static" of that method was duplicated 7000 times in one child file, 2000 times in another file and so on. I have not idea why and when this is happening.