Bug 578820 - Use new FileLocator.getBundleFileLocation(Bundle)

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>
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 655b135..5ad6e58 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 @@
 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 @@
  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 a640ea9..c3ecc7e 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 5b73611..8e16a04 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 @@
 		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 17bb919..73c3d22 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 @@
 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 aef35cb..8940851 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 4cd3e61..e09e8bc 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.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 @@
 		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;