Bug 67789 - Java element delta from refresh contains excluded package
Summary: Java element delta from refresh contains excluded package
Status: RESOLVED FIXED
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.1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-18 07:11 EDT by Martin Aeschlimann CLA
Modified: 2004-09-06 10:23 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (1.39 KB, patch)
2004-06-18 10:35 EDT, Jerome Lanneluc CLA
no flags Details | Diff
Regression tests (2.75 KB, patch)
2004-06-18 10:36 EDT, Jerome Lanneluc CLA
no flags Details | Diff
Better patch (1.39 KB, patch)
2004-06-21 06:40 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2004-06-18 07:11:15 EDT
RC2

1. Follow the 'getting started' example 'Overlapping products in a common source
tree': Project has external folder as source folder that contains
com
  xyz
    product1
    product2
where com/xyz/product2/ is excluded.
-> The package explorer renders a package 'com.xyz' and a package
'com.xyz.product1' ( as seen in the documents screenshot)

2. In the Windows explorer first move the whole 'com' tree to a temporary
location. Local Refresh: Package explorer shows src to be empty. Ok!

3. Move the 'com' tree back again, local refresh. A new package
'com.xyz.product2' is shown

The delta issued on the second refresh is:
Java Model[*]: {CHILDREN}
	Product1[*]: {CHILDREN}
		src[*]: {CHILDREN}
			com[+]: {}
			com.xyz[+]: {}
			com.xyz.product1[+]: {}
			com.xyz.product2[+]: {}
Comment 1 Jerome Lanneluc CLA 2004-06-18 10:35:10 EDT
Created attachment 12481 [details]
Proposed patch

Changed DeltaProcessor#elementAdded(...) and #elementRemoved(...) to not
add/removed subpackages if they are excluded.
Comment 2 Jerome Lanneluc CLA 2004-06-18 10:36:22 EDT
Created attachment 12482 [details]
Regression tests

Added regression tests
ExclusionFilterTests#testCreateExcludedAndIncludedPackages() and
#testRemoveExcludedAndIncludedPackages()
Comment 3 Philipe Mulet CLA 2004-06-18 11:07:09 EDT
Patch doesn't work if deeper child folders are included again. Check for 
inclusion should only apply to local folder, and should recurse in children in 
case an inclusion filter is specified.

Need to be reworked, won't be ready for RC3.
Comment 4 Jerome Lanneluc CLA 2004-06-21 05:47:46 EDT
Verified that the same problem exists in 2.1.3. So this is not a regression 
comparing to 2.1.3.
Comment 5 Jerome Lanneluc CLA 2004-06-21 06:40:49 EDT
Created attachment 12558 [details]
Better patch

Continue the recursion for packages.
Comment 6 Jerome Lanneluc CLA 2004-07-01 09:47:53 EDT
Incorrect patch was attached in comment #5.

Changed DeltaProcessor.elementAdded(...) and elementRemoved(...) to not 
consider subpackages. And changed updateCurrentDeltaAndIndex(...) to continue 
the recursion in the case of a package fragment.

Added regression tests 
ExclusionPatternTest.testCreateExcludedAndIncludedPackages() and 
testRemoveExceludedAndIncludedPackages().
Comment 7 Philipe Mulet CLA 2004-07-01 10:47:11 EDT
Please backport to 3.0.1
Comment 8 Philipe Mulet CLA 2004-07-01 11:02:24 EDT
Targeting 3.0.1
Comment 9 Jerome Lanneluc CLA 2004-07-01 11:53:54 EDT
Backported fix and tests to R3_0_maintenance.
Comment 10 David Audel CLA 2004-09-06 10:23:48 EDT
Verified for 3.0.1 RC1