Bug 6563

Summary: Package view does not refresh ok when adding both package and unit at once
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Philipe Mulet CLA 2001-12-04 13:00:11 EST
Build 20011127 + latest JDTCORE (v_216c)

In a new project, empty source folder, add a type p1/X.java all at once using 
the class wizard (package p1 must not pre-exist).

The package view does only display added package p1 (i.e. does not show the 
added type).

Deltas look confusing, the unit addition got notified, but an extra package 
addition notification is likely fooling the package view.
Comment 1 Jerome Lanneluc CLA 2001-12-05 05:25:06 EST
When a class is created at the same time as its package, here is what happens 
in an IWorkspaceRunnable:
- the package is created (in a Java Model Operation) and opened (it has no 
children)
- the compilation unit is created (in a Java Model Operation) by creating an 
IFile
- when the IResourceDelta is sent, the delta processsor only sees the addition 
of the package, and since it is already opened, it remains with no children.

Fixed by forcing and added element to be closed (this is a noop if it is 
already closed).