Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Stevenson2008-01-28 22:27:31 +0000
committerDave Stevenson2008-01-28 22:27:31 +0000
commitb525b7ac9f92b02e0c35c96ebb5dd7eed59e386f (patch)
tree951083294563d02262a552198384afba3a358803
parent6683b28c84a9914fec28bd1414d99adc3845c87c (diff)
downloadrt.equinox.p2-b525b7ac9f92b02e0c35c96ebb5dd7eed59e386f.tar.gz
rt.equinox.p2-b525b7ac9f92b02e0c35c96ebb5dd7eed59e386f.tar.xz
rt.equinox.p2-b525b7ac9f92b02e0c35c96ebb5dd7eed59e386f.zip
Removed dependency on update configurator for installing/uninstalling features. Moved the platform.xml parser/writer from the reconciler.dropins bundle to the touchpoint.eclipse bundle so they could be shared.
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/EclipseInstallGeneratorInfoProvider.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/Generator.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/IGeneratorInfo.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/LinksManager.java (renamed from bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/LinksManager.java)3
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java (renamed from bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/PlatformXmlListener.java)16
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteDelta.java (renamed from bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/SiteDelta.java)3
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteInfo.java (renamed from bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/SiteInfo.java)3
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteListener.java (renamed from bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/SiteListener.java)4
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteWatcher.java (renamed from bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/SiteWatcher.java)6
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Feature.java87
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Site.java130
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/LinksManager.java (renamed from bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/LinksManager.java)3
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java (renamed from bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/PlatformXmlListener.java)16
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteDelta.java (renamed from bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/SiteDelta.java)3
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteInfo.java (renamed from bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/SiteInfo.java)3
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteListener.java (renamed from bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/SiteListener.java)4
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteWatcher.java (renamed from bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/SiteWatcher.java)6
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Configuration.java80
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/ConfigurationConstants.java34
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/ConfigurationParser.java202
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/ConfigurationWriter.java133
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Utils.java66
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java122
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/TestGeneratorInfo.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.settings/org.eclipse.jdt.core.prefs10
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF13
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseTouchpoint.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java117
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/UpdateConfiguratorUtils.java37
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Configuration.java (renamed from bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Configuration.java)0
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/ConfigurationConstants.java (renamed from bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/ConfigurationConstants.java)0
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/ConfigurationParser.java (renamed from bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/ConfigurationParser.java)0
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/ConfigurationWriter.java (renamed from bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/ConfigurationWriter.java)0
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Feature.java (renamed from bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Feature.java)2
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Site.java (renamed from bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Site.java)11
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Utils.java (renamed from bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Utils.java)29
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java (renamed from bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java)0
42 files changed, 186 insertions, 1082 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/EclipseInstallGeneratorInfoProvider.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/EclipseInstallGeneratorInfoProvider.java
index 487bc5c31..91c272725 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/EclipseInstallGeneratorInfoProvider.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/EclipseInstallGeneratorInfoProvider.java
@@ -38,6 +38,13 @@ public class EclipseInstallGeneratorInfoProvider implements IGeneratorInfo {
private static final String ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR_MANIPULATOR = "org.eclipse.equinox.simpleconfigurator.manipulator"; //$NON-NLS-1$
private static final String ORG_ECLIPSE_EQUINOX_FRAMEWORKADMIN_EQUINOX = "org.eclipse.equinox.frameworkadmin.equinox"; //$NON-NLS-1$
+ /*
+ * TODO: Temporary for determining whether eclipse installs
+ * in a profile should support backward compatibility
+ * with update manager.
+ */
+ private static final String UPDATE_COMPATIBILITY = "eclipse.p2.update.compatibility"; //$NON-NLS-1$
+
private static String os;
/**
@@ -72,6 +79,7 @@ public class EclipseInstallGeneratorInfoProvider implements IGeneratorInfo {
private IMetadataRepository metadataRepository;
private boolean publishArtifactRepo = false;
private boolean publishArtifacts = false;
+ private boolean updateCompatibility = Boolean.valueOf(System.getProperty(UPDATE_COMPATIBILITY, "false")).booleanValue(); //$NON-NLS-1$
private String rootId;
private String rootVersion;
@@ -254,6 +262,10 @@ public class EclipseInstallGeneratorInfoProvider implements IGeneratorInfo {
return admin;
}
+ public boolean getIsUpdateCompatible() {
+ return updateCompatibility;
+ }
+
private Collection getIUs(Set ius, String prefix) {
Set result = new HashSet();
for (Iterator iterator = ius.iterator(); iterator.hasNext();) {
@@ -380,6 +392,10 @@ public class EclipseInstallGeneratorInfoProvider implements IGeneratorInfo {
flavor = value;
}
+ public void setIsUpdateCompatible(boolean isCompatible) {
+ this.updateCompatibility = isCompatible;
+ }
+
public void setLauncherConfig(String value) {
launcherConfig = value;
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/Generator.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/Generator.java
index 0e0334c4f..aeecaf1ce 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/Generator.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/Generator.java
@@ -230,8 +230,10 @@ public class Generator {
if (bundle.getSymbolicName().equals(ORG_ECLIPSE_UPDATE_CONFIGURATOR)) {
bundle.setStartLevel(BundleInfo.NO_LEVEL);
bundle.setMarkedAsStarted(false);
- bundle.setSpecialConfigCommands("addJvmArg(jvmArg:-Dorg.eclipse.update.reconcile=false);addJvmArg(jvmArg:-Dorg.eclipse.p2.update.compatibility=false);"); //$NON-NLS-1$
- bundle.setSpecialUnconfigCommands("removeJvmArg(jvmArg:-Dorg.eclipse.update.reconcile=false);removeJvmArg(jvmArg:-Dorg.eclipse.p2.update.compatibility=false);"); //$NON-NLS-1$
+ bundle.setSpecialConfigCommands("addJvmArg(jvmArg:-Dorg.eclipse.update.reconcile=false);" + //$NON-NLS-1$
+ "addJvmArg(jvmArg:-Dorg.eclipse.p2.update.compatibility=" + new Boolean(info.getIsUpdateCompatible()).toString() + ");"); //$NON-NLS-1$
+ bundle.setSpecialUnconfigCommands("removeJvmArg(jvmArg:-Dorg.eclipse.update.reconcile=false);" + //$NON-NLS-1$
+ "removeJvmArg(jvmArg:-Dorg.eclipse.p2.update.compatibility=" + new Boolean(info.getIsUpdateCompatible()).toString() + ");"); //$NON-NLS-1$
}
if (bundle.getSymbolicName().equals(ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR)) {
bundle.setSpecialConfigCommands("addJvmArg(jvmArg:-Dorg.eclipse.equinox.simpleconfigurator.useReference=true);"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/IGeneratorInfo.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/IGeneratorInfo.java
index d8a556c01..400342e64 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/IGeneratorInfo.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/p2/metadata/generator/IGeneratorInfo.java
@@ -40,6 +40,8 @@ public interface IGeneratorInfo {
public String getFlavor();
+ public boolean getIsUpdateCompatible();
+
public File getJRELocation();
public String getLauncherConfig();
@@ -73,9 +75,12 @@ public interface IGeneratorInfo {
public void setFlavor(String value);
+ public void setIsUpdateCompatible(boolean isCompatible);
+
public void setMetadataRepository(IMetadataRepository value);
public void setPublishArtifacts(boolean value);
public void setRootId(String value);
+
} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF
index d54ea1bcf..280a6d325 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF
@@ -10,6 +10,7 @@ Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.4,
CDC-1.1/Foundation-1.1
Import-Package: org.eclipse.equinox.configurator,
+ org.eclipse.equinox.internal.p2.update,
org.eclipse.equinox.p2.artifact.repository,
org.eclipse.equinox.p2.core,
org.eclipse.equinox.p2.core.repository,
@@ -25,4 +26,5 @@ Import-Package: org.eclipse.equinox.configurator,
org.osgi.service.packageadmin;version="1.2.0",
org.osgi.util.tracker;version="1.3.3",
org.xml.sax
-Require-Bundle: org.eclipse.equinox.common
+Require-Bundle: org.eclipse.equinox.common,
+ org.eclipse.equinox.p2.touchpoint.eclipse;bundle-version="0.1.0"
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
index cb066a411..62fe00d32 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
@@ -14,7 +14,6 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.equinox.internal.p2.update.PlatformXmlListener;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.directorywatcher.DirectoryWatcher;
import org.eclipse.equinox.p2.directorywatcher.RepositoryListener;
@@ -240,33 +239,4 @@ public class Activator implements BundleActivator {
return null;
}
- /*
- * Return a boolean value indicating whether or not the given
- * objects are considered equal.
- */
- public static boolean equals(Object one, Object two) {
- return one == null ? two == null : one.equals(two);
- }
-
- /*
- * Return a boolean value indicating whether or not the given
- * lists are considered equal.
- */
- public static boolean equals(Object[] one, Object[] two) {
- if (one == null && two == null)
- return true;
- if (one == null || two == null)
- return false;
- if (one.length != two.length)
- return false;
- for (int i = 0; i < one.length; i++) {
- boolean found = false;
- for (int j = 0; !found && j < two.length; j++)
- found = one[i].equals(two[j]);
- if (!found)
- return false;
- }
- return true;
- }
-
}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/LinksManager.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/LinksManager.java
index 7e817e0c2..ac4bca36a 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/LinksManager.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/LinksManager.java
@@ -8,13 +8,14 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
+package org.eclipse.equinox.internal.p2.reconciler.dropins;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;
import java.util.Properties;
+import org.eclipse.equinox.internal.p2.update.*;
import org.eclipse.equinox.p2.core.ProvisionException;
/**
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/PlatformXmlListener.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java
index fb09ba8e3..1a07dfde1 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/PlatformXmlListener.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
+package org.eclipse.equinox.internal.p2.reconciler.dropins;
import java.io.File;
import java.io.IOException;
@@ -16,8 +16,8 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.equinox.internal.p2.reconciler.dropins.Activator;
-import org.eclipse.equinox.internal.p2.update.SiteDelta.Change;
+import org.eclipse.equinox.internal.p2.reconciler.dropins.SiteDelta.Change;
+import org.eclipse.equinox.internal.p2.update.*;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.directorywatcher.DirectoryChangeListener;
import org.eclipse.equinox.p2.directorywatcher.DirectoryWatcher;
@@ -124,7 +124,7 @@ public class PlatformXmlListener extends DirectoryChangeListener {
for (int i = 0; i < added.length; i++) {
Site site = added[i];
// TODO skip for now
- if ("platform:/base/".equals(site.getUrl()))
+ if ("platform:/base/".equals(site.getUrl())) //$NON-NLS-1$
continue;
try {
URL url = new URL(site.getUrl());
@@ -133,7 +133,7 @@ public class PlatformXmlListener extends DirectoryChangeListener {
} catch (IOException e) {
throw new ProvisionException("Exception while processing configuration.", e);
}
- File file = new File(url.getPath(), "plugins");
+ File file = new File(url.getPath(), "plugins"); //$NON-NLS-1$
DirectoryWatcher watcher = new DirectoryWatcher(file);
SiteListener listener = new SiteListener(site);
watcher.addListener(listener);
@@ -184,9 +184,9 @@ public class PlatformXmlListener extends DirectoryChangeListener {
private boolean majorChange(Change change) {
Site one = change.oldSite;
Site two = change.newSite;
- if (!Activator.equals(one.getPolicy(), two.getPolicy()))
+ if (!Utils.equals(one.getPolicy(), two.getPolicy()))
return true;
- return !Activator.equals(one.getList(), two.getList());
+ return !Utils.equals(one.getList(), two.getList());
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/SiteDelta.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteDelta.java
index c3aad8977..277bbae43 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/SiteDelta.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteDelta.java
@@ -8,10 +8,11 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
+package org.eclipse.equinox.internal.p2.reconciler.dropins;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.equinox.internal.p2.update.Site;
/*
* Represents the changes between 2 lists of sites.
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/SiteInfo.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteInfo.java
index 3e5840cb4..354bd1343 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/SiteInfo.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteInfo.java
@@ -8,8 +8,9 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
+package org.eclipse.equinox.internal.p2.reconciler.dropins;
+import org.eclipse.equinox.internal.p2.update.Site;
import org.eclipse.equinox.p2.directorywatcher.DirectoryWatcher;
/*
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/SiteListener.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteListener.java
index 8d41823eb..b4237be94 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/SiteListener.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteListener.java
@@ -8,10 +8,10 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
+package org.eclipse.equinox.internal.p2.reconciler.dropins;
import java.io.File;
-import org.eclipse.equinox.internal.p2.reconciler.dropins.Activator;
+import org.eclipse.equinox.internal.p2.update.Site;
import org.eclipse.equinox.p2.directorywatcher.RepositoryListener;
/**
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/SiteWatcher.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteWatcher.java
index e21888557..23a807b59 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/SiteWatcher.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteWatcher.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
+package org.eclipse.equinox.internal.p2.reconciler.dropins;
import java.io.File;
import org.eclipse.equinox.p2.directorywatcher.DirectoryWatcher;
@@ -26,8 +26,8 @@ public class SiteWatcher extends DirectoryWatcher {
*/
public SiteWatcher(File directory) {
super(directory);
- PLUGINS_DIR = new File(directory, "plugins");
- FEATURES_DIR = new File(directory, "features");
+ PLUGINS_DIR = new File(directory, "plugins"); //$NON-NLS-1$
+ FEATURES_DIR = new File(directory, "features"); //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Feature.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Feature.java
deleted file mode 100644
index 581796641..000000000
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Feature.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
-
-/*
- * Represents a feature entry in a platform.xml file.
- */
-public class Feature {
-
- private String id;
- private String url;
- private String version;
- private Site site;
-
- public Feature(Site site) {
- super();
- if (site == null)
- throw new IllegalArgumentException("Features should not have an empty site."); //$NON-NLS-1$
- this.site = site;
- }
-
- public String getId() {
- return id;
- }
-
- public Site getSite() {
- return site;
- }
-
- public String getUrl() {
- return url;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (!(obj instanceof Feature))
- return false;
- Feature other = (Feature) obj;
- if (!equals(getId(), other.getId()))
- return false;
- // shallow equals here. sites should never be null
- if (!equals(getSite().getUrl(), other.getSite().getUrl()))
- return false;
- if (!equals(getUrl(), other.getUrl()))
- return false;
- if (!equals(getVersion(), other.getVersion()))
- return false;
- return true;
- }
-
- private boolean equals(Object one, Object two) {
- return one == null ? two == null : one.equals(two);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return super.hashCode();
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Site.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Site.java
deleted file mode 100644
index bc150fab9..000000000
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Site.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.equinox.internal.p2.reconciler.dropins.Activator;
-
-/*
- * Represents a site in a platform.xml file.
- */
-public class Site {
-
- public final static String POLICY_MANAGED_ONLY = "MANAGED-ONLY"; //$NON-NLS-1$
- public final static String POLICY_USER_EXCLUDE = "USER-EXCLUDE"; //$NON-NLS-1$
- public final static String POLICY_USER_INCLUDE = "USER-INCLUDE"; //$NON-NLS-1$
-
- private String policy;
- private boolean enabled;
- private boolean updateable;
- private String url;
- private String linkFile;
- private List features = new ArrayList();
- private List list = new ArrayList();
-
- public void addFeature(Feature feature) {
- this.features.add(feature);
- }
-
- public void addPlugin(String plugin) {
- this.list.add(plugin);
- }
-
- public Feature[] getFeatures() {
- return (Feature[]) features.toArray(new Feature[features.size()]);
- }
-
- public Feature removeFeature(String featureURL) {
- for (int i = 0; i < features.size(); i++) {
- String nextURL = ((Feature) features.get(i)).getUrl();
- if (nextURL != null && nextURL.equals(featureURL)) {
- return (Feature) features.remove(i);
- }
- }
- return null;
- }
-
- public String getLinkFile() {
- return linkFile;
- }
-
- public String[] getList() {
- return (String[]) list.toArray(new String[list.size()]);
- }
-
- public String getPolicy() {
- return policy;
- }
-
- public String getUrl() {
- return url;
- }
-
- public boolean isEnabled() {
- return enabled;
- }
-
- public boolean isUpdateable() {
- return updateable;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- public void setLinkFile(String linkFile) {
- this.linkFile = linkFile;
- }
-
- public void setPolicy(String policy) {
- this.policy = policy;
- }
-
- public void setUpdateable(boolean updateable) {
- this.updateable = updateable;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getUrl().hashCode();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (!(obj instanceof Site))
- return false;
- Site other = (Site) obj;
- if (isEnabled() != other.isEnabled())
- return false;
- if (isUpdateable() != other.isUpdateable())
- return false;
- if (!getUrl().equals(other.getUrl()))
- return false;
- if (!Activator.equals(getLinkFile(), other.getLinkFile()))
- return false;
- if (!Activator.equals(getPolicy(), other.getPolicy()))
- return false;
- if (!Activator.equals(getList(), other.getList()))
- return false;
- if (!Activator.equals(getFeatures(), other.getFeatures()))
- return false;
- return true;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.reconciler/META-INF/MANIFEST.MF
index d54ea1bcf..280a6d325 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.reconciler/META-INF/MANIFEST.MF
@@ -10,6 +10,7 @@ Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.4,
CDC-1.1/Foundation-1.1
Import-Package: org.eclipse.equinox.configurator,
+ org.eclipse.equinox.internal.p2.update,
org.eclipse.equinox.p2.artifact.repository,
org.eclipse.equinox.p2.core,
org.eclipse.equinox.p2.core.repository,
@@ -25,4 +26,5 @@ Import-Package: org.eclipse.equinox.configurator,
org.osgi.service.packageadmin;version="1.2.0",
org.osgi.util.tracker;version="1.3.3",
org.xml.sax
-Require-Bundle: org.eclipse.equinox.common
+Require-Bundle: org.eclipse.equinox.common,
+ org.eclipse.equinox.p2.touchpoint.eclipse;bundle-version="0.1.0"
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
index cb066a411..62fe00d32 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
@@ -14,7 +14,6 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.equinox.internal.p2.update.PlatformXmlListener;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.directorywatcher.DirectoryWatcher;
import org.eclipse.equinox.p2.directorywatcher.RepositoryListener;
@@ -240,33 +239,4 @@ public class Activator implements BundleActivator {
return null;
}
- /*
- * Return a boolean value indicating whether or not the given
- * objects are considered equal.
- */
- public static boolean equals(Object one, Object two) {
- return one == null ? two == null : one.equals(two);
- }
-
- /*
- * Return a boolean value indicating whether or not the given
- * lists are considered equal.
- */
- public static boolean equals(Object[] one, Object[] two) {
- if (one == null && two == null)
- return true;
- if (one == null || two == null)
- return false;
- if (one.length != two.length)
- return false;
- for (int i = 0; i < one.length; i++) {
- boolean found = false;
- for (int j = 0; !found && j < two.length; j++)
- found = one[i].equals(two[j]);
- if (!found)
- return false;
- }
- return true;
- }
-
}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/LinksManager.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/LinksManager.java
index 7e817e0c2..ac4bca36a 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/LinksManager.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/LinksManager.java
@@ -8,13 +8,14 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
+package org.eclipse.equinox.internal.p2.reconciler.dropins;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;
import java.util.Properties;
+import org.eclipse.equinox.internal.p2.update.*;
import org.eclipse.equinox.p2.core.ProvisionException;
/**
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/PlatformXmlListener.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java
index fb09ba8e3..1a07dfde1 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/PlatformXmlListener.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
+package org.eclipse.equinox.internal.p2.reconciler.dropins;
import java.io.File;
import java.io.IOException;
@@ -16,8 +16,8 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.equinox.internal.p2.reconciler.dropins.Activator;
-import org.eclipse.equinox.internal.p2.update.SiteDelta.Change;
+import org.eclipse.equinox.internal.p2.reconciler.dropins.SiteDelta.Change;
+import org.eclipse.equinox.internal.p2.update.*;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.directorywatcher.DirectoryChangeListener;
import org.eclipse.equinox.p2.directorywatcher.DirectoryWatcher;
@@ -124,7 +124,7 @@ public class PlatformXmlListener extends DirectoryChangeListener {
for (int i = 0; i < added.length; i++) {
Site site = added[i];
// TODO skip for now
- if ("platform:/base/".equals(site.getUrl()))
+ if ("platform:/base/".equals(site.getUrl())) //$NON-NLS-1$
continue;
try {
URL url = new URL(site.getUrl());
@@ -133,7 +133,7 @@ public class PlatformXmlListener extends DirectoryChangeListener {
} catch (IOException e) {
throw new ProvisionException("Exception while processing configuration.", e);
}
- File file = new File(url.getPath(), "plugins");
+ File file = new File(url.getPath(), "plugins"); //$NON-NLS-1$
DirectoryWatcher watcher = new DirectoryWatcher(file);
SiteListener listener = new SiteListener(site);
watcher.addListener(listener);
@@ -184,9 +184,9 @@ public class PlatformXmlListener extends DirectoryChangeListener {
private boolean majorChange(Change change) {
Site one = change.oldSite;
Site two = change.newSite;
- if (!Activator.equals(one.getPolicy(), two.getPolicy()))
+ if (!Utils.equals(one.getPolicy(), two.getPolicy()))
return true;
- return !Activator.equals(one.getList(), two.getList());
+ return !Utils.equals(one.getList(), two.getList());
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/SiteDelta.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteDelta.java
index c3aad8977..277bbae43 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/SiteDelta.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteDelta.java
@@ -8,10 +8,11 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
+package org.eclipse.equinox.internal.p2.reconciler.dropins;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.equinox.internal.p2.update.Site;
/*
* Represents the changes between 2 lists of sites.
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/SiteInfo.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteInfo.java
index 3e5840cb4..354bd1343 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/SiteInfo.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteInfo.java
@@ -8,8 +8,9 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
+package org.eclipse.equinox.internal.p2.reconciler.dropins;
+import org.eclipse.equinox.internal.p2.update.Site;
import org.eclipse.equinox.p2.directorywatcher.DirectoryWatcher;
/*
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/SiteListener.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteListener.java
index 8d41823eb..b4237be94 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/SiteListener.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteListener.java
@@ -8,10 +8,10 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
+package org.eclipse.equinox.internal.p2.reconciler.dropins;
import java.io.File;
-import org.eclipse.equinox.internal.p2.reconciler.dropins.Activator;
+import org.eclipse.equinox.internal.p2.update.Site;
import org.eclipse.equinox.p2.directorywatcher.RepositoryListener;
/**
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/SiteWatcher.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteWatcher.java
index e21888557..23a807b59 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/SiteWatcher.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/SiteWatcher.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
+package org.eclipse.equinox.internal.p2.reconciler.dropins;
import java.io.File;
import org.eclipse.equinox.p2.directorywatcher.DirectoryWatcher;
@@ -26,8 +26,8 @@ public class SiteWatcher extends DirectoryWatcher {
*/
public SiteWatcher(File directory) {
super(directory);
- PLUGINS_DIR = new File(directory, "plugins");
- FEATURES_DIR = new File(directory, "features");
+ PLUGINS_DIR = new File(directory, "plugins"); //$NON-NLS-1$
+ FEATURES_DIR = new File(directory, "features"); //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Configuration.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Configuration.java
deleted file mode 100644
index 702b54e1a..000000000
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Configuration.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.equinox.p2.core.ProvisionException;
-
-/**
- * @since 1.0
- */
-public class Configuration {
-
- private List sites = new ArrayList();
- String date;
- boolean transientProperty;
- String version;
- String shared_ur;
-
- public static Configuration load(File location) throws ProvisionException {
- return ConfigurationParser.parse(location);
- }
-
- public Configuration() {
- super();
- }
-
- public void save(File location) throws ProvisionException {
- ConfigurationWriter.save(this, location);
- }
-
- public String getSharedUR() {
- return shared_ur;
- }
-
- public void setSharedUR(String value) {
- shared_ur = value;
- }
-
- public List getSites() {
- return sites;
- }
-
- public void add(Site site) {
- sites.add(site);
- }
-
- public String getDate() {
- return date;
- }
-
- public void setDate(String date) {
- this.date = date;
- }
-
- public void setVersion(String value) {
- version = value;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setTransient(boolean value) {
- transientProperty = value;
- }
-
- public boolean isTransient() {
- return transientProperty;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/ConfigurationConstants.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/ConfigurationConstants.java
deleted file mode 100644
index 10c096a4a..000000000
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/ConfigurationConstants.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
-
-/**
- * @since 1.0
- */
-public interface ConfigurationConstants {
-
- final String ELEMENT_CONFIG = "config"; //$NON-NLS-1$
- final String ELEMENT_FEATURE = "feature"; //$NON-NLS-1$
- final String ELEMENT_SITE = "site"; //$NON-NLS-1$
-
- final String ATTRIBUTE_DATE = "date"; //$NON-NLS-1$
- final String ATTRIBUTE_ENABLED = "enabled"; //$NON-NLS-1$
- final String ATTRIBUTE_ID = "id"; //$NON-NLS-1$
- final String ATTRIBUTE_LINKFILE = "linkfile"; //$NON-NLS-1$
- final String ATTRIBUTE_LIST = "list"; //$NON-NLS-1$
- final String ATTRIBUTE_POLICY = "policy"; //$NON-NLS-1$
- final String ATTRIBUTE_SHARED_UR = "shared_ur"; //$NON-NLS-1$
- final String ATTRIBUTE_TRANSIENT = "transient"; //$NON-NLS-1$
- final String ATTRIBUTE_UPDATEABLE = "updateable"; //$NON-NLS-1$
- final String ATTRIBUTE_URL = "url"; //$NON-NLS-1$
- final String ATTRIBUTE_VERSION = "version"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/ConfigurationParser.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/ConfigurationParser.java
deleted file mode 100644
index 3c519c50f..000000000
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/ConfigurationParser.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
-
-import java.io.*;
-import java.util.StringTokenizer;
-import javax.xml.parsers.*;
-import org.eclipse.equinox.p2.core.ProvisionException;
-import org.w3c.dom.*;
-import org.xml.sax.SAXException;
-
-/**
- * Parser for platform.xml files.
- *
- * @since 1.0
- */
-public class ConfigurationParser implements ConfigurationConstants {
-
- /*
- * Parse the given file handle which points to a platform.xml file and a configuration object.
- * Returns null if the file doesn't exist.
- */
- public static Configuration parse(File file) throws ProvisionException {
- return new ConfigurationParser().internalParse(file);
- }
-
- /*
- * Create a feature object based on the given DOM node.
- * Return the new feature.
- */
- private Feature createFeature(Node node, Site site) {
- Feature result = new Feature(site);
- String id = getAttribute(node, ATTRIBUTE_ID);
- if (id != null)
- result.setId(id);
- String url = getAttribute(node, ATTRIBUTE_URL);
- if (url != null)
- result.setUrl(url);
- String version = getAttribute(node, ATTRIBUTE_VERSION);
- if (version != null)
- result.setVersion(version);
- return result;
- }
-
- /*
- * Create the features from the given DOM node.
- */
- private void createFeatures(Node node, Site site) {
- NodeList children = node.getChildNodes();
- int size = children.getLength();
- for (int i = 0; i < size; i++) {
- Node child = children.item(i);
- if (child.getNodeType() != Node.ELEMENT_NODE)
- continue;
- if (!ELEMENT_FEATURE.equalsIgnoreCase(child.getNodeName()))
- continue;
- Feature feature = createFeature(child, site);
- if (feature != null)
- site.addFeature(feature);
- }
- }
-
- /*
- * Create a site based on the given DOM node.
- */
- private Site createSite(Node node) {
- Site result = new Site();
- String policy = getAttribute(node, ATTRIBUTE_POLICY);
- if (policy != null)
- result.setPolicy(policy);
- String enabled = getAttribute(node, ATTRIBUTE_ENABLED);
- if (enabled != null)
- result.setEnabled(Boolean.valueOf(enabled).booleanValue());
- String updateable = getAttribute(node, ATTRIBUTE_UPDATEABLE);
- if (updateable != null)
- result.setUpdateable(Boolean.valueOf(updateable).booleanValue());
- String url = getAttribute(node, ATTRIBUTE_URL);
- if (url != null)
- result.setUrl(url);
- String linkFile = getAttribute(node, ATTRIBUTE_LINKFILE);
- if (linkFile != null)
- result.setLinkFile(linkFile);
- String list = getAttribute(node, ATTRIBUTE_LIST);
- if (list != null)
- for (StringTokenizer tokenizer = new StringTokenizer(list, ","); tokenizer.hasMoreTokens();) //$NON-NLS-1$
- result.addPlugin(tokenizer.nextToken());
- createFeatures(node, result);
- return result;
- }
-
- /*
- * Return the attribute with the given name, or null if it does
- * not exist.
- */
- private String getAttribute(Node node, String name) {
- NamedNodeMap attributes = node.getAttributes();
- Node temp = attributes.getNamedItem(name);
- return temp == null ? null : temp.getNodeValue();
- }
-
- /*
- * Load the given file into a DOM document.
- */
- private Document load(InputStream input) throws ParserConfigurationException, IOException, SAXException {
- // load the feature xml
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder builder = factory.newDocumentBuilder();
- input = new BufferedInputStream(input);
- try {
- return builder.parse(input);
- } finally {
- if (input != null)
- try {
- input.close();
- } catch (IOException e) {
- // ignore
- }
- }
- }
-
- /*
- * Parse the given file handle which points to a platform.xml file and a configuration object.
- * Returns null if the file doesn't exist.
- */
- private Configuration internalParse(File file) throws ProvisionException {
- if (!file.exists())
- return null;
- try {
- InputStream input = new BufferedInputStream(new FileInputStream(file));
- Document document = load(input);
- return process(document);
- } catch (IOException e) {
- throw new ProvisionException("An error occurred reading the platform configuration file: " + file, e);
- } catch (ParserConfigurationException e) {
- throw new ProvisionException("An error occurred reading the platform configuration", e);
- } catch (SAXException e) {
- throw new ProvisionException("An error occurred reading the platform configuration", e);
- }
- }
-
- /*
- * Process the given DOM document and create the appropriate
- * site objects.
- */
- private Configuration process(Document document) {
- Node node = getConfigElement(document);
- if (node == null)
- return null;
- Configuration configuration = createConfiguration(node);
- NodeList children = node.getChildNodes();
- int size = children.getLength();
- for (int i = 0; i < size; i++) {
- Node child = children.item(i);
- if (child.getNodeType() != Node.ELEMENT_NODE)
- continue;
- if (!ELEMENT_SITE.equalsIgnoreCase(child.getNodeName()))
- continue;
- Site site = createSite(child);
- if (site != null)
- configuration.add(site);
- }
- return configuration;
- }
-
- private Configuration createConfiguration(Node node) {
- Configuration result = new Configuration();
- String value = getAttribute(node, ATTRIBUTE_DATE);
- if (value != null)
- result.setDate(value);
- value = getAttribute(node, ATTRIBUTE_TRANSIENT);
- if (value != null)
- result.setTransient(Boolean.valueOf(value).booleanValue());
- value = getAttribute(node, ATTRIBUTE_SHARED_UR);
- if (value != null)
- result.setSharedUR(value);
- value = getAttribute(node, ATTRIBUTE_VERSION);
- if (value != null)
- result.setVersion(value);
- return result;
- }
-
- private Node getConfigElement(Document doc) {
- NodeList children = doc.getChildNodes();
- int size = children.getLength();
- for (int i = 0; i < size; i++) {
- Node child = children.item(i);
- if (child.getNodeType() != Node.ELEMENT_NODE)
- continue;
- if (ELEMENT_CONFIG.equalsIgnoreCase(child.getNodeName()))
- return child;
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/ConfigurationWriter.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/ConfigurationWriter.java
deleted file mode 100644
index 38bd84ae1..000000000
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/ConfigurationWriter.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
-
-import java.io.*;
-import java.util.*;
-import org.eclipse.equinox.p2.core.ProvisionException;
-
-/**
- * @since 1.0
- */
-public class ConfigurationWriter implements ConfigurationConstants {
-
- /*
- * Save the given configuration to the specified location.
- */
- public static void save(Configuration configuration, File location) throws ProvisionException {
- XMLWriter writer = null;
- try {
- OutputStream output = new BufferedOutputStream(new FileOutputStream(location));
- writer = new XMLWriter(output);
- Map args = new HashMap();
-
- String value = configuration.getDate();
- if (value != null)
- args.put(ATTRIBUTE_DATE, value);
-
- value = configuration.getSharedUR();
- if (value != null)
- args.put(ATTRIBUTE_SHARED_UR, value);
-
- value = configuration.getVersion();
- if (value != null)
- args.put(ATTRIBUTE_VERSION, value);
-
- args.put(ATTRIBUTE_TRANSIENT, Boolean.toString(configuration.isTransient()));
-
- writer.startTag(ELEMENT_CONFIG, args);
-
- for (Iterator iter = configuration.getSites().iterator(); iter.hasNext();) {
- Site site = (Site) iter.next();
- write(writer, site);
- }
-
- writer.endTag(ELEMENT_CONFIG);
- } catch (UnsupportedEncodingException e) {
- throw new ProvisionException("Exception when saving configuration to: " + location, e);
- } catch (FileNotFoundException e) {
- throw new ProvisionException("Exception when saving configuration to: " + location, e);
- } finally {
- if (writer != null) {
- writer.flush();
- writer.close();
- }
- }
- }
-
- /*
- * Write out the given site.
- */
- private static void write(XMLWriter writer, Site site) {
- Map args = new HashMap();
-
- String value = site.getLinkFile();
- if (value != null)
- args.put(ATTRIBUTE_LINKFILE, value);
-
- value = site.getPolicy();
- if (value != null)
- args.put(ATTRIBUTE_POLICY, value);
-
- value = site.getUrl();
- if (value != null)
- args.put(ATTRIBUTE_URL, value);
-
- value = toString(site.getList());
- if (value != null)
- args.put(ATTRIBUTE_LIST, value);
-
- args.put(ATTRIBUTE_UPDATEABLE, Boolean.toString(site.isUpdateable()));
- args.put(ATTRIBUTE_ENABLED, Boolean.toString(site.isEnabled()));
-
- writer.startTag(ELEMENT_SITE, args);
- write(writer, site.getFeatures());
- writer.endTag(ELEMENT_SITE);
- }
-
- /*
- * Convert the given list to a comma-separated string.
- */
- private static String toString(String[] list) {
- if (list == null || list.length == 0)
- return null;
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < list.length; i++) {
- buffer.append(list[i]);
- if (i + 1 < list.length)
- buffer.append(',');
- }
- return buffer.toString();
- }
-
- /*
- * Write out the given list of features.
- */
- private static void write(XMLWriter writer, Feature[] features) {
- if (features == null || features.length == 0)
- return;
- for (int i = 0; i < features.length; i++) {
- Feature feature = features[i];
- Map args = new HashMap();
- String value = feature.getId();
- if (value != null)
- args.put(ATTRIBUTE_ID, value);
- value = feature.getUrl();
- if (value != null)
- args.put(ATTRIBUTE_URL, value);
- value = feature.getVersion();
- if (value != null)
- args.put(ATTRIBUTE_VERSION, value);
- writer.startTag(ELEMENT_FEATURE, args);
- writer.endTag(ELEMENT_FEATURE);
- }
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Utils.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Utils.java
deleted file mode 100644
index 73fe9996e..000000000
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Utils.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
-
-import java.io.File;
-import java.io.UnsupportedEncodingException;
-import java.net.*;
-
-/**
- *
- * @since 1.0
- */
-public class Utils {
- public static boolean isWindows = System.getProperty("os.name").startsWith("Win"); //$NON-NLS-1$ //$NON-NLS-2$
- private static boolean init = false;
- private static boolean useEnc = true;
-
- /*
- * Copied from UpdateURLDecoder v1.4 in org.eclipse.update.configurator.
- */
- public static String decode(String s, String enc) throws UnsupportedEncodingException {
- if (!init) {
- init = true;
- try {
- return URLDecoder.decode(s, enc);
- } catch (NoSuchMethodError e) {
- useEnc = false;
- }
- }
- return useEnc ? URLDecoder.decode(s, enc) : URLDecoder.decode(s);
- }
-
- /*
- * Copied from Utils v1.32 in org.eclipse.update.configurator.
- *
- * Ensures file: URLs on Windows have the right form (i.e. '/' as segment separator, drive letter in lower case, etc)
- */
- public static String canonicalizeURL(String url) {
- if (!(isWindows && url.startsWith("file:"))) //$NON-NLS-1$
- return url;
- try {
- String path = new URL(url).getPath();
- // normalize to not have leading / so we can check the form
- File file = new File(path);
- path = file.toString().replace('\\', '/');
- if (Character.isUpperCase(path.charAt(0))) {
- char[] chars = path.toCharArray();
- chars[0] = Character.toLowerCase(chars[0]);
- path = new String(chars);
- return new File(path).toURL().toExternalForm();
- }
- } catch (MalformedURLException e) {
- // default to original url
- }
- return url;
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java
deleted file mode 100644
index 9b86646c1..000000000
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.update;
-
-import java.io.*;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * A simple XML writer.
- *
- * Copied from the org.eclipse.core.resources bundle.
- */
-public class XMLWriter extends PrintWriter {
- protected int tab;
-
- /* constants */
- protected static final String XML_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //$NON-NLS-1$
-
- public XMLWriter(OutputStream output) throws UnsupportedEncodingException {
- super(new OutputStreamWriter(output, "UTF8")); //$NON-NLS-1$
- tab = 0;
- println(XML_VERSION);
- }
-
- public void endTag(String name) {
- tab--;
- printTag('/' + name, null);
- }
-
- public void printSimpleTag(String name, Object value) {
- if (value != null) {
- printTag(name, null, true, false);
- print(getEscaped(String.valueOf(value)));
- printTag('/' + name, null, false, true);
- }
- }
-
- public void printTabulation() {
- for (int i = 0; i < tab; i++)
- super.print('\t');
- }
-
- public void printTag(String name, Map parameters) {
- printTag(name, parameters, true, true);
- }
-
- public void printTag(String name, Map parameters, boolean shouldTab, boolean newLine) {
- StringBuffer sb = new StringBuffer();
- sb.append("<"); //$NON-NLS-1$
- sb.append(name);
- if (parameters != null)
- for (Iterator it = parameters.keySet().iterator(); it.hasNext();) {
- sb.append(" "); //$NON-NLS-1$
- String key = (String) it.next();
- sb.append(key);
- sb.append("=\""); //$NON-NLS-1$
- sb.append(getEscaped(String.valueOf(parameters.get(key))));
- sb.append("\""); //$NON-NLS-1$
- }
- sb.append(">"); //$NON-NLS-1$
- if (shouldTab)
- printTabulation();
- if (newLine)
- println(sb.toString());
- else
- print(sb.toString());
- }
-
- public void startTag(String name, Map parameters) {
- startTag(name, parameters, true);
- }
-
- public void startTag(String name, Map parameters, boolean newLine) {
- printTag(name, parameters, true, newLine);
- tab++;
- }
-
- private static void appendEscapedChar(StringBuffer buffer, char c) {
- String replacement = getReplacement(c);
- if (replacement != null) {
- buffer.append('&');
- buffer.append(replacement);
- buffer.append(';');
- } else {
- buffer.append(c);
- }
- }
-
- public static String getEscaped(String s) {
- StringBuffer result = new StringBuffer(s.length() + 10);
- for (int i = 0; i < s.length(); ++i)
- appendEscapedChar(result, s.charAt(i));
- return result.toString();
- }
-
- private static String getReplacement(char c) {
- // Encode special XML characters into the equivalent character references.
- // These five are defined by default for all XML documents.
- switch (c) {
- case '<' :
- return "lt"; //$NON-NLS-1$
- case '>' :
- return "gt"; //$NON-NLS-1$
- case '"' :
- return "quot"; //$NON-NLS-1$
- case '\'' :
- return "apos"; //$NON-NLS-1$
- case '&' :
- return "amp"; //$NON-NLS-1$
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/TestGeneratorInfo.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/TestGeneratorInfo.java
index 752f8b163..d262bc5d2 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/TestGeneratorInfo.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/TestGeneratorInfo.java
@@ -36,6 +36,7 @@ public class TestGeneratorInfo implements IGeneratorInfo {
private String rootVersion;
private String launcherConfig;
private URL siteLocation;
+ private boolean updateCompatibilty = false;
public TestGeneratorInfo(File baseLocation) {
this.baseLocation = baseLocation;
@@ -153,6 +154,14 @@ public class TestGeneratorInfo implements IGeneratorInfo {
this.launcherConfig = launcherConfig;
}
+ public boolean getIsUpdateCompatible() {
+ return this.updateCompatibilty;
+ }
+
+ public void setIsUpdateCompatible(boolean isCompatible) {
+ this.updateCompatibilty = isCompatible;
+ }
+
public boolean reuseExistingPack200Files() {
return false;
}
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.classpath b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.classpath
index 7cdeb7319..751c8f2e5 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.classpath
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.settings/org.eclipse.jdt.core.prefs
index cc7076882..52d7e520e 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Tue Aug 21 09:42:55 EDT 2007
+#Mon Jan 28 11:46:17 PST 2008
eclipse.preferences.version=1
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
@@ -9,23 +9,19 @@ org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
@@ -63,7 +59,6 @@ org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
org.eclipse.jdt.core.compiler.problem.unusedImport=error
@@ -73,7 +68,6 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=en
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -117,11 +111,9 @@ org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=false
-org.eclipse.jdt.core.formatter.comment.format_comments=false
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF
index 2af9e8f6b..e6d1742a8 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF
@@ -7,16 +7,11 @@ Bundle-Localization: plugin
Bundle-Version: 0.1.0.qualifier
Import-Package: org.eclipse.core.runtime;common=split,
org.eclipse.equinox.frameworkadmin,
- org.eclipse.equinox.internal.frameworkadmin.utils,
- org.eclipse.equinox.internal.p2.artifact.repository,
- org.eclipse.equinox.internal.p2.artifact.repository.simple,
org.eclipse.equinox.internal.p2.core.helpers,
org.eclipse.equinox.p2.artifact.repository,
- org.eclipse.equinox.p2.artifact.repository.processing,
org.eclipse.equinox.p2.core,
org.eclipse.equinox.p2.core.location,
org.eclipse.equinox.p2.core.repository,
- org.eclipse.equinox.p2.download,
org.eclipse.equinox.p2.engine,
org.eclipse.equinox.p2.garbagecollector,
org.eclipse.equinox.p2.metadata,
@@ -24,17 +19,15 @@ Import-Package: org.eclipse.core.runtime;common=split,
org.eclipse.equinox.p2.metadata.query,
org.eclipse.equinox.p2.query,
org.eclipse.equinox.spi.p2.artifact.repository,
- org.eclipse.equinox.spi.p2.core.repository,
- org.eclipse.osgi.framework.util,
org.eclipse.osgi.service.datalocation;version="1.0.0",
org.eclipse.osgi.service.environment;version="1.0.0",
org.eclipse.osgi.service.resolver;version="1.2.0";resolution:=optional,
org.eclipse.osgi.util;version="1.1.0",
- org.eclipse.update.configurator;resolution:=optional,
org.osgi.framework;version="1.3.0",
- org.osgi.util.tracker;version="1.3.2"
+ org.osgi.util.tracker;version="1.3.2",
+ org.xml.sax
+Export-Package: org.eclipse.equinox.internal.p2.touchpoint.eclipse;x-internal:=true,org.eclipse.equinox.internal.p2.update;x-friends:="org.eclipse.equinox.p2.reconciler.dropins"
Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
J2SE-1.4
Eclipse-LazyStart: true
Bundle-Activator: org.eclipse.equinox.internal.p2.touchpoint.eclipse.Activator
-Export-Package: org.eclipse.equinox.internal.p2.touchpoint.eclipse;x-internal:=true
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseTouchpoint.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseTouchpoint.java
index 5f565f4c2..fed1a009a 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseTouchpoint.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseTouchpoint.java
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.*;
import org.eclipse.equinox.frameworkadmin.BundleInfo;
import org.eclipse.equinox.frameworkadmin.Manipulator;
import org.eclipse.equinox.p2.artifact.repository.*;
+import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
import org.osgi.framework.Version;
@@ -133,12 +134,9 @@ public class EclipseTouchpoint extends Touchpoint {
if (INSTALL_PHASE_ID.equals(phaseId) || UNINSTALL_PHASE_ID.equals(phaseId)) {
PlatformConfigurationWrapper configuration = (PlatformConfigurationWrapper) touchpointParameters.get(PARM_PLATFORM_CONFIGURATION);
try {
- URL configURL = getConfigurationURL(profile);
- configuration.save(configURL);
- } catch (CoreException ce) {
- return createError("Error constructing platform configuration url.", ce);
- } catch (IOException ie) {
- return createError("Error saving platform configuration.", ie);
+ configuration.save();
+ } catch (ProvisionException pe) {
+ return createError("Error saving platform configuration.", pe);
}
}
return null;
@@ -725,6 +723,7 @@ public class EclipseTouchpoint extends Touchpoint {
PlatformConfigurationWrapper configuration = (PlatformConfigurationWrapper) parameters.get(PARM_PLATFORM_CONFIGURATION);
String feature = (String) parameters.get(PARM_FEATURE);
String featureId = (String) parameters.get(PARM_FEATURE_ID);
+ String featureVersion = (String) parameters.get(PARM_FEATURE_VERSION);
IArtifactKey[] artifacts = iu.getArtifacts();
if (artifacts == null || artifacts.length == 0)
@@ -744,7 +743,13 @@ public class EclipseTouchpoint extends Touchpoint {
featureId = artifactKey.getId();
}
- return configuration.removeFeatureEntry(featureId);
+ if (featureVersion == null)
+ return createError("The \"featureVersion\" parameter is missing from the \"install feature\" action"); //$NON-NLS-1$
+ else if (PARM_DEFAULT_VALUE.equals(featureVersion)) {
+ featureVersion = artifactKey.getVersion().toString();
+ }
+
+ return configuration.removeFeatureEntry(featureId, featureVersion);
}
public IInstallableUnit prepareIU(IInstallableUnit iu, Profile profile) {
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java
index a855cf694..03d41f554 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java
@@ -10,77 +10,68 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.eclipse;
-import java.io.IOException;
-import java.net.MalformedURLException;
+import java.io.File;
import java.net.URL;
+import java.util.Iterator;
+import java.util.List;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.update.configurator.IPlatformConfiguration;
-import org.eclipse.update.configurator.IPlatformConfigurationFactory;
-import org.eclipse.update.configurator.IPlatformConfiguration.IFeatureEntry;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
+import org.eclipse.equinox.internal.p2.update.*;
+import org.eclipse.equinox.p2.core.ProvisionException;
/**
- * This class provides a wrapper on IPlatformConfiguration to support
- * installing and uninstalling features in the configuration.
+ * This class provides a wrapper for reading and writing platform.xml.
*
* Only a minimal set of operations is exposed.
*/
public class PlatformConfigurationWrapper {
- private IPlatformConfiguration configuration;
- private URL configURL;
+ private Configuration configuration = null;
+ private Site poolSite = null;
+ private File configFile;
private URL poolURL;
- private boolean serviceNotFound = false;
+
+ private static String FEATURES = "features/"; //$NON-NLS-1$
public PlatformConfigurationWrapper(URL configDir, URL featurePool) {
this.configuration = null;
- try {
- this.configURL = new URL(configDir, "org.eclipse.update/platform.xml");
- } catch (MalformedURLException mue) {
- this.configURL = configDir;
- }
+ this.configFile = new File(configDir.getFile(), "/org.eclipse.update/platform.xml"); //$NON-NLS-1$
this.poolURL = featurePool;
}
private void loadDelegate() {
- if (configuration != null || serviceNotFound)
+ if (configuration != null)
return;
- // Acquire the configuration factory service first
- BundleContext context = Activator.getContext();
- ServiceReference configFactorySR = null;
+
try {
- configFactorySR = context.getServiceReference(IPlatformConfigurationFactory.class.getName());
- } catch (Throwable /*ClassNotFoundException*/cnfe) {
- serviceNotFound = true;
- }
- if (configFactorySR == null) {
- serviceNotFound = true;
- return;
- // throw new IllegalStateException("Could not acquire the platform configuration factory service."); //$NON-NLS-1$
+ if (configFile.exists()) {
+ configuration = Configuration.load(configFile);
+ } else {
+ configuration = new Configuration();
+ }
+ } catch (ProvisionException pe) {
+ // TODO: Make this a real message
+ throw new IllegalStateException("Error parsing platform configuration."); //$NON-NLS-1$;
}
- IPlatformConfigurationFactory configFactory = (IPlatformConfigurationFactory) context.getService(configFactorySR);
- if (configFactory == null)
- throw new IllegalStateException("Platform configuration service returned a null platform configuration factory."); //$NON-NLS-1$
- // Get the configuration using the factory
- try {
- configuration = configFactory.getPlatformConfiguration(configURL);
- } catch (IOException ioe) {
- try {
- configuration = configFactory.getPlatformConfiguration(null);
- IPlatformConfiguration.ISiteEntry site = configuration.createSiteEntry(poolURL, configuration.createSitePolicy(IPlatformConfiguration.ISitePolicy.USER_INCLUDE, new String[0]));
- configuration.configureSite(site);
- } catch (IOException ioe2) {
- configuration = configFactory.getCurrentPlatformConfiguration();
+ List sites = configuration.getSites();
+ for (Iterator iter = sites.iterator(); iter.hasNext();) {
+ Site nextSite = (Site) iter.next();
+ String nextURL = nextSite.getUrl();
+ if (nextURL.equals(poolURL.toExternalForm())) {
+ poolSite = nextSite;
+ break;
}
}
- context.ungetService(configFactorySR);
- }
- // Only expose the operations using IPlatformConfiguration that are needed
- // to install and uninstall features in the configuration.
+ if (poolSite == null) {
+ poolSite = new Site();
+ poolSite.setUrl(poolURL.toExternalForm());
+ poolSite.setPolicy(Site.POLICY_MANAGED_ONLY);
+ poolSite.setEnabled(true);
+ configuration.add(poolSite);
+ }
+ }
/*
* @see org.eclipse.update.configurator.IPlatformConfiguration#createFeatureEntry(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, java.lang.String, java.net.URL[])
@@ -90,36 +81,40 @@ public class PlatformConfigurationWrapper {
if (configuration == null)
return new Status(IStatus.WARNING, Activator.ID, "Platform configuration not available.", null); //$NON-NLS-1$
- IFeatureEntry entry = configuration.createFeatureEntry(id, version, pluginIdentifier, pluginVersion, primary, application, root);
- if (entry != null) {
- configuration.configureFeatureEntry(entry);
- return Status.OK_STATUS;
- }
- return new Status(IStatus.ERROR, Activator.ID, "Creating feature entry returned null.", null); //$NON-NLS-1$
+ Feature addedFeature = new Feature(poolSite);
+ addedFeature.setId(id);
+ addedFeature.setVersion(version);
+ addedFeature.setUrl(makeFeatureURL(id, version));
+ poolSite.addFeature(addedFeature);
+ return Status.OK_STATUS;
}
/*
* @see org.eclipse.update.configurator.IPlatformConfiguration#findConfiguredFeatureEntry(java.lang.String)
*/
- public IStatus removeFeatureEntry(String id) {
+ public IStatus removeFeatureEntry(String id, String version) {
loadDelegate();
if (configuration == null)
return new Status(IStatus.WARNING, Activator.ID, "Platform configuration not available.", null); //$NON-NLS-1$
- IPlatformConfiguration.IFeatureEntry entry = configuration.findConfiguredFeatureEntry(id);
- if (entry != null) {
- configuration.unconfigureFeatureEntry(entry);
- return Status.OK_STATUS;
- }
- return new Status(IStatus.ERROR, Activator.ID, "A feature with the specified id was not found.", null); //$NON-NLS-1$
+ Feature removedFeature = poolSite.removeFeature(makeFeatureURL(id, version));
+ return (removedFeature != null ? Status.OK_STATUS : new Status(IStatus.ERROR, Activator.ID, "A feature with the specified id was not found.", null)); //$NON-NLS-1$
}
/*
* @see org.eclipse.update.configurator.IPlatformConfiguration#save()
*/
- public void save(URL location) throws IOException {
+ public void save() throws ProvisionException {
if (configuration != null) {
- configuration.save(location);
+ configFile.getParentFile().mkdirs();
+ configuration.save(configFile);
}
}
+
+ private static String makeFeatureURL(String id, String version) {
+ return FEATURES + id + "_" + version + "/"; //$NON-NLS-1$ //$NON-NLS-2$;
+ }
+
+ // }
+
}
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/UpdateConfiguratorUtils.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/UpdateConfiguratorUtils.java
deleted file mode 100644
index 77dbf1aca..000000000
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/UpdateConfiguratorUtils.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.touchpoint.eclipse;
-
-import org.eclipse.update.configurator.IPlatformConfiguration;
-import org.eclipse.update.configurator.IPlatformConfigurationFactory;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-/**
- *
- */
-public class UpdateConfiguratorUtils {
-
- public static IPlatformConfiguration getCurrentPlatformConfiguration() {
- // acquire factory service first
- BundleContext context = Activator.getContext();
- ServiceReference configFactorySR = context.getServiceReference(IPlatformConfigurationFactory.class.getName());
- if (configFactorySR == null)
- throw new IllegalStateException();
- IPlatformConfigurationFactory configFactory = (IPlatformConfigurationFactory) context.getService(configFactorySR);
- if (configFactory == null)
- throw new IllegalStateException();
- // get the configuration using the factory
- IPlatformConfiguration currentConfig = configFactory.getCurrentPlatformConfiguration();
- context.ungetService(configFactorySR);
- return currentConfig;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Configuration.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Configuration.java
index 702b54e1a..702b54e1a 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Configuration.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Configuration.java
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/ConfigurationConstants.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/ConfigurationConstants.java
index 10c096a4a..10c096a4a 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/ConfigurationConstants.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/ConfigurationConstants.java
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/ConfigurationParser.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/ConfigurationParser.java
index 3c519c50f..3c519c50f 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/ConfigurationParser.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/ConfigurationParser.java
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/ConfigurationWriter.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/ConfigurationWriter.java
index 38bd84ae1..38bd84ae1 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/ConfigurationWriter.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/ConfigurationWriter.java
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Feature.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Feature.java
index 581796641..54ca2d0bb 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Feature.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Feature.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Site.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Site.java
index bc150fab9..514c8a168 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/update/Site.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Site.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@ package org.eclipse.equinox.internal.p2.update;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.equinox.internal.p2.reconciler.dropins.Activator;
/*
* Represents a site in a platform.xml file.
@@ -117,13 +116,13 @@ public class Site {
return false;
if (!getUrl().equals(other.getUrl()))
return false;
- if (!Activator.equals(getLinkFile(), other.getLinkFile()))
+ if (!Utils.equals(getLinkFile(), other.getLinkFile()))
return false;
- if (!Activator.equals(getPolicy(), other.getPolicy()))
+ if (!Utils.equals(getPolicy(), other.getPolicy()))
return false;
- if (!Activator.equals(getList(), other.getList()))
+ if (!Utils.equals(getList(), other.getList()))
return false;
- if (!Activator.equals(getFeatures(), other.getFeatures()))
+ if (!Utils.equals(getFeatures(), other.getFeatures()))
return false;
return true;
}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Utils.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Utils.java
index 73fe9996e..32c3af1e1 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/Utils.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Utils.java
@@ -63,4 +63,33 @@ public class Utils {
return url;
}
+ /*
+ * Return a boolean value indicating whether or not the given
+ * objects are considered equal.
+ */
+ public static boolean equals(Object one, Object two) {
+ return one == null ? two == null : one.equals(two);
+ }
+
+ /*
+ * Return a boolean value indicating whether or not the given
+ * lists are considered equal.
+ */
+ public static boolean equals(Object[] one, Object[] two) {
+ if (one == null && two == null)
+ return true;
+ if (one == null || two == null)
+ return false;
+ if (one.length != two.length)
+ return false;
+ for (int i = 0; i < one.length; i++) {
+ boolean found = false;
+ for (int j = 0; !found && j < two.length; j++)
+ found = one[i].equals(two[j]);
+ if (!found)
+ return false;
+ }
+ return true;
+ }
+
}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java
index 9b86646c1..9b86646c1 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java

Back to the top