Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 228131 Details for
Bug 297769
Split packages are not refreshed properly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch proposition
clipboard.txt (text/plain), 4.32 KB, created by
Krzysztof Daniel
on 2013-03-08 06:19:52 EST
(
hide
)
Description:
Patch proposition
Filename:
MIME Type:
Creator:
Krzysztof Daniel
Created:
2013-03-08 06:19:52 EST
Size:
4.32 KB
patch
obsolete
>From 2a1fc540a3ee5a813a732844b7a533fee858c12a Fri, 8 Mar 2013 12:18:44 +0100 >From: Krzysztof Daniel <kdaniel@redhat.com> >Date: Fri, 8 Mar 2013 12:18:22 +0100 >Subject: [PATCH] 297769: LinkageError while running tests from the dropins folder > > >When calculating bundles to refresh it is important to take split >packages into account and refresh all bundles that contribute to it. > >The split package detection logic is a bit hackish - for given package >iterate over all packages until there is a package with "mandatory" >keyword - which is the package responsible for gathering all the split >packages - and add it to refreshed bundles. >https://bugs.eclipse.org/bugs/show_bug.cgi?id=297769 >diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java >index b812956..d5e1dfe 100644 >--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java >+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java >@@ -53,6 +53,7 @@ > public class PackageAdminImpl implements PackageAdmin, FrameworkWiring { > /** framework object */ > protected Framework framework; >+ private ExportPackageDescription[] exportPackages2; > > /* > * We need to make sure that the GetBundleAction class loads early to prevent a ClassCircularityError when checking permissions. >@@ -221,13 +222,49 @@ > } else if (numBundles > 0) { > // populate the resolved hosts package sources first (do this outside sync block: bug 280929) > populateLoaders(framework.getAllBundles()); >+ List<AbstractBundle> allBundles = framework.bundles.getBundles(); > synchronized (framework.bundles) { > // now collect the descriptions to refresh > List<BundleDescription> results = new ArrayList<BundleDescription>(numBundles); > for (int i = 0; i < numBundles; i++) { > BundleDescription description = ((AbstractBundle) bundles[i]).getBundleDescription(); >- if (description != null && description.getBundleId() != 0 && !results.contains(description)) >+ if (description != null && description.getBundleId() != 0 && !results.contains(description)) { > results.add(description); >+ >+ // a bit hackish approach to refresh also split packages >+ // if (description.getBundle().getSymbolicName().equals("org.eclipse.core.runtime")) { >+ >+ // get the list of exported packages of the considered bundle >+ ExportPackageDescription[] exportPackages = description.getExportPackages(); >+ >+ for (int j = 0; j < exportPackages.length; j++) { >+ ExportPackageDescription examinedPackage = exportPackages[j]; >+ >+ // look which bundle not already added exports the same package >+ for (int z = 0; z < allBundles.size(); z++) { >+ AbstractBundle bundleThatMayProvideSplitPackage = allBundles.get(z); >+ // if the bundle was already added - don't bother with any checks and continue >+ if (results.contains(bundleThatMayProvideSplitPackage.getBundleDescription())) { >+ continue; >+ } >+ >+ // now check each package of the bundle that may provide split package >+ ExportPackageDescription[] potentiallySplitPackages = bundleThatMayProvideSplitPackage.getBundleDescription().getExportPackages(); >+ >+ for (int zz = 0; zz < potentiallySplitPackages.length; zz++) { >+ // so when package names match and one of them seems to be split (in the ugly way, with mandatory attribute) >+ // add the package with mandatory to refresh. >+ if (examinedPackage.getName().equals(potentiallySplitPackages[zz].getName()) && potentiallySplitPackages[zz].getDirectives().containsKey("mandatory")) { >+ results.add(bundleThatMayProvideSplitPackage.getBundleDescription()); >+ break; >+ } >+ } >+ >+ } >+ // } >+ } >+ >+ } > if (framework.isRefreshDuplicateBSNAllowed()) { > // add in any bundles that have the same symbolic name see bug (169593) > AbstractBundle[] sameNames = framework.bundles.getBundles(bundles[i].getSymbolicName()); >@@ -242,6 +279,7 @@ > } > } > } >+ > } > descriptions = (results.size() == 0 ? null : results.toArray(new BundleDescription[results.size()])); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 297769
:
154437
|
216027
| 228131 |
228305
|
228669