Bug 529268 - Stop trying to acquire PluginConverter

This cleanups the generated build files from having multipe:

[eclipse.buildScript] The service Plugin converter could not be
acquired.

Change-Id: I4dc768a4112ae8e3a389eaf1e941d42e97e80974
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java
index 9f2d4f1..4b62d71 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java
@@ -16,8 +16,6 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 import org.eclipse.core.runtime.*;
-import org.eclipse.osgi.service.pluginconversion.PluginConversionException;
-import org.eclipse.osgi.service.pluginconversion.PluginConverter;
 import org.eclipse.osgi.service.resolver.*;
 import org.eclipse.osgi.service.resolver.VersionRange;
 import org.eclipse.osgi.util.ManifestElement;
@@ -81,10 +79,6 @@
 		return state.addBundle(toAdd);
 	}
 
-	private PluginConverter acquirePluginConverter() throws Exception {
-		return BundleHelper.getDefault().acquireService(PluginConverter.class);
-	}
-
 	//Add a bundle to the state, updating the version number 
 	public boolean addBundle(Dictionary<String, String> enhancedManifest, File bundleLocation) {
 		String oldVersion = updateVersionNumber(enhancedManifest);
@@ -300,7 +294,7 @@
 
 		//It is not a manifest, but a plugin or a fragment
 		if (manifestStream == null)
-			return convertPluginManifest(bundleLocation, true);
+			return null;
 
 		try {
 			Hashtable<String, String> result = new Hashtable<>();
@@ -329,18 +323,7 @@
 		if (BundleHelper.getManifestHeader(initialManifest, Constants.BUNDLE_SYMBOLICNAME) != null)
 			return true;
 
-		Dictionary<String, String> generatedManifest = convertPluginManifest(bundleLocation, false);
-		if (generatedManifest == null)
-			return false;
-
-		//merge manifests. The values from the generated manifest are added to the initial one. Values from the initial one are not deleted 
-		Enumeration<String> enumeration = generatedManifest.keys();
-		while (enumeration.hasMoreElements()) {
-			String key = enumeration.nextElement();
-			if (BundleHelper.getManifestHeader(initialManifest, key) == null)
-				initialManifest.put(key, generatedManifest.get(key));
-		}
-		return true;
+		return false;
 	}
 
 	private void enforceClasspath(Dictionary<String, String> manifest) {
@@ -368,31 +351,6 @@
 		return manifest;
 	}
 
-	private Dictionary<String, String> convertPluginManifest(File bundleLocation, boolean logConversionException) {
-		PluginConverter converter;
-		try {
-			converter = acquirePluginConverter();
-			Dictionary<String, String> manifest = converter.convertManifest(bundleLocation, false, null, false, null);
-			if (convertedManifests != null)
-				convertedManifests.add(manifest);
-			return manifest;
-		} catch (PluginConversionException convertException) {
-			if (bundleLocation.getName().equals(org.eclipse.pde.build.Constants.FEATURE_FILENAME_DESCRIPTOR))
-				return null;
-			if (!new File(bundleLocation, org.eclipse.pde.build.Constants.PLUGIN_FILENAME_DESCRIPTOR).exists() && !new File(bundleLocation, org.eclipse.pde.build.Constants.FRAGMENT_FILENAME_DESCRIPTOR).exists())
-				return null;
-			if (logConversionException) {
-				IStatus status = new Status(IStatus.WARNING, PI_PDEBUILD, 0, NLS.bind(Messages.exception_errorConverting, bundleLocation.getAbsolutePath()), convertException);
-				BundleHelper.getDefault().getLog().log(status);
-			}
-			return null;
-		} catch (Exception serviceException) {
-			IStatus status = new Status(IStatus.WARNING, PI_PDEBUILD, 0, NLS.bind(Messages.exception_cannotAcquireService, "Plugin converter"), serviceException); //$NON-NLS-1$
-			BundleHelper.getDefault().getLog().log(status);
-			return null;
-		}
-	}
-
 	public void addBundles(Collection<File> bundles) {
 		for (Iterator<File> iter = bundles.iterator(); iter.hasNext();) {
 			File bundle = iter.next();