Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2019-08-07 15:09:16 -0400
committerLars Vogel2019-08-08 03:02:13 -0400
commit372cb8f4bdfb7fb084c5a1cce87ccd1360f6fc55 (patch)
tree229517a5bba2487575e2fe85f57e96399d8d55cf
parentfdaa0214fab1137233cdf143fb63cc1a51db8ef5 (diff)
downloadrt.equinox.p2-I20190811-1800.tar.gz
rt.equinox.p2-I20190811-1800.tar.xz
rt.equinox.p2-I20190811-1800.zip
org.eclipse.equinox.p2.metadata.repository Uses FrameWorkUtil to access the bundle context Converts the activator implementation into a constants interface Change-Id: I03eb08ea8af4a5c898349d7d5052682f3701ee28 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/Constants.java (renamed from bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/Activator.java)26
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/SimpleMetadataRepositoryFactory.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/XZedSimpleMetadataRepositoryFactory.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java4
10 files changed, 40 insertions, 54 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF
index d210b3bf7..bf349349a 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.p2.metadata.repository;singleton:=true
Bundle-Version: 1.3.200.qualifier
-Bundle-Activator: org.eclipse.equinox.internal.p2.metadata.repository.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.equinox.internal.p2.metadata.repository;
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java
index 5e8e73c22..714f83f8e 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java
@@ -34,6 +34,7 @@ import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.spi.AbstractMetadataRepository;
import org.eclipse.osgi.util.NLS;
+import org.osgi.framework.FrameworkUtil;
public class CompositeMetadataRepository extends AbstractMetadataRepository implements ICompositeRepository<IInstallableUnit>, IIndexProvider<IInstallableUnit> {
@@ -41,7 +42,9 @@ public class CompositeMetadataRepository extends AbstractMetadataRepository impl
static final public String PI_REPOSITORY_TYPE = "compositeMetadataRepository"; //$NON-NLS-1$
static final public String PROP_ATOMIC_LOADING = "p2.atomic.composite.loading"; //$NON-NLS-1$
- static final public boolean ATOMIC_LOADING_DEFAULT = Boolean.parseBoolean(Activator.getContext().getProperty("eclipse.p2.atomic.composite.loading.default")); //$NON-NLS-1$
+ static final public boolean ATOMIC_LOADING_DEFAULT = Boolean
+ .parseBoolean(FrameworkUtil.getBundle(CompositeMetadataRepository.class).getBundleContext()
+ .getProperty("eclipse.p2.atomic.composite.loading.default")); //$NON-NLS-1$
static final private Integer REPOSITORY_VERSION = 1;
static final public String XML_EXTENSION = ".xml"; //$NON-NLS-1$
@@ -184,7 +187,7 @@ public class CompositeMetadataRepository extends AbstractMetadataRepository impl
if (propagateException) {
removeFromRepoManager(repositoriesToBeRemovedOnFailure);
String msg = NLS.bind(Messages.io_failedRead, getLocation());
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, e));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, e));
}
}
}
@@ -312,7 +315,7 @@ public class CompositeMetadataRepository extends AbstractMetadataRepository impl
super.setProperty(IRepository.PROP_TIMESTAMP, Long.toString(System.currentTimeMillis()));
new CompositeRepositoryIO().write(toState(), output, PI_REPOSITORY_TYPE);
} catch (IOException e) {
- LogHelper.log(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_WRITE, NLS.bind(Messages.io_failedWrite, getLocation()), e));
+ LogHelper.log(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_FAILED_WRITE, NLS.bind(Messages.io_failedWrite, getLocation()), e));
}
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java
index 2b5fd1b3f..f2750f670 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java
@@ -68,7 +68,7 @@ public class CompositeMetadataRepositoryFactory extends MetadataRepositoryFactor
if (localFile.exists())
return localFile;
String msg = NLS.bind(Messages.io_failedRead, location);
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null));
}
//file is not local, create a cache of the repository metadata
CacheManager cache = getAgent().getService(CacheManager.class);
@@ -78,7 +78,7 @@ public class CompositeMetadataRepositoryFactory extends MetadataRepositoryFactor
if (localFile == null) {
//there is no remote file in either form
String msg = NLS.bind(Messages.io_failedRead, location);
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null));
}
return localFile;
}
@@ -133,10 +133,10 @@ public class CompositeMetadataRepositoryFactory extends MetadataRepositoryFactor
}
} catch (FileNotFoundException e) {
String msg = NLS.bind(Messages.io_failedRead, location);
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, e));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, e));
} catch (IOException e) {
String msg = NLS.bind(Messages.io_failedRead, location);
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, e));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, e));
} finally {
if (monitor != null)
monitor.done();
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/Activator.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/Constants.java
index af95c4f7c..bc095ef3a 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/Constants.java
@@ -7,34 +7,16 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Cloudsmith Inc - additional implementation
*******************************************************************************/
package org.eclipse.equinox.internal.p2.metadata.repository;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
- public static final String ID = "org.eclipse.equinox.p2.metadata.repository"; //$NON-NLS-1$
- public static final String REPO_PROVIDER_XPT = ID + '.' + "metadataRepositories"; //$NON-NLS-1$
-
- private static BundleContext bundleContext;
-
- public static BundleContext getContext() {
- return bundleContext;
- }
+public interface Constants {
- @Override
- public void start(BundleContext aContext) throws Exception {
- bundleContext = aContext;
- }
+ String ID = "org.eclipse.equinox.p2.metadata.repository"; //$NON-NLS-1$
+ String REPO_PROVIDER_XPT = ID + '.' + "metadataRepositories"; //$NON-NLS-1$
- @Override
- public void stop(BundleContext aContext) throws Exception {
- bundleContext = null;
- }
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java
index 6ac588359..06707e85a 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java
@@ -282,7 +282,7 @@ public class LocalMetadataRepository extends AbstractMetadataRepository implemen
super.setProperty(IRepository.PROP_TIMESTAMP, Long.toString(System.currentTimeMillis()), new NullProgressMonitor());
new MetadataRepositoryIO(getProvisioningAgent()).write(this, output);
} catch (IOException e) {
- LogHelper.log(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_WRITE, "Error saving metadata repository: " + getLocation(), e)); //$NON-NLS-1$
+ LogHelper.log(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_FAILED_WRITE, "Error saving metadata repository: " + getLocation(), e)); //$NON-NLS-1$
}
}
@@ -316,18 +316,18 @@ public class LocalMetadataRepository extends AbstractMetadataRepository implemen
disableSave = true;
runnable.run(monitor);
} catch (OperationCanceledException oce) {
- return new Status(IStatus.CANCEL, Activator.ID, oce.getMessage(), oce);
+ return new Status(IStatus.CANCEL, Constants.ID, oce.getMessage(), oce);
} catch (Throwable e) {
- result = new Status(IStatus.ERROR, Activator.ID, e.getMessage(), e);
+ result = new Status(IStatus.ERROR, Constants.ID, e.getMessage(), e);
} finally {
disableSave = false;
try {
save();
} catch (Exception e) {
if (result != null)
- result = new MultiStatus(Activator.ID, IStatus.ERROR, new IStatus[] {result}, e.getMessage(), e);
+ result = new MultiStatus(Constants.ID, IStatus.ERROR, new IStatus[] {result}, e.getMessage(), e);
else
- result = new Status(IStatus.ERROR, Activator.ID, e.getMessage(), e);
+ result = new Status(IStatus.ERROR, Constants.ID, e.getMessage(), e);
}
}
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java
index c5c2b1e56..62144c4fb 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java
@@ -37,6 +37,7 @@ import org.eclipse.equinox.p2.repository.metadata.spi.AbstractMetadataRepository
import org.eclipse.equinox.p2.repository.metadata.spi.AbstractMetadataRepository.RepositoryState;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
import org.xml.sax.*;
/**
@@ -61,7 +62,8 @@ public class MetadataRepositoryIO {
try {
bufferedInput = new BufferedInputStream(input);
- Parser repositoryParser = new Parser(Activator.getContext(), Activator.ID);
+ Parser repositoryParser = new Parser(
+ FrameworkUtil.getBundle(MetadataRepositoryIO.class).getBundleContext(), Constants.ID);
repositoryParser.setErrorContext(location.toExternalForm());
repositoryParser.parse(input, monitor);
IStatus result = repositoryParser.getStatus();
@@ -81,7 +83,7 @@ public class MetadataRepositoryIO {
}
} catch (IOException ioe) {
String msg = NLS.bind(Messages.io_failedRead, location);
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, ioe));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, ioe));
}
}
@@ -100,15 +102,15 @@ public class MetadataRepositoryIO {
// Constants defining the structure of the XML for a MetadataRepository
// A format version number for metadata repository XML.
- public static final Version COMPATIBLE_VERSION = Version.createOSGi(1, 0, 0);
- public static final Version CURRENT_VERSION = Version.createOSGi(1, 2, 0);
- public static final VersionRange XML_TOLERANCE = new VersionRange(COMPATIBLE_VERSION, true, Version.createOSGi(2, 0, 0), false);
+ Version COMPATIBLE_VERSION = Version.createOSGi(1, 0, 0);
+ Version CURRENT_VERSION = Version.createOSGi(1, 2, 0);
+ VersionRange XML_TOLERANCE = new VersionRange(COMPATIBLE_VERSION, true, Version.createOSGi(2, 0, 0), false);
// Constants for processing Instructions
- public static final String PI_REPOSITORY_TARGET = "metadataRepository"; //$NON-NLS-1$
+ String PI_REPOSITORY_TARGET = "metadataRepository"; //$NON-NLS-1$
// Constants for metadata repository elements
- public static final String REPOSITORY_ELEMENT = "repository"; //$NON-NLS-1$
+ String REPOSITORY_ELEMENT = "repository"; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java
index 3c9fb3e27..35c05e344 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java
@@ -65,7 +65,7 @@ public class MetadataRepositoryManager extends AbstractRepositoryManager<IInstal
@Override
protected String getBundleId() {
- return Activator.ID;
+ return Constants.ID;
}
@Override
@@ -79,7 +79,7 @@ public class MetadataRepositoryManager extends AbstractRepositoryManager<IInstal
@Override
protected String getRepositoryProviderExtensionPointId() {
- return Activator.REPO_PROVIDER_XPT;
+ return Constants.REPO_PROVIDER_XPT;
}
@Override
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/SimpleMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/SimpleMetadataRepositoryFactory.java
index 58760f910..387cd39f5 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/SimpleMetadataRepositoryFactory.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/SimpleMetadataRepositoryFactory.java
@@ -60,7 +60,7 @@ public class SimpleMetadataRepositoryFactory extends MetadataRepositoryFactory {
if (localFile.exists())
return localFile;
String msg = NLS.bind(Messages.io_failedRead, location);
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null));
}
// file is not local, create a cache of the repository metadata
CacheManager cache = getAgent().getService(CacheManager.class);
@@ -71,7 +71,7 @@ public class SimpleMetadataRepositoryFactory extends MetadataRepositoryFactory {
// there is no remote file in either form - this should not really happen as
// createCache should bail out with exception if something is wrong. This is an internal
// error.
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, Messages.repoMan_internalError, null));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_NOT_FOUND, Messages.repoMan_internalError, null));
}
return localFile;
}
@@ -123,10 +123,10 @@ public class SimpleMetadataRepositoryFactory extends MetadataRepositoryFactory {
}
} catch (FileNotFoundException e) {
String msg = NLS.bind(Messages.io_failedRead, location);
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, e));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, e));
} catch (IOException e) {
String msg = NLS.bind(Messages.io_failedRead, location);
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, e));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, e));
} finally {
if (monitor != null)
monitor.done();
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/XZedSimpleMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/XZedSimpleMetadataRepositoryFactory.java
index 1e8ae4de9..eac9824bf 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/XZedSimpleMetadataRepositoryFactory.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/XZedSimpleMetadataRepositoryFactory.java
@@ -51,7 +51,7 @@ public class XZedSimpleMetadataRepositoryFactory extends MetadataRepositoryFacto
if (localFile.exists())
return localFile;
String msg = NLS.bind(Messages.io_failedRead, location);
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null));
}
// file is not local, create a cache of the repository metadata
CacheManager cache = getAgent().getService(CacheManager.class);
@@ -62,7 +62,7 @@ public class XZedSimpleMetadataRepositoryFactory extends MetadataRepositoryFacto
// there is no remote file in either form - this should not really happen as
// createCache should bail out with exception if something is wrong. This is an internal
// error.
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, Messages.repoMan_internalError, null));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_NOT_FOUND, Messages.repoMan_internalError, null));
}
return localFile;
}
@@ -101,10 +101,10 @@ public class XZedSimpleMetadataRepositoryFactory extends MetadataRepositoryFacto
}
} catch (FileNotFoundException e) {
String msg = NLS.bind(Messages.io_failedRead, location);
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, e));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, e));
} catch (IOException e) {
String msg = NLS.bind(Messages.io_failedRead, location);
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, e));
+ throw new ProvisionException(new Status(IStatus.ERROR, Constants.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, e));
} finally {
if (monitor != null)
monitor.done();
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java
index 09cd7531e..bb0ebce75 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java
@@ -21,7 +21,7 @@ import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.metadata.RequiredCapability;
import org.eclipse.equinox.internal.p2.metadata.RequiredPropertiesMatch;
-import org.eclipse.equinox.internal.p2.metadata.repository.Activator;
+import org.eclipse.equinox.internal.p2.metadata.repository.Constants;
import org.eclipse.equinox.internal.p2.persistence.XMLWriter;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.expression.*;
@@ -422,7 +422,7 @@ public class MetadataWriter extends XMLWriter implements XMLConstants {
}
}
} catch (IllegalStateException ise) {
- LogHelper.log(new Status(IStatus.INFO, Activator.ID, "Error writing the copyright URL: " + copyright.getLocation())); //$NON-NLS-1$
+ LogHelper.log(new Status(IStatus.INFO, Constants.ID, "Error writing the copyright URL: " + copyright.getLocation())); //$NON-NLS-1$
}
cdata(copyright.getBody(), true);
end(COPYRIGHT_ELEMENT);

Back to the top