|
24 | 24 | import org.eclipse.equinox.p2.engine.IProfileRegistry; |
25 | 25 | import org.eclipse.equinox.p2.metadata.IInstallableUnit; |
26 | 26 | import org.eclipse.equinox.p2.query.QueryUtil; |
27 | | -import org.eclipse.osgi.service.resolver.BundleDescription; |
28 | | -import org.eclipse.osgi.service.resolver.PlatformAdmin; |
29 | | -import org.eclipse.osgi.service.resolver.State; |
30 | 27 | import org.eclipse.osgi.util.NLS; |
31 | 28 | import org.eclipse.ui.about.ISystemSummarySection; |
32 | 29 | import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; |
| 30 | +import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; |
| 31 | +import org.osgi.framework.Bundle; |
| 32 | +import org.osgi.framework.BundleContext; |
33 | 33 |
|
34 | 34 | /** |
35 | 35 | * Writes information about the update configurer into the system summary. |
@@ -73,26 +73,24 @@ private void writeInstalledIUs(PrintWriter writer) { |
73 | 73 | * Query OSGi and print out the list of known bundles. |
74 | 74 | */ |
75 | 75 | private void writeBundles(PrintWriter writer) { |
76 | | - ServiceCaller.callOnce(getClass(), PlatformAdmin.class, (admin) -> { |
77 | | - State state = admin.getState(false); |
78 | | - // Since this code is only called in the Help -> About -> Configuration Details case we |
79 | | - // won't worry too much about performance here and we will sort the query results |
80 | | - // afterwards, but before printing them out. |
81 | | - SortedSet<String> sorted = new TreeSet<>(); |
82 | | - for (BundleDescription bundle : state.getBundles()) { |
83 | | - String name = bundle.getName(); |
84 | | - if (name == null) |
85 | | - name = bundle.getLocation(); |
86 | | - String message = NLS.bind(IDEWorkbenchMessages.ConfigurationLogUpdateSection_bundle, new Object[] {name, bundle.getVersion(), bundle.getLocation()}); |
87 | | - sorted.add(message); |
88 | | - } |
89 | | - if (!sorted.isEmpty()) { |
90 | | - writer.println(IDEWorkbenchMessages.ConfigurationLogUpdateSection_bundleHeader); |
91 | | - writer.println(); |
92 | | - for (String string : sorted) |
93 | | - writer.println(string); |
94 | | - } |
95 | | - }); |
| 76 | + BundleContext bundleContext = IDEWorkbenchPlugin.getDefault().getBundle().getBundleContext(); |
| 77 | + // Since this code is only called in the Help -> About -> Configuration Details case we |
| 78 | + // won't worry too much about performance here and we will sort the query results |
| 79 | + // afterwards, but before printing them out. |
| 80 | + SortedSet<String> sorted = new TreeSet<>(); |
| 81 | + for (Bundle bundle : bundleContext.getBundles()) { |
| 82 | + String name = bundle.getSymbolicName(); |
| 83 | + if (name == null) |
| 84 | + name = bundle.getLocation(); |
| 85 | + String message = NLS.bind(IDEWorkbenchMessages.ConfigurationLogUpdateSection_bundle, new Object[] {name, bundle.getVersion(), bundle.getLocation()}); |
| 86 | + sorted.add(message); |
| 87 | + } |
| 88 | + if (!sorted.isEmpty()) { |
| 89 | + writer.println(IDEWorkbenchMessages.ConfigurationLogUpdateSection_bundleHeader); |
| 90 | + writer.println(); |
| 91 | + for (String string : sorted) |
| 92 | + writer.println(string); |
| 93 | + } |
96 | 94 | } |
97 | 95 |
|
98 | 96 | @Override |
|
0 commit comments