Bug 156082 - Notification of changes does not always work with nested projects
Summary: Notification of changes does not always work with nested projects
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: 3.3 M3   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-09-04 01:32 EDT by Manfred Klug CLA
Modified: 2006-10-25 11:18 EDT (History)
0 users

See Also:


Attachments
Maybe the fix (1.29 KB, patch)
2006-09-09 03:42 EDT, Manfred Klug CLA
no flags Details | Diff
Updated patch (1.48 KB, patch)
2006-10-24 16:13 EDT, John Arthorne CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manfred Klug CLA 2006-09-04 01:32:25 EDT
Suppose the following workspace content:

RootProject
    project
    ASubProject
        .project
    Subproject2
        .project

ASubProject
    .project

Subproject2
    .project

where ASubProject is imported from RootProject/ASubProject and Subproject2
is imported from RootProject/Subproject2.

If I add a file to RootProject/ASubProject, ASubProject is automatically updated
If I add a file to RootProject/Subproject2, Subproject2 is automatically updated

If I add a file to ASubProject, RootProject/ASubProject is automatically updated
If I add a file to Subproject2, RootProject/Subproject2 is *not* automatically updated
Comment 1 DJ Houghton CLA 2006-09-05 15:40:07 EDT
Tested with build i0815.

I used the Core Tools to verify the contents of the resource deltas.
   http://www.eclipse.org/eclipse/platform-core/downloads.php

In the first 3 cases, the delta includes changes in both projects.
In the 4th case you actually get a delta for the original creation of the resource, and then you get one for the creation of the resource in the /RootProject subfolder.

Are you saying that the resource is never created in the second location or it is created later than you would expect?
Comment 2 Manfred Klug CLA 2006-09-06 06:45:07 EDT
(In reply to comment #1)

The resource is never created in the second location.
Comment 3 DJ Houghton CLA 2006-09-06 13:53:34 EDT
Can you install the Core Tools (link above) and open the Delta Spy and post the results here? Thanks.
Comment 4 Manfred Klug CLA 2006-09-07 04:48:59 EDT
(In reply to comment #3)

/[*]: {}
/Subproject2[*]: {}
/Subproject2/eee[+]: {}
Comment 5 DJ Houghton CLA 2006-09-08 11:46:34 EDT
Sorry, I should have asked for the complete output...I don't have context given what you have provided. Could you try the whole thing and post the complete deltas? thanks.

Here are the steps and output that I got. Please let me know if I have done an incorrect step. Note that the final delta notification (for the creation of file2.txt in /RootProject/Subproject2) happened perhaps a second or 2 after the initial creation of the file and the first notification.

1. create project RootProject
2. create folder /RootProject/ASubProject
3. create folder /RootProject/Subproject2
4. copy /RootProject/.project to /RootProject/ASubProject/.project
5. copy /RootProject/.project to /RootProject/Subproject2/.project
6. modified the content of the .project files to contain the proper project names
7. File -> Import -> Existing project into workspace -> point to file-system location of /RootProject/ASubProject
8. File -> Import -> Existing project into workspace -> point to file-system location of /RootProject/Subproject2
9. File -> new -> File -> /ASubProject/file.txt
10. File -> New -> File -> /Subproject2/file2.txt

Here is the complete delta output from the above steps:

/[*]: {}
/RootProject[+]: {OPEN}
/RootProject/.project[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/ASubProject[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/Subproject2[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/ASubProject[*]: {}
/RootProject/ASubProject/.project[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/Subproject2[*]: {}
/RootProject/Subproject2/.project[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/ASubProject[*]: {}
/RootProject/ASubProject/.project[*]: {CONTENT}

/[*]: {}
/RootProject[*]: {}
/RootProject/Subproject2[*]: {}
/RootProject/Subproject2/.project[*]: {CONTENT}

/[*]: {}
/ASubProject[+]: {OPEN}
/ASubProject/.project[+]: {}

/[*]: {}
/Subproject2[+]: {OPEN}
/Subproject2/.project[+]: {}

/[*]: {}
/ASubProject[*]: {}
/ASubProject/file.txt[+]: {}
/RootProject[*]: {}
/RootProject/ASubProject[*]: {}
/RootProject/ASubProject/file.txt[+]: {}

/[*]: {}
/Subproject2[*]: {}
/Subproject2/file2.txt[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/Subproject2[*]: {}
/RootProject/Subproject2/file2.txt[+]: {}
Comment 6 Manfred Klug CLA 2006-09-09 02:45:15 EDT
Ok. The complete trace.

/[*]: {}
/RootProject[+]: {OPEN}
/RootProject/.project[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/ASubProject[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/Subproject2[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/ASubProject[*]: {}
/RootProject/ASubProject/.project[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/Subproject2[*]: {}
/RootProject/Subproject2/.project[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/ASubProject[*]: {}
/RootProject/ASubProject/.project[*]: {CONTENT}

/[*]: {}
/RootProject[*]: {}
/RootProject/Subproject2[*]: {}
/RootProject/Subproject2/.project[*]: {CONTENT}

/[*]: {}
/ASubProject[+]: {OPEN}
/ASubProject/.project[+]: {}

/[*]: {}
/Subproject2[+]: {OPEN}
/Subproject2/.project[+]: {}

/[*]: {}
/ASubProject[*]: {}
/ASubProject/file.txt[+]: {}
/RootProject[*]: {}
/RootProject/ASubProject[*]: {}
/RootProject/ASubProject/file.txt[+]: {}

/[*]: {}
/Subproject2[*]: {}
/Subproject2/file1.txt[+]: {}
Comment 7 Manfred Klug CLA 2006-09-09 03:42:17 EDT
Created attachment 49790 [details]
Maybe the fix

I think I have found the problem.

AliasManager$LocationMap.overLappingResourcesDo does not take into account that there may be more than one alias for a resource.

The trace with the patch:

/[*]: {}
/RootProject[+]: {OPEN}
/RootProject/.project[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/ASubProject[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/Subproject2[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/ASubProject[*]: {}
/RootProject/ASubProject/.project[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/Subproject2[*]: {}
/RootProject/Subproject2/.project[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/ASubProject[*]: {}
/RootProject/ASubProject/.project[*]: {CONTENT}

/[*]: {}
/RootProject[*]: {}
/RootProject/Subproject2[*]: {}
/RootProject/Subproject2/.project[*]: {CONTENT}

/[*]: {}
/ASubProject[+]: {OPEN}
/ASubProject/.project[+]: {}

/[*]: {}
/Subproject2[+]: {OPEN}
/Subproject2/.project[+]: {}

/[*]: {}
/ASubProject[*]: {}
/ASubProject/file.txt[+]: {}
/RootProject[*]: {}
/RootProject/ASubProject[*]: {}
/RootProject/ASubProject/file.txt[+]: {}

/[*]: {}
/RootProject[*]: {}
/RootProject/Subproject2[*]: {}
/RootProject/Subproject2/file1.txt[+]: {}
/Subproject2[*]: {}
/Subproject2/file1.txt[+]: {}
Comment 8 DJ Houghton CLA 2006-09-12 09:00:43 EDT
Cool, thanks.

Did you do the same steps that I did or something a little different?

The component ower for this code is on vacation but will be back in the next week or so and can look at the patch at that point. Thanks.
Comment 9 Manfred Klug CLA 2006-09-12 12:10:33 EDT
(In reply to comment #8)

If I did not make an error, I used the same steps as you.
Comment 10 John Arthorne CLA 2006-10-24 16:13:14 EDT
Created attachment 52629 [details]
Updated patch

Updated patch - same solution but with cleaner code and comments.  Manklu: How should we record you in the copyright statement for this file (name or company)?
Comment 11 John Arthorne CLA 2006-10-24 17:15:38 EDT
Fix released.  Thanks again for the test case and patch!
Comment 12 Manfred Klug CLA 2006-10-25 11:18:50 EDT
(In reply to comment #10)
> Manklu: How should we record you in the copyright statement for this file (name
> or company)?

It's okay if you use the E-Mail address.

A last question. Will this change be backported to 3.2?