diff options
author | Alexander Kurtakov | 2020-01-30 19:16:08 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2020-02-03 12:38:02 +0000 |
commit | 6131dfddc9d0d849e610465154ce081bcc97178a (patch) | |
tree | 1bdc00bbeb6b26d9886291ceef562bcf79e0587d | |
parent | 76828191e86c6034d85e10d7680ed1813e27ff57 (diff) | |
download | rt.equinox.p2-6131dfddc9d0d849e610465154ce081bcc97178a.tar.gz rt.equinox.p2-6131dfddc9d0d849e610465154ce081bcc97178a.tar.xz rt.equinox.p2-6131dfddc9d0d849e610465154ce081bcc97178a.zip |
Check whether Bundle is fragment via osgi.wiring.
Use the deprecated PackageAdmin a bit less.
Change-Id: I6b162044608bcacab6f9daeb9503340a0925f722
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r-- | bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java index eb18ada88..579ca26e8 100644 --- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java +++ b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2018 IBM Corporation and others. + * Copyright (c) 2007, 2020 IBM Corporation and others. * All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which accompanies this distribution, @@ -361,7 +361,7 @@ class ConfigApplier { continue; if (current.getBundleId() == 0) continue; - if (packageAdminService.getBundleType(current) == PackageAdmin.BUNDLE_TYPE_FRAGMENT) + if (isFragment(current)) continue; if (SimpleConfiguratorConstants.TARGET_CONFIGURATOR_NAME.equals(current.getSymbolicName())) continue; @@ -375,6 +375,11 @@ class ConfigApplier { return toRefresh; } + private boolean isFragment(Bundle current) { + BundleRevision revision = current.adapt(BundleRevision.class); + return (revision != null) && ((revision.getTypes() & BundleRevision.TYPE_FRAGMENT) != 0); + } + private void refreshPackages(Bundle[] bundles, BundleContext context) { if (bundles.length == 0 || packageAdminService == null) return; @@ -428,7 +433,7 @@ class ConfigApplier { } if (bundle.getState() == Bundle.STARTING && (bundle == callingBundle || bundle == manipulatingContext.getBundle())) continue; - if (packageAdminService.getBundleType(bundle) == PackageAdmin.BUNDLE_TYPE_FRAGMENT) + if (isFragment(bundle)) continue; if (bundle.getBundleId() == 0) continue; |