Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 570280

Summary: Equinox console is still required via ConsoleManager
Product: [Eclipse Project] Equinox Reporter: Lars Vogel <Lars.Vogel>
Component: FrameworkAssignee: equinox.framework-inbox <equinox.framework-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: alex.blewitt, Lars.Vogel, tjwatson
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=371101
Whiteboard:

Description Lars Vogel CLA 2021-01-12 05:59:55 EST
IIRC we deprecated the org.eclipse.equinox.console a while ago, but OSGi still contains code which try to start this plug-in throws an exception if this bundle is not available.

Is this code still required?


From /org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/ConsoleManager.java line 52

@SuppressWarnings("deprecation")
	public void checkForConsoleBundle() throws BundleException {
		if ("none".equals(consolePort)) //$NON-NLS-1$
			return;
		// otherwise we need to check for the equinox console bundle and start it
		ServiceReference<org.osgi.service.packageadmin.PackageAdmin> paRef = context.getServiceReference(org.osgi.service.packageadmin.PackageAdmin.class);
		org.osgi.service.packageadmin.PackageAdmin pa = paRef == null ? null : context.getService(paRef);
		Bundle[] consoles = pa.getBundles(consoleBundle, null);
		if (consoles == null || consoles.length == 0) {
			if (consolePort != null)
				throw new BundleException("Could not find bundle: " + consoleBundle, BundleException.UNSUPPORTED_OPERATION); //$NON-NLS-1$
			return;
		}
		try {
			consoles[0].start(Bundle.START_TRANSIENT);
		} catch (BundleException e) {
			throw new BundleException("Could not start bundle: " + consoleBundle, BundleException.UNSUPPORTED_OPERATION, e); //$NON-NLS-1$
		}
	}
Comment 1 Thomas Watson CLA 2021-01-12 10:10:20 EST
(In reply to Lars Vogel from comment #0)
> IIRC we deprecated the org.eclipse.equinox.console a while ago,
N
o we did not, we just replaced the actual console implementation with gogo.  The equinox.console bundle is still there to provide console commands to gogo that we have had from the start which are specific to equinox.  Things like the 'diag' command.

> but OSGi
> still contains code which try to start this plug-in throws an exception if
> this bundle is not available.
> 
> Is this code still required?

In its current state, yes.  This is what eagerly activates the console bundles based on of the -console option was used.
Comment 2 Lars Vogel CLA 2021-01-12 10:47:38 EST
Thanks, Tom for the info.