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 50925 - Newly created JavaApp project isn't expanded
Summary: Newly created JavaApp project isn't expanded
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: REGRESSION
: 50600 (view as bug list)
Depends on:
Blocks: 41537
  Show dependency tree
 
Reported: 2004-10-27 21:08 UTC by jrojcek
Modified: 2004-12-02 09:23 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed patch (901 bytes, patch)
2004-11-24 10:20 UTC, Jiri Rechtacek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jrojcek 2004-10-27 21:08:34 UTC
This is a regression. Newly created JavaApp project isn't 
expanded and Main.java isn't selected in Projects window.
Comment 1 Jiri Rechtacek 2004-10-28 20:36:22 UTC
Easy reproducible, this regression has appeared between 10/26 and
10/28 build.
Comment 2 Jiri Rechtacek 2004-10-29 09:20:21 UTC
It's not reproducible on each project creation, a little random,
depends if the logical view is active or not, how many projects are
created in a row. The
project/ui/ProjectUtilities.openAndSelectNewObject() is correctly
called, sometimes fails ProjectTab.selectNode(). Looks as a race
condition.
Petr, do you have any suspicion why selectNode() sometimes fails?
Comment 3 Jiri Rechtacek 2004-11-03 15:24:41 UTC
I haven't seen again after bugfix #50327.
Comment 4 Jiri Rechtacek 2004-11-08 13:14:08 UTC
Unluckily, still reproducible in NB40 and in recent dev builds too.
Almost 100% doesn't work if a first project opened, next project opens
correctly. Maybe, long delay due to initially parsing breaks
ProjectTab.selectNode().
Comment 5 Jiri Rechtacek 2004-11-24 10:20:08 UTC
Evaluation: Finding & selecting newly created file works good from
scratch projectui/ProjectUtilities.openAndSelectNewObject() -> ... ->
java/project/spi/PackageRootNode.PathFinder.findPath(). A problem is
that findPath() calls openide/NodeOp.findPath(), it works on children
which couldn't be calculated yet. NodeOp.findPath throws
NodeNotFoundException in this case, it's swallowed in PathFinder. The
proposed patch forces calculation of nodes before find.
NodeOp.findPath() should work only fully initialized children.
Comment 6 Jiri Rechtacek 2004-11-24 10:20:58 UTC
Created attachment 19024 [details]
proposed patch
Comment 7 Jiri Rechtacek 2004-11-24 10:23:28 UTC
Yardo, please consider the attached patch of NodeOp. The patch fixes
this defect. Thanks
Comment 8 Jaroslav Tulach 2004-11-24 16:28:50 UTC
I guess the proper fix would be to change the findChild method of the
children that do lazy calculations. 

Of course, this can be more work than the fix in NodeOp, but I would
still prefer it, because the default replacement for getNodes(true)
used to be findChild(null); getNodes(); 

I am closing this as wontfix, in a hope that doing the fix in the
children is better idea. If it is not, please reopen, and we can
consider changes in NodeOp. 

Btw. simple testcase would be very useful.
Comment 9 jrojcek 2004-11-24 16:33:31 UTC
:-) This is a UI issue. Jirka only suggested a fix for that, so please don't close this issue if 
the fix isn't correct ;-). Somebody should try to find a different fix.
Comment 10 Jiri Rechtacek 2004-11-26 09:29:15 UTC
Yarda points out the fix should be addressed to children of nodes in
PackageView rather than generally do fix of NodeOp.findPath(). I'll
change findChild() in java/project/support/PackageViewChildren to init
children before start finding.
Comment 11 Jiri Rechtacek 2004-11-26 09:40:02 UTC
fixed in
java/project/src/org/netbeans/spi/java/project/support/ui/PackageViewChildren.java;
/cvs/java/project/src/org/netbeans/spi/java/project/support/ui/PackageViewChildren.java,v
 <--  PackageViewChildren.java
new revision: 1.48; previous revision: 1.47
done
Comment 12 Jiri Rechtacek 2004-12-02 09:23:08 UTC
*** Issue 50600 has been marked as a duplicate of this issue. ***