Skip to content

Commit

Permalink
Restore check if a BundleComponent has explicitly declared its EE
Browse files Browse the repository at this point in the history
And assume no EE if that check is positive.

Fixes eclipse-pde#1386
  • Loading branch information
HannesWell committed Sep 5, 2024
1 parent 5bff9b3 commit cfe324d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private Map<String, String> loadWorkspaceBundleManifest(File bundleLocation, IRe
}

@SuppressWarnings("deprecation")
private boolean hasDeclaredRequiredEE(Map<String, String> manifest) {
public static boolean hasDeclaredRequiredEE(Map<String, String> manifest) {
if (manifest.containsKey(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT)) {
return true;
}
Expand Down

0 comments on commit cfe324d

Please sign in to comment.