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 187991 - data folder reordering isn't working due to MultiFileObject.getAttribute
Summary: data folder reordering isn't working due to MultiFileObject.getAttribute
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: REGRESSION
: 183693 (view as bug list)
Depends on: 141925
Blocks:
  Show dependency tree
 
Reported: 2010-06-23 10:35 UTC by Stanislav Aubrecht
Modified: 2010-08-20 03:11 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
hotfix patch (1.25 KB, text/plain)
2010-07-03 11:52 UTC, Stanislav Aubrecht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stanislav Aubrecht 2010-06-23 10:35:43 UTC
- click menu 'tools - palette - swing/awt components'
- expand e.g. 'swing controls' category
- right-click 'swing controls' category and select 'sort by item name' from its popup menu

- expected behavior (as in nb 6.8): items under that category are sorted alfabetically
- actual behavior: nothing moves, yet the attributes stored in user dir seem to be correct. after restart the items are in correct order. however manual repositioning of any item in the category breaks the original sorted order and all following reordering actions have no effect.
Comment 1 Jaroslav Tulach 2010-06-25 06:36:43 UTC
True, the window is not redrawn. However this does not seem to be fault of loaders or nodes. As far as I can tell, in response to switching category the

    public void nodeStructureChanged(TreeNode node)

in javax.swing.tree.DefaultTreeModel gets called with relatively fine order of nodes. Help finding out why this is not reflected in the UI is welcomed.
Comment 2 Stanislav Aubrecht 2010-06-25 15:09:17 UTC
that's not what i'm seeing.
start with a clean userdir, click menu 'tools - palette - swing/awt components', expand 'swing controls' category, right-click that category and choose 'sort by item name'

org.openide.loaders.FolderChildren.refreshChildren is invoked then. on line 158 the FileObjects representing category items are correctly sorted (alfabetically).
however FileUtil.getOrder() on line 160 still returns the original ordering as defined in XML layer.
Comment 3 Stanislav Aubrecht 2010-07-03 11:52:02 UTC
Created attachment 100587 [details]
hotfix patch

the attached patch fixes the problem but i don't know how it affects file system performance.
Comment 4 Jaroslav Tulach 2010-08-19 13:05:43 UTC
*** Bug 183693 has been marked as a duplicate of this bug. ***
Comment 5 Jaroslav Tulach 2010-08-19 13:34:57 UTC
Regression due to fix for bug 141925. The AttributeCache in MultiFileObject seemed to rely on the fact that as soon as one attribute is found, the search continues no more. After fix for bug 141925, this is no longer true, the search among all delegates continues and the cache is improperly filled with less priority value. Subsequent calls for the same attribute thus return non-sense.
Comment 6 Jaroslav Tulach 2010-08-19 14:20:46 UTC
core-main#502f36daf17b
Comment 7 Quality Engineering 2010-08-20 03:11:44 UTC
Integrated into 'main-golden', will be available in build *201008200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/502f36daf17b
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #187991: Adjusting the attribute cache to recent changes with weighted attributes