Bug 55718 - JavaProject should implement hasChildren optimstically
Summary: JavaProject should implement hasChildren optimstically
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M8   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-23 13:03 EST by Erich Gamma CLA
Modified: 2004-03-26 04:50 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erich Gamma CLA 2004-03-23 13:03:52 EST
see bug# 53958 for more details
Comment 1 Jerome Lanneluc CLA 2004-03-24 06:44:00 EST
Bug 52574 is fixed. Do you have more details? A stack trace?
Comment 2 Jerome Lanneluc CLA 2004-03-24 07:03:16 EST
Sorry about the typo: I should have said "bug 52474 is fixed".
Comment 3 Erich Gamma CLA 2004-03-24 08:26:05 EST
I just checked the code and I couldn't find where JavaProject implements 
hasChildren(). 
Comment 4 Jerome Lanneluc CLA 2004-03-24 09:09:56 EST
The optimization is done in JavaElement.
Comment 5 Jerome Lanneluc CLA 2004-03-24 12:49:05 EST
Please reopen if you have a test case that is not handled.
Comment 6 Erich Gamma CLA 2004-03-24 15:51:26 EST
got it - this is even better
Comment 7 Erich Gamma CLA 2004-03-26 03:26:21 EST
well it almost too good <g>

now when I create a new source folder in the package explorer then the source 
folder is shown with a plus. Therefore the hasChildren() implementation needs 
to be more specific. It should only be used for potentially expensive model 
operations.
Comment 8 Jerome Lanneluc CLA 2004-03-26 04:31:53 EST
Erich a package fragment root always has the default package as a child.
Comment 9 Philipe Mulet CLA 2004-03-26 04:42:49 EST
Also, remember that in general a package fragment root opening may be expensive 
as it needs to seek all folders below it, to compute package fragments (doing 
validation checks for package names). When mapping to a JAR, you need to read 
the JAR as well... so quite a bit expensive.

As Jerome said, there is nothing we can do, since the default package always 
exists... it is only a UI decision to hide it if empty.

Closing
Comment 10 Erich Gamma CLA 2004-03-26 04:50:38 EST
agreed on closing - the culprit is a UI filter - verified that this is the 
same behaviour as in 2.1.*