Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326497

Summary: Child will not be removed from CompositeArtifactRepository
Product: [Eclipse Project] Equinox Reporter: Matthias Kappeller <mkappeller>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: 3.7 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Matthias Kappeller CLA 2010-09-29 04:59:38 EDT
Build Identifier: 3.6.0

If a child needs to be removed from a composite artifact repository by an absolute URI (e.g. file:/C:/workspaces/jse.repo/plugins/repo.core.tests/Copy_test-repo-1/) the change will not be saved to the repository.

(Sorry at my workplace i'm not able to create a patch :( )
In Bundle org.eclipse.equinox.p2.artifact.repository, version 1.1.0.v20100513 class org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository method 'public void removeChild(URI childURI)' the flag 'removed' is not assigned if the URI is absolute.

actually:
URI other = childURI.isAbsolute() ? URIUtil.makeRelative(childURI, getLocation()) : URIUtil.makeAbsolute(childURI, getLocation());
if (!removed)
	childrenURIs.remove(other);

change to:
URI other = childURI.isAbsolute() ? URIUtil.makeRelative(childURI, getLocation()) : URIUtil.makeAbsolute(childURI, getLocation());
if (!removed)
	removed = childrenURIs.remove(other);


In org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository it's done this way.

Reproducible: Always
Comment 1 DJ Houghton CLA 2010-09-29 08:34:47 EDT
Good catch, thanks.
Fix released to HEAD.