Skip to content
Commits on Source (3)
......@@ -9,4 +9,4 @@ heapdump.*
core.*
Snap.*
target/
.DS_Store
......@@ -14,7 +14,7 @@
<parent>
<artifactId>eclipse.platform.runtime</artifactId>
<groupId>eclipse.platform.runtime</groupId>
<version>4.11.0-SNAPSHOT</version>
<version>4.12.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.core</groupId>
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.core.expressions; singleton:=true
Bundle-Version: 3.6.300.qualifier
Bundle-Version: 3.6.400.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.core.internal.expressions.ExpressionPlugin
Bundle-Vendor: %providerName
......
......@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.runtime</artifactId>
<groupId>eclipse.platform.runtime</groupId>
<version>4.11.0-SNAPSHOT</version>
<version>4.12.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.expressions</artifactId>
<version>3.6.300-SNAPSHOT</version>
<version>3.6.400-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
......@@ -16,6 +16,9 @@ package org.eclipse.core.internal.expressions;
import org.eclipse.core.expressions.IPropertyTester;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
public class Property {
......@@ -57,8 +60,13 @@ public class Property {
}
}
public boolean test(Object receiver, Object[] args, Object expectedValue) {
public boolean test(Object receiver, Object[] args, Object expectedValue) throws CoreException {
try {
return fTester.test(receiver, fName, args, expectedValue);
} catch (Exception e) {
String message = "Error evaluating " + this; //$NON-NLS-1$
throw new CoreException(new Status(IStatus.ERROR, ExpressionPlugin.getPluginId(), message, e));
}
}
@Override
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.core.jobs; singleton:=true
Bundle-Version: 3.10.300.qualifier
Bundle-Version: 3.10.400.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.core.internal.jobs;x-internal:=true,
......
......@@ -15,12 +15,12 @@
<parent>
<artifactId>eclipse.platform.runtime</artifactId>
<groupId>eclipse.platform.runtime</groupId>
<version>4.11.0-SNAPSHOT</version>
<version>4.12.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.jobs</artifactId>
<version>3.10.300-SNAPSHOT</version>
<version>3.10.400-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<properties>
<code.ignoredWarnings>-warn:-deprecation,raw,unchecked</code.ignoredWarnings>
......
......@@ -14,6 +14,8 @@
*******************************************************************************/
package org.eclipse.core.internal.jobs;
import java.util.Objects;
public class Semaphore {
protected long notifications;
protected Runnable runnable;
......@@ -58,12 +60,18 @@ public class Semaphore {
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (!(obj instanceof Semaphore)) {
return false;
}
return (runnable == ((Semaphore) obj).runnable);
}
@Override
public int hashCode() {
return runnable == null ? 0 : runnable.hashCode();
return Objects.hashCode(runnable);
}
public synchronized void release() {
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.core.runtime" version="2">
<resource path="src/org/eclipse/core/runtime/ILibrary.java" type="org.eclipse.core.runtime.ILibrary">
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="403853384">
<resource path="META-INF/MANIFEST.MF">
<filter comment="Bug 475944 - Delete IPluginDescriptor and related API" id="923795461">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="3.15.200"/>
<message_argument value="3.15.100"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<filter comment="Planneddeletion" id="923795461">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="getContentFilters()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="getPackagePrefixes()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="getPath()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="getType()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="isExported()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="isFullyExported()"/>
<message_argument value="3.15.300"/>
<message_argument value="3.15.100"/>
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/core/runtime/IPluginDescriptor.java" type="org.eclipse.core.runtime.IPluginDescriptor">
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="403853384">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="find(IPath)"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="find(IPath, Map&lt;String,String&gt;)"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getExtension(String)"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getExtensionPoint(String)"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getExtensionPoints()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getExtensions()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<resource path="META-INF/MANIFEST.MF" type="org.eclipse.core.runtime.IPluginDescriptor">
<filter comment="Bug 475944 - Delete IPluginDescriptor and related API" id="305324134">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getInstallURL()"/>
<message_argument value="org.eclipse.core.runtime_3.15.200"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getLabel()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<filter comment="Planned deletion" id="305324134">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getPlugin()"/>
<message_argument value="org.eclipse.core.runtime_3.15.300"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getPluginClassLoader()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getPluginPrerequisites()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getProviderName()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
</resource>
<resource path="src/org/eclipse/core/runtime/ILibrary.java" type="org.eclipse.core.runtime.ILibrary">
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="403853384">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getResourceBundle()"/>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getResourceString(String)"/>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="getContentFilters()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getResourceString(String, ResourceBundle)"/>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="getPackagePrefixes()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getRuntimeLibraries()"/>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="getPath()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getUniqueIdentifier()"/>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="getType()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="getVersionIdentifier()"/>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="isExported()"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginDescriptor"/>
<message_argument value="isPluginActivated()"/>
<message_argument value="org.eclipse.core.runtime.ILibrary"/>
<message_argument value="isFullyExported()"/>
</message_arguments>
</filter>
</resource>
......@@ -237,6 +144,30 @@
<message_argument value="org.eclipse.core.runtime.IPluginRegistry"/>
</message_arguments>
</filter>
<filter comment="&#10;Bug 475944 - Delete IPluginDescriptor and related API" id="405901410">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginRegistry"/>
<message_argument value="getPluginDescriptor(String)"/>
</message_arguments>
</filter>
<filter comment="&#10;Bug 475944 - Delete IPluginDescriptor and related API" id="405901410">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginRegistry"/>
<message_argument value="getPluginDescriptor(String, PluginVersionIdentifier)"/>
</message_arguments>
</filter>
<filter comment="&#10;Bug 475944 - Delete IPluginDescriptor and related API" id="405901410">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginRegistry"/>
<message_argument value="getPluginDescriptors()"/>
</message_arguments>
</filter>
<filter comment="&#10;Bug 475944 - Delete IPluginDescriptor and related API" id="405901410">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginRegistry"/>
<message_argument value="getPluginDescriptors(String)"/>
</message_arguments>
</filter>
<filter comment="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339" id="406052990">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.IPluginRegistry"/>
......@@ -310,4 +241,18 @@
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/core/runtime/Plugin.java" type="org.eclipse.core.runtime.Plugin">
<filter comment="Bug 475944 - Delete IPluginDescriptor and related API" id="338722907">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.Plugin"/>
<message_argument value="Plugin(IPluginDescriptor)"/>
</message_arguments>
</filter>
<filter comment="Bug 475944 - Delete IPluginDescriptor and related API" id="338792546">
<message_arguments>
<message_argument value="org.eclipse.core.runtime.Plugin"/>
<message_argument value="getDescriptor()"/>
</message_arguments>
</filter>
</resource>
</component>
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Version: 3.15.200.qualifier
Bundle-Version: 3.15.300.qualifier
Bundle-SymbolicName: org.eclipse.core.runtime; singleton:=true
Bundle-Vendor: %providerName
Bundle-Activator: org.eclipse.core.internal.runtime.PlatformActivator
......
# To force a version qualifier update add the bug here
Bug 403352 - Update all parent versions to match our build stream
Bug 493109: Build failed due to qualifier heuristics on core.runtime.feature
Bug 547066 - IBuild I20190507-1800 failed due to unresolved project dependencies.
......@@ -14,12 +14,12 @@
<parent>
<artifactId>eclipse.platform.runtime</artifactId>
<groupId>eclipse.platform.runtime</groupId>
<version>4.11.0-SNAPSHOT</version>
<version>4.12.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.runtime</artifactId>
<version>3.15.200-SNAPSHOT</version>
<version>3.15.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
......
......@@ -30,13 +30,17 @@ import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.equinox.internal.app.*;
import org.eclipse.equinox.internal.app.Activator;
import org.eclipse.equinox.log.*;
import org.eclipse.osgi.container.ModuleContainer;
import org.eclipse.osgi.framework.log.FrameworkLog;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.service.debug.DebugOptions;
import org.eclipse.osgi.service.environment.EnvironmentInfo;
import org.eclipse.osgi.service.resolver.PlatformAdmin;
import org.osgi.framework.*;
import org.osgi.service.packageadmin.PackageAdmin;
import org.osgi.framework.namespace.HostNamespace;
import org.osgi.framework.namespace.IdentityNamespace;
import org.osgi.framework.wiring.*;
import org.osgi.resource.Namespace;
import org.osgi.util.tracker.ServiceTracker;
/**
......@@ -45,7 +49,7 @@ import org.osgi.util.tracker.ServiceTracker;
*/
public final class InternalPlatform {
private static final String[] ARCH_LIST = { Platform.ARCH_X86 };
private static final String[] ARCH_LIST = { Platform.ARCH_X86, Platform.ARCH_X86_64 };
// debug support: set in loadOptions()
public static boolean DEBUG = false;
......@@ -88,6 +92,7 @@ public final class InternalPlatform {
private Path cachedInstanceLocation; // Cache the path of the instance location
private ServiceTracker<Location,Location> configurationLocation = null;
private BundleContext context;
private FrameworkWiring fwkWiring;
private Map<IBundleGroupProvider,ServiceRegistration<IBundleGroupProvider>> groupProviders = new HashMap<>(3);
private ServiceTracker<Location,Location> installLocation = null;
......@@ -101,7 +106,7 @@ public final class InternalPlatform {
private ServiceTracker<EnvironmentInfo,EnvironmentInfo> environmentTracker = null;
private ServiceTracker<FrameworkLog,FrameworkLog> logTracker = null;
private ServiceTracker<PackageAdmin,PackageAdmin> bundleTracker = null;
private ServiceTracker<PlatformAdmin, PlatformAdmin> platformTracker = null;
private ServiceTracker<DebugOptions,DebugOptions> debugTracker = null;
private ServiceTracker<IContentTypeManager,IContentTypeManager> contentTracker = null;
private ServiceTracker<IPreferencesService,IPreferencesService> preferencesTracker = null;
......@@ -172,22 +177,6 @@ public final class InternalPlatform {
return value.equalsIgnoreCase("true"); //$NON-NLS-1$
}
public Bundle getBundle(String symbolicName) {
PackageAdmin packageAdmin = getBundleAdmin();
if (packageAdmin == null)
return null;
Bundle[] bundles = packageAdmin.getBundles(symbolicName, null);
if (bundles == null)
return null;
//Return the first bundle that is not installed or uninstalled
for (Bundle bundle : bundles) {
if ((bundle.getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) {
return bundle;
}
}
return null;
}
public BundleContext getBundleContext() {
return context;
}
......@@ -231,31 +220,42 @@ public final class InternalPlatform {
registration.unregister();
}
public Bundle[] getBundles(String symbolicName, String version) {
PackageAdmin packageAdmin = getBundleAdmin();
if (packageAdmin == null)
return null;
Bundle[] bundles = packageAdmin.getBundles(symbolicName, version);
if (bundles == null)
public Bundle getBundle(String symbolicName) {
Bundle[] bundles = getBundles(symbolicName, null);
return bundles != null && bundles.length > 0 ? bundles[0] : null;
}
public Bundle[] getBundles(String symbolicName, String versionRange) {
Map<String, String> directives = Collections.singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE,
getRequirementFilter(symbolicName, versionRange));
Collection<BundleCapability> matchingBundleCapabilities = fwkWiring.findProviders(ModuleContainer
.createRequirement(IdentityNamespace.IDENTITY_NAMESPACE, directives, Collections.emptyMap()));
if (matchingBundleCapabilities.isEmpty()) {
return null;
// optimize for common case; length==1
if (bundles.length == 1 && (bundles[0].getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0)
return bundles;
}
Bundle[] results = matchingBundleCapabilities.stream().map(c -> c.getRevision().getBundle())
// Remove all the bundles that are installed or uninstalled
Bundle[] selectedBundles = new Bundle[bundles.length];
int added = 0;
for (Bundle bundle : bundles) {
if ((bundle.getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) {
selectedBundles[added++] = bundle;
.filter(bundle -> (bundle.getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0)
.sorted((b1, b2) -> b2.getVersion().compareTo(b1.getVersion())) // highest version first
.toArray(Bundle[]::new);
return results.length > 0 ? results : null;
}
private String getRequirementFilter(String symbolicName, String versionRange) {
VersionRange range = versionRange == null ? null : new VersionRange(versionRange);
StringBuilder filter = new StringBuilder();
if (range != null) {
filter.append("(&"); //$NON-NLS-1$
}
if (added == 0)
return null;
filter.append('(').append(IdentityNamespace.IDENTITY_NAMESPACE).append('=').append(symbolicName).append(')');
//return an array of the correct size
Bundle[] results = new Bundle[added];
System.arraycopy(selectedBundles, 0, results, 0, added);
return results;
if (range != null) {
filter.append(range.toFilterString(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE)).append(')');
}
return filter.toString();
}
public String[] getCommandLineArgs() {
......@@ -278,22 +278,38 @@ public final class InternalPlatform {
return environmentTracker == null ? null : (EnvironmentInfo) environmentTracker.getService();
}
public FrameworkLog getFrameworkLog() {
return logTracker == null ? null : (FrameworkLog) logTracker.getService();
}
public Bundle[] getFragments(Bundle bundle) {
PackageAdmin packageAdmin = getBundleAdmin();
if (packageAdmin == null)
BundleWiring wiring = bundle.adapt(BundleWiring.class);
if (wiring == null) {
return null;
return packageAdmin.getFragments(bundle);
}
public FrameworkLog getFrameworkLog() {
return logTracker == null ? null : (FrameworkLog) logTracker.getService();
List<BundleWire> hostWires = wiring.getProvidedWires(HostNamespace.HOST_NAMESPACE);
if (hostWires == null) {
// we don't hold locks while checking the graph, just return if no longer valid
return null;
}
Bundle[] result = hostWires.stream().map(wire -> wire.getRequirer().getBundle()).filter(Objects::nonNull)
.toArray(Bundle[]::new);
return result.length > 0 ? result : null;
}
public Bundle[] getHosts(Bundle bundle) {
PackageAdmin packageAdmin = getBundleAdmin();
if (packageAdmin == null)
BundleWiring wiring = bundle.adapt(BundleWiring.class);
if (wiring == null) {
return null;
}
List<BundleWire> hostWires = wiring.getRequiredWires(HostNamespace.HOST_NAMESPACE);
if (hostWires == null) {
// we don't hold locks while checking the graph, just return if no longer valid
return null;
return packageAdmin.getHosts(bundle);
}
Bundle[] result = hostWires.stream().map(wire -> wire.getProvider().getBundle()).filter(Objects::nonNull)
.toArray(Bundle[]::new);
return result.length > 0 ? result : null;
}
public Location getInstallLocation() {
......@@ -395,12 +411,7 @@ public final class InternalPlatform {
}
public PlatformAdmin getPlatformAdmin() {
if (context == null)
return null;
ServiceReference<PlatformAdmin> platformAdminReference = context.getServiceReference(PlatformAdmin.class);
if (platformAdminReference == null)
return null;
return context.getService(platformAdminReference);
return platformTracker == null ? null : platformTracker.getService();
}
//TODO I guess it is now time to get rid of that
......@@ -572,10 +583,13 @@ public final class InternalPlatform {
}
public boolean isFragment(Bundle bundle) {
PackageAdmin packageAdmin = getBundleAdmin();
if (packageAdmin == null)
BundleRevisions bundleRevisions = bundle.adapt(BundleRevisions.class);
List<BundleRevision> revisions = bundleRevisions.getRevisions();
if (revisions.isEmpty()) {
// bundle is uninstalled and not current users; just return false
return false;
return (packageAdmin.getBundleType(bundle) & PackageAdmin.BUNDLE_TYPE_FRAGMENT) > 0;
}
return (revisions.get(0).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0;
}
/*
......@@ -695,6 +709,7 @@ public final class InternalPlatform {
*/
public void start(BundleContext runtimeContext) {
this.context = runtimeContext;
this.fwkWiring = runtimeContext.getBundle(Constants.SYSTEM_BUNDLE_LOCATION).adapt(FrameworkWiring.class);
openOSGiTrackers();
splashEnded = false;
processCommandLine(getEnvironmentInfoService().getNonFrameworkArgs());
......@@ -768,8 +783,8 @@ public final class InternalPlatform {
}
if (context != null) {
bundleTracker = new ServiceTracker<>(context, PackageAdmin.class, null);
bundleTracker.open();
platformTracker = new ServiceTracker<>(context, PlatformAdmin.class, null);
platformTracker.open();
}
if (context != null) {
......@@ -822,10 +837,6 @@ public final class InternalPlatform {
}
}
private PackageAdmin getBundleAdmin() {
return bundleTracker == null ? null : bundleTracker.getService();
}
private DebugOptions getDebugOptions() {
return debugTracker == null ? null : debugTracker.getService();
}
......@@ -843,9 +854,9 @@ public final class InternalPlatform {
debugTracker.close();
debugTracker = null;
}
if (bundleTracker != null) {
bundleTracker.close();
bundleTracker = null;
if (platformTracker != null) {
platformTracker.close();
platformTracker = null;
}
if (logTracker != null) {
logTracker.close();
......
......@@ -27,7 +27,6 @@ import org.osgi.framework.Constants;
* <code>CODE</code> and <code>RESOURCE</code>.
* </p>
*
* @see IPluginDescriptor#getRuntimeLibraries()
* @deprecated In Eclipse 3.0 the plug-in classpath representation was changed.
* Clients of <code>ILibrary</code> are directed to the headers
* associated with the relevant bundle. In particular, the
......@@ -56,10 +55,6 @@ import org.osgi.framework.Constants;
* entries. This information is no longer relevant.
* </p>
* <p>
* See {@link IPluginDescriptor} for information on the relationship
* between plug-in descriptors and bundles.
* </p>
* <p>
* This interface must only be used by plug-ins which explicitly
* require the org.eclipse.core.runtime.compatibility plug-in.
* </p>
......@@ -110,7 +105,6 @@ public interface ILibrary {
* installation location.
*
* @return the path of the library
* @see IPluginDescriptor#getInstallURL()
* @deprecated
* Given a manifest element corresponding to a classpath entry, the path
* for the entry can be accessed by getting the value of the manifest element.
......
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
* Lars Vogel <Lars.Vogel@vogella.com> - Bug 478773
*******************************************************************************/
package org.eclipse.core.runtime;
import java.net.URL;
import java.util.*;
/**
* This interface was only support by plug-ins which explicitly require the
* org.eclipse.core.runtime.compatibility plug-in.
* <p>
* It is not used anymore as Eclipse 4.6 removed this plug-in.
* </p>
*
* @noextend This interface is not intended to be extended by clients.
* @noreference This interface is not intended to be referenced by clients.
* @noimplement This interface is not intended to be implemented by clients.
*
* This interface is planned to be deleted, see
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=544339
*
*/
@Deprecated
public interface IPluginDescriptor {
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public IExtension getExtension(String extensionName);
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public IExtensionPoint getExtensionPoint(String extensionPointId);
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public IExtensionPoint[] getExtensionPoints();
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public IExtension[] getExtensions();
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public URL getInstallURL();
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public String getLabel();
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public Plugin getPlugin() throws CoreException;
/**
* Not supported anymore as Eclipse 4.6
* @deprecated
* Use
* <pre>
* bundle.loadClass(className)
* </pre>
* where <code>bundle</code> is the bundle associated with
* the relevant plug-in.
*/
@Deprecated
public ClassLoader getPluginClassLoader();
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public IPluginPrerequisite[] getPluginPrerequisites();
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public String getProviderName();
/**
* Not supported anymore as Eclipse 4.6
* @deprecated
* Use
* <pre>
* Platform.getResourceBundle(bundle)
* </pre>
* where <code>bundle</code> is the bundle associated with
* the relevant plug-in.
*/
@Deprecated
public ResourceBundle getResourceBundle() throws MissingResourceException;
/**
* Not supported anymore as Eclipse 4.6
* @deprecated
* Use
* <pre>
* Platform.getResourceString(bundle, value)
* </pre>
* where <code>bundle</code> is the bundle associated with
* the relevant plug-in.
*/
@Deprecated
public String getResourceString(String value);
/**
* Not supported anymore as Eclipse 4.6
* @deprecated
* Use
* <pre>
* Platform.getResourceString(bundle, value, resourceBundle)
* </pre>
* where <code>bundle</code> is the bundle associated with
* the relevant plug-in.
*/
@Deprecated
public String getResourceString(String value, ResourceBundle resourceBundle);
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public ILibrary[] getRuntimeLibraries();
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public String getUniqueIdentifier();
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public PluginVersionIdentifier getVersionIdentifier();
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public boolean isPluginActivated();
/**
* Not supported anymore as Eclipse 4.6
*/
@Deprecated
public URL find(IPath path);
/**
* Not supported anymore as Eclipse 4.6
* @deprecated
* Use
* <pre>
* Platform.find(bundle, path, override)
* </pre>
* where <code>bundle</code> is the bundle associated with
* the relevant plug-in.
*/
@Deprecated
public URL find(IPath path, Map<String,String> override);
}
......@@ -22,7 +22,6 @@ import org.osgi.framework.Constants;
* classes defined by the prerequisite plug-in to be visible
* to the plug-in that declared the dependency.
*
* @see IPluginDescriptor#getPluginPrerequisites()
* @deprecated
* In Eclipse 3.0 the plug-in prerequisite representation was changed. Clients of
* <code>IPluginPrerequisite</code> are directed to the headers associated with the relevant bundle.
......@@ -41,9 +40,6 @@ import org.osgi.framework.Constants;
* ...
* </pre>
* <p>
* See {@link IPluginDescriptor} for information on the relationship between plug-in
* descriptors and bundles.
* </p><p>
* This interface must only be used by plug-ins
* which explicitly require the org.eclipse.core.runtime.compatibility plug-in.
* </p>
......
......@@ -99,42 +99,5 @@ public interface IPluginRegistry {
@Deprecated
public IExtensionPoint[] getExtensionPoints();
/**
* Returns the plug-in descriptor with the given plug-in identifier
* in this plug-in registry, or <code>null</code> if there is no such
* plug-in. If there are multiple versions of the identified plug-in,
* one will be non-deterministically chosen and returned.
*
* @param pluginId the unique identifier of the plug-in
* (e.g. <code>"com.example.acme"</code>).
* @return the plug-in descriptor, or <code>null</code>
* @deprecated
* <code>IPluginDescriptor</code> was refactored in Eclipse 3.0.
* The <code>getPluginDescriptor()</code> method may only be called by plug-ins
* which explicitly require the org.eclipse.core.runtime.compatibility plug-in.
* See the comments on {@link IPluginDescriptor} and its methods for details.
*/
@Deprecated
public IPluginDescriptor getPluginDescriptor(String pluginId);
/**
* As the org.eclipse.core.runtime.compatibility plug-in has been removed in
* Eclipse 4.6 this method is not supported anymore.
*/
@Deprecated
public IPluginDescriptor getPluginDescriptor(String pluginId, PluginVersionIdentifier version);
/**
* As the org.eclipse.core.runtime.compatibility plug-in has been removed in
* Eclipse 4.6 this method is not supported anymore.
*/
@Deprecated
public IPluginDescriptor[] getPluginDescriptors();
/**
* As the org.eclipse.core.runtime.compatibility plug-in has been removed in
* Eclipse 4.6 this method is not supported anymore.
*/
@Deprecated
public IPluginDescriptor[] getPluginDescriptors(String pluginId);
}
......@@ -386,11 +386,8 @@ public class PerformanceStats {
if (!(obj instanceof PerformanceStats))
return false;
PerformanceStats that = (PerformanceStats) obj;
if (!this.event.equals(that.event))
return false;
if (!this.getBlameString().equals(that.getBlameString()))
return false;
return this.context == null ? that.context == null : this.context.equals(that.context);
return this.event.equals(that.event) && this.getBlameString().equals(that.getBlameString())
&& Objects.equals(this.context, that.context);
}
/**
......
......@@ -104,18 +104,6 @@ import org.osgi.util.tracker.ServiceTracker;
* life cycle methods.
* </p>
* <p>
* The {@link #Plugin(IPluginDescriptor)} constructor was called only for
* plug-ins which explicitly require the org.eclipse.core.runtime.compatibility
* plug-in. It is not called anymore as Eclipse 4.6 removed this plug-in.
*
* </p>
* <p>
* If the plugin.xml of your plug-in does <b>not</b> indicate &lt;?eclipse
* version="3.0"?&gt; it is therefore not a 3.0 plug-in. Consequently the
* {@link #Plugin(IPluginDescriptor)} is used and {@link #startup()} and
* {@link #shutdown()} are called as life cycle methods.
* </p>
* <p>
* Since Eclipse 3.0 APIs of the Plugin class can be called only when the Plugin
* is in an active state, i.e., after it was started up and before it is
* shutdown. In particular, it means that Plugin APIs should not be called from
......@@ -205,25 +193,6 @@ public abstract class Plugin implements BundleActivator {
super();
}
/**
* As the org.eclipse.core.runtime.compatibility plug-in has been removed in
* Eclipse 4.6 this method is not supported anymore.
*
* In Eclipse 3.0 this constructor has been replaced by {@link #Plugin()}.
* Implementations of <code>MyPlugin(IPluginDescriptor descriptor)</code> should be changed to
* <code>MyPlugin()</code> and call <code>super()</code> instead of <code>super(descriptor)</code>.
*
* The <code>MyPlugin(IPluginDescriptor descriptor)</code> constructor was called only for plug-ins
* which explicitly require the org.eclipse.core.runtime.compatibility plug-in. It is not called anymore.
*
* @param descriptor Due to org.eclipse.core.runtime.compatibility plug-in removal it is ignored.
*
* @deprecated
*/
@Deprecated
public Plugin(IPluginDescriptor descriptor) {
// intentionally left empty
}
/**
* Returns a URL for the given path. Returns <code>null</code> if the URL
......@@ -257,24 +226,6 @@ public abstract class Plugin implements BundleActivator {
return FileLocator.find(getBundle(), path, override);
}
/**
* As the org.eclipse.core.runtime.compatibility plug-in has been removed in
* Eclipse 4.6 this method is not supported anymore.
*
* <code>IPluginDescriptor</code> was refactored in Eclipse 3.0.
*
* The <code>getDescriptor()</code> method was only be called by plug-ins
* which explicitly require the org.eclipse.core.runtime.compatibility
* plug-in. It is not called anymore.
*
* @return Always null.
*
* @deprecated
*/
@Deprecated
public final IPluginDescriptor getDescriptor() {
return null;
}
/**
* Returns the log for this plug-in. If no such log exists, one is created.
......