Bug 247095 - p2 reconciler not deleting lines associated with removed features/plugins/sites from USER-INCLUDE sites in platform.xml from bundles.info
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java
index 992c776..1088d84 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java
@@ -87,8 +87,6 @@
if (contains(list, file))
return false;
} else if (Site.POLICY_USER_INCLUDE.equals(policy)) {
- if (isFeature(file))
- return true;
// we are only interested in plug-ins in the list
if (!contains(list, file))
return false;
@@ -102,11 +100,6 @@
return !isToBeRemoved(file);
}
- private boolean isFeature(File file) {
- String parent = file.getParent();
- return parent != null && parent.endsWith(FEATURES);
- }
-
/*
* Return a boolean value indicating whether or not the feature pointed to
* by the given file is in the update manager's list of features to be
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java
index 1e210013..271fbf9 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java
@@ -42,16 +42,32 @@
private long lastModified = -1l;
private Set configRepositories;
- private String toString(String[] list) {
- if (list == null || list.length == 0)
- return ""; //$NON-NLS-1$
+ private String toString(Feature[] features, String[] list) {
StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < list.length; i++) {
- buffer.append(list[i]);
- if (i + 1 < list.length)
- buffer.append(',');
+ if (features != null) {
+ for (int i = 0; i < features.length; i++) {
+ String featureURL = features[i].getUrl();
+ if (featureURL != null)
+ buffer.append(featureURL).append(',');
+ else {
+ String id = features[i].getId();
+ String version = features[i].getVersion();
+ if (id != null && version != null)
+ buffer.append("features/" + id + "_" + version + "/,"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ }
}
- return buffer.toString();
+ if (list != null) {
+ for (int i = 0; i < list.length; i++) {
+ buffer.append(list[i]).append(',');
+ if (i + 1 < list.length)
+ buffer.append(',');
+ }
+ }
+ if (buffer.length() == 0)
+ return ""; //$NON-NLS-1$
+
+ return buffer.substring(0, buffer.length() - 1);
}
/*
@@ -179,7 +195,7 @@
URL location = new URL(eclipseExtensionURL);
Map properties = new HashMap();
properties.put(SiteListener.SITE_POLICY, site.getPolicy());
- properties.put(SiteListener.SITE_LIST, toString(site.getList()));
+ properties.put(SiteListener.SITE_LIST, toString(site.getFeatures(), site.getList()));
properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
// deal with the metadata repository