diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java index 30363ae5c2..7caa4b7362 100644 --- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java +++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java @@ -75,6 +75,7 @@ import org.eclipse.pde.api.tools.internal.provisional.model.IApiTypeContainer; import org.eclipse.pde.api.tools.internal.util.SourceDefaultHandler; import org.eclipse.pde.api.tools.internal.util.Util; +import org.eclipse.pde.internal.core.MinimalState; import org.eclipse.pde.internal.core.TargetWeaver; import org.eclipse.pde.internal.core.util.ManifestUtils; import org.osgi.framework.Bundle; @@ -310,7 +311,9 @@ protected void init() throws CoreException { BundleDescription bundleDescription = getBundleDescription(manifest, fLocation, fBundleId); fSymbolicName = bundleDescription.getSymbolicName(); fVersion = bundleDescription.getVersion(); - fdeclaredRequiredEE = ManifestUtils.getRequiredExecutionEnvironments(bundleDescription).toArray(String[]::new); + fdeclaredRequiredEE = MinimalState.hasDeclaredRequiredEE(manifest) + ? ManifestUtils.getRequiredExecutionEnvironments(bundleDescription).toArray(String[]::new) + : new String[0]; setName(manifest.get(Constants.BUNDLE_NAME)); fBundleDescription = bundleDescription; } catch (BundleException e) { diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/MinimalState.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/MinimalState.java index 2b041619ef..6a0c0c00ed 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/MinimalState.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/MinimalState.java @@ -161,7 +161,7 @@ private Map loadWorkspaceBundleManifest(File bundleLocation, IRe } @SuppressWarnings("deprecation") - private boolean hasDeclaredRequiredEE(Map manifest) { + public static boolean hasDeclaredRequiredEE(Map manifest) { if (manifest.containsKey(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT)) { return true; }