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 168267

Summary: Delete of java file is often very slow or blokec.
Product: java Reporter: Pavel Flaska <pflaska>
Component: RefactoringAssignee: issues@java <issues>
Status: RESOLVED DUPLICATE    
Severity: blocker Keywords: PERFORMANCE
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Profiler snapshot
Simple patch

Description Pavel Flaska 2009-07-08 09:10:15 UTC
When trying to check why is delete of file blocked when scan in progress, we've found problems during delete action.

1. Delete action blocked throughout scanning
SafeDeleteAction intercepts common delete action and needs to run userActionTask in infrastructure, which is blocked by scan.

2. Delete action is slow when deleting bunch of files
Again, refactoring needs to run several user action tasks - exactly said NodeToFileObjectTask. (task per file)..

3. Other refactoring plugins are also initialized, e.g. HibernateRefactoring, SpringBeansPlugin.

All these initialization can be useful when SafeDeleteRefactoring, but when plain delete, the computation just wastes time. For example, when deleting 
bunch of files containing at least one non-java file, the refactoring isn't used and the deletion is straightforward.
Comment 1 Pavel Flaska 2009-07-08 09:15:03 UTC
Perhaps there is a way how to optimize the code, but we are more interesting in a way how to postpone refactoring initialization until user decides about safe 
delete. For better understanding, I will provide profiler snapshot of current behavior.
Comment 2 Pavel Flaska 2009-07-08 09:19:05 UTC
Created attachment 84479 [details]
Profiler snapshot
Comment 3 Pavel Flaska 2009-07-15 10:43:26 UTC
Created attachment 84761 [details]
Simple patch
Comment 4 Jan Pokorsky 2009-07-29 13:21:03 UTC

*** This issue has been marked as a duplicate of 134716 ***
Comment 5 Quality Engineering 2009-09-18 22:23:20 UTC
Integrated into 'main-golden', will be available in build *200909181401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/68bf059531b8
User: Pavel Flaska <pflaska@netbeans.org>
Log: #168267: Do not block delete when scan in progress.