Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.service.resolver.State;
import org.eclipse.osgi.service.resolver.StateDelta;
import org.eclipse.osgi.service.resolver.StateObjectFactory;
import org.eclipse.osgi.util.ManifestElement;
import org.eclipse.osgi.util.NLS;
import org.eclipse.pde.core.plugin.IPluginModelBase;
Expand Down Expand Up @@ -111,16 +110,10 @@ public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current) {

private boolean fNoProfile;

protected static StateObjectFactory stateObjectFactory;

protected String fSystemBundle = IPDEBuildConstants.BUNDLE_OSGI;

static {
stateObjectFactory = BundleHelper.getPlatformAdmin().getFactory();
}

protected MinimalState(MinimalState state) {
this.fState = stateObjectFactory.createState(state.fState);
this.fState = BundleHelper.getPlatformAdmin().getFactory().createState(state.fState);
this.fState.setPlatformProperties(state.fState.getPlatformProperties());
this.fState.setResolver(BundleHelper.getPlatformAdmin().createResolver());
this.fId = state.fId;
Expand Down Expand Up @@ -213,8 +206,8 @@ public BundleDescription addBundle(Map<String, String> manifest, File bundleLoca
try {
// OSGi requires a dictionary over any map
Dictionary<String, String> dictionaryManifest = FrameworkUtil.asDictionary(manifest);
BundleDescription descriptor = stateObjectFactory.createBundleDescription(fState, dictionaryManifest,
bundleLocation.getAbsolutePath(), bundleId == -1 ? getNextId() : bundleId);
BundleDescription descriptor = BundleHelper.getPlatformAdmin().getFactory().createBundleDescription(fState,
dictionaryManifest, bundleLocation.getAbsolutePath(), bundleId == -1 ? getNextId() : bundleId);
// new bundle
if (bundleId == -1 || !fState.updateBundle(descriptor)) {
fState.addBundle(descriptor);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2016 IBM Corporation and others.
* Copyright (c) 2005, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -36,6 +36,7 @@
import org.eclipse.osgi.service.resolver.State;
import org.eclipse.pde.core.plugin.IPluginModelBase;
import org.eclipse.pde.core.target.LoadTargetDefinitionJob;
import org.eclipse.pde.internal.build.BundleHelper;
import org.eclipse.pde.internal.core.plugin.ExternalFragmentModel;
import org.eclipse.pde.internal.core.plugin.ExternalPluginModel;
import org.eclipse.pde.internal.core.plugin.ExternalPluginModelBase;
Expand Down Expand Up @@ -77,7 +78,7 @@ public PDEState(URI[] target, boolean addResolver, boolean removeDuplicates, IPr
}

private void createNewTargetState(boolean resolve, URI[] uris, IProgressMonitor monitor) {
fState = stateObjectFactory.createState(resolve);
fState = BundleHelper.getPlatformAdmin().getFactory().createState(resolve);
if (resolve) {
final String systemBSN = getSystemBundle();
Comparator<BaseDescription> policy = systemBundlesFirst(systemBSN)
Expand Down
Loading