diff options
author | Hannes Wellmann | 2022-03-14 19:54:05 +0000 |
---|---|---|
committer | Hannes Wellmann | 2022-03-15 21:55:59 +0000 |
commit | 23e53212405d35827302deb2913616b2a3e637eb (patch) | |
tree | 586679233c1e8e2781fe32cdf98ad54912fe63d6 | |
parent | d7e1f8c0ce622c316c8f0f48f28fce364ea745dd (diff) | |
download | rt.equinox.p2-master.tar.gz rt.equinox.p2-master.tar.xz rt.equinox.p2-master.zip |
Bug 578820 - Use new FileLocator.getBundleFileLocation(Bundle)HEADI20220316-1800I20220315-1800master
Change-Id: I520d37dfdd94bef1c35c1d73063490331613314b
Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/191925
Tested-by: Equinox Bot <equinox-bot@eclipse.org>
6 files changed, 13 insertions, 12 deletions
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.frameworkadmin.equinox/META-INF/MANIFEST.MF index 655b1355f..5ad6e58c5 100644 --- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.frameworkadmin.equinox/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.equinox.frameworkadmin.equinox;singleton:=true -Bundle-Version: 1.2.100.qualifier +Bundle-Version: 1.2.200.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Import-Package: org.eclipse.equinox.frameworkadmin;version="[2.0.0,3.0.0)", @@ -20,7 +20,7 @@ Import-Package: org.eclipse.equinox.frameworkadmin;version="[2.0.0,3.0.0)", org.osgi.util.tracker;version="1.3.0" Export-Package: org.eclipse.equinox.internal.frameworkadmin.equinox;x-friends:="org.eclipse.equinox.p2.publisher,org.eclipse.equinox.p2.publisher.eclipse,org.eclipse.equinox.simpleconfigurator.manipulator", org.eclipse.equinox.internal.frameworkadmin.equinox.utils;x-friends:="org.eclipse.equinox.p2.publisher.eclipse" -Require-Bundle: org.eclipse.equinox.common +Require-Bundle: org.eclipse.equinox.common;bundle-version="3.16.000" Bundle-RequiredExecutionEnvironment: JavaSE-11 Service-Component: OSGI-INF/fwadmin.xml Bundle-ActivationPolicy: lazy diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/pom.xml b/bundles/org.eclipse.equinox.frameworkadmin.equinox/pom.xml index a640ea94f..c3ecc7ec9 100644 --- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/pom.xml +++ b/bundles/org.eclipse.equinox.frameworkadmin.equinox/pom.xml @@ -9,6 +9,6 @@ </parent> <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.frameworkadmin.equinox</artifactId> - <version>1.2.100-SNAPSHOT</version> + <version>1.2.200-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java index 5b73611ae..8e16a04c8 100644 --- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java +++ b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java @@ -328,20 +328,19 @@ public class EquinoxManipulatorImpl implements Manipulator { BundleInfo[] bInfos = new BundleInfo[bundles.length]; for (int i = 0; i < bundles.length; i++) { // System.out.println("bundles[" + i + "]=" + bundles[i]); - try { + Optional<File> bundleFile = FileLocator.getBundleFileLocation(bundles[i]); + if (bundleFile.isPresent()) { if (bundles[i].getBundleId() == 0) // SystemBundle bInfos[i] = new BundleInfo(bundles[i].getSymbolicName(), bundles[i].getHeaders("").get(Constants.BUNDLE_VERSION), //$NON-NLS-1$ - FileLocator.getBundleFile(bundles[i]).getAbsoluteFile().toURI(), -1, true); + bundleFile.get().getAbsoluteFile().toURI(), -1, true); else { bInfos[i] = new BundleInfo(bundles[i].getSymbolicName(), bundles[i].getHeaders("").get(Constants.BUNDLE_VERSION), //$NON-NLS-1$ - FileLocator.getBundleFile(bundles[i]).getAbsoluteFile().toURI(), + bundleFile.get().getAbsoluteFile().toURI(), bundles[i].adapt(BundleStartLevel.class).getStartLevel(), bundles[i].adapt(BundleStartLevel.class).isPersistentlyStarted()); } - } catch (IOException e) { - e.printStackTrace(); } } configData.setBundles(bInfos); diff --git a/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF index 17bb91960..73c3d22e7 100644 --- a/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.equinox.p2.tests;singleton:=true -Bundle-Version: 1.8.600.qualifier +Bundle-Version: 1.8.700.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.equinox.p2.tests.TestActivator Bundle-Vendor: %providerName diff --git a/bundles/org.eclipse.equinox.p2.tests/pom.xml b/bundles/org.eclipse.equinox.p2.tests/pom.xml index aef35cbbf..894085114 100644 --- a/bundles/org.eclipse.equinox.p2.tests/pom.xml +++ b/bundles/org.eclipse.equinox.p2.tests/pom.xml @@ -16,7 +16,7 @@ <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.p2.tests</artifactId> - <version>1.8.600-SNAPSHOT</version> + <version>1.8.700-SNAPSHOT</version> <packaging>eclipse-test-plugin</packaging> <properties> diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java index 4cd3e61c3..e09e8bc4d 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java @@ -27,7 +27,9 @@ import org.eclipse.equinox.p2.publisher.eclipse.FeaturesAndBundlesPublisherAppli import org.eclipse.equinox.p2.publisher.eclipse.InstallPublisherApplication; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; -import org.eclipse.equinox.p2.tests.*; +import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; +import org.eclipse.equinox.p2.tests.StringBufferStream; +import org.eclipse.equinox.p2.tests.TestActivator; import org.eclipse.osgi.util.NLS; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; @@ -90,7 +92,7 @@ public class GeneratorTests extends AbstractProvisioningTest { for (int i = 0; i < limit; i++) { BundleContext context = TestActivator.getContext(); Bundle bundle = context.getBundle(i); - File bundleFile = FileLocator.getBundleFile(bundle); + File bundleFile = FileLocator.getBundleFileLocation(bundle).get(); if (!bundleFile.isFile()) { //only jars please ++limit; |