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 231424 - empty tree in Usages tab at first time
Summary: empty tree in Usages tab at first time
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.4
Hardware: PC Solaris
: P2 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-18 09:48 UTC by soldatov
Modified: 2013-08-28 10:17 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (139.60 KB, image/png)
2013-07-19 12:19 UTC, soldatov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2013-06-18 09:48:48 UTC
Scenario:
- Restart IDE
- Create Quote sample
- Open module.cc
- Select 37th line and 4th column
- Call context menu and select Find Usages
- Select "Find All Subtypes" and Press Find
- Check Usages tab
==> [3 oocurences, 3 filtred] and empty tree
If I call Find Usages again, then I see 3 nodes
Comment 1 soldatov 2013-07-19 12:19:41 UTC
Created attachment 137443 [details]
screenshot
Comment 2 Egor Ushakov 2013-07-22 11:43:52 UTC
looks like race condition in platform, filtering and enable filers work simultaneously:

"org.netbeans.modules.refactoring.spi.impl.ParametersPanel"
org.netbeans.modules.cnd.refactoring.plugins.CsmWhereUsedQueryPlugin.enableFilters(CsmWhereUsedQueryPlugin.java:454)
org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare2(AbstractRefactoring.java:445)
org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:421)
org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:232)
org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare$2.run(ParametersPanel.java:1017)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2042)

"org.netbeans.modules.refactoring.spi.impl.RefactoringPanel"
org.netbeans.modules.cnd.refactoring.elements.CsmRefactoringElementImpl.filter(CsmRefactoringElementImpl.java:139)
org.netbeans.modules.refactoring.api.RefactoringElement.include(RefactoringElement.java:193)
org.netbeans.modules.refactoring.spi.impl.RefactoringPanel$4.run(RefactoringPanel.java:785)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2042)
Comment 3 soldatov 2013-08-21 10:09:44 UTC
bug should be fixed in NB7.4 I think
Comment 4 Ralph Ruijs 2013-08-28 10:04:54 UTC
(In reply to Egor Ushakov from comment #2)
> looks like race condition in platform, filtering and enable filers work
> simultaneously:

This is as designed. When running find usages, the results are displayed immediately when they are found. Because they are displayed, the method filter() is called, but at that time enable() has not been called yet (from Javadoc: Enable filters in the supplied {@code FiltersDescription}. This method will be called after the plugins {@code RefactoringPlugin#prepare} method is called.)

I updated your plugin to change filters at the beginning of the prepare method. This should be save for cnd, as the filters are not shared between plugins.

changeset   : 9b5ad552df7f
author      : Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date        : Wed Aug 28 12:00:00 CEST 2013
summary     : #231424 - empty tree in Usages tab at first time
Comment 5 Egor Ushakov 2013-08-28 10:17:44 UTC
great, thanks!