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 211847 - [72cat] Reduced tree view for projects collapse the folder after any file operation
Summary: [72cat] Reduced tree view for projects collapse the folder after any file ope...
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Nodes (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal with 4 votes (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
: 213087 217833 (view as bug list)
Depends on:
Blocks: 53192
  Show dependency tree
 
Reported: 2012-04-27 13:09 UTC by Michel Graciano
Modified: 2012-11-09 11:35 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test case (1.94 KB, patch)
2012-04-27 18:41 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Graciano 2012-04-27 13:09:11 UTC
[ BUILD # : f8f29fb48478 ]
[ JDK VERSION : 1.7.3 ]

If I do any file operation, as duplicate files (copy and paste at the same
folder) or even delete a file, the current folder is collapsed, sometime two
levels are collapsed. The same behaviour is not shown for List view (I haven't
tested with tree view). As an example, my package has 6 levels
net.abc.def.ghi.jkl.mno.
Comment 1 Jesse Glick 2012-04-27 17:56:49 UTC
There do seem to be some cases where nodes are collapsed unnecessarily, though not in all cases. Can investigate.
Comment 2 Jesse Glick 2012-04-27 18:41:40 UTC
Created attachment 118894 [details]
Test case
Comment 3 Jesse Glick 2012-04-27 18:43:43 UTC
Seems to be a bug in ChildFactory (or ultimately perhaps Children.Keys); after refreshing keys so that the new key list overlaps the old one, some - but not all - of the nodes are spuriously recreated:

junit.framework.ComparisonFailure: expected:<[1, 2, 3, []4]> but was:<[1, 2, 3, [2, 3, ]4]>
	at org.openide.nodes.ChildFactoryTest.testNodeRecreation(ChildFactoryTest.java:342)
Comment 4 Jesse Glick 2012-04-27 18:53:38 UTC
Note that calling refresh(true) makes the test pass, as does passing false to Children.create. Holding strong refs to created Node's does not make the test pass, nor does calling c.addNotify(), nor does making ChildrenArray.map nonweak.
Comment 5 Jaroslav Tulach 2012-06-04 08:16:23 UTC
*** Bug 213087 has been marked as a duplicate of this bug. ***
Comment 6 Jaroslav Tulach 2012-06-14 09:41:42 UTC
ergonomics#6126d7fd456d
Comment 7 Jaroslav Tulach 2012-06-14 09:42:59 UTC
I should probably mark the resolution "invalid" as I fixed the behavior by fixing the test...
Comment 8 Jesse Glick 2012-06-14 16:16:13 UTC
Then it is still a bug that nodes are unnecessarily recreated when you do not batch the key additions. The real ChildFactory, for reduced tree view, intentionally calls add(...) rather than addAll(...), so that nodes are displayed incrementally as they are computed.

Anyway you cannot close a bug about an actual user problem by writing a test. If there is something in java.project which is implemented incorrectly according to documented behavior in openide.nodes, explain what that is and reassign, so the problem can be fixed.
Comment 9 Quality Engineering 2012-06-15 06:14:45 UTC
Integrated into 'main-golden', will be available in build *201206150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6126d7fd456d
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #211847: [72cat] Reduced tree view for projects collapse the folder after any file operation
If you batch whole result and add it to the parameter of createKeys at once, the refresh behaves as expected.
Comment 10 Michel Graciano 2012-07-03 14:46:17 UTC
It is IMHO a high visible usability problem. I hope it can be fixed for 7.3.
Comment 11 crazyjavahacking 2012-09-04 20:04:51 UTC
*** Bug 217833 has been marked as a duplicate of this bug. ***
Comment 12 crazyjavahacking 2012-09-04 20:06:00 UTC
It is very annoying that refactoring (including Rename refactoring, Move
refactoring and sometimes Remove class as well) is always closing package nodes
in Reduced Tree package view.

I used to close not necessary package nodes when focusing on code and this
"behavior" is very annoying making the Reduced Tree package view almost
unusable (for big nested package hierarchies).
Comment 13 Jaroslav Tulach 2012-11-07 15:28:36 UTC
ergonomics#0df9cb6108b7
Comment 14 Quality Engineering 2012-11-09 02:51:46 UTC
Integrated into 'main-golden', will be available in build *201211090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0df9cb6108b7
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #211847: Prevent incremental refresh when the nodes are already computed and the size is lower than expected
Comment 15 Michel Graciano 2012-11-09 11:35:32 UTC
v. Build 20121109-beb7bf2aea3f