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

Bug 361808

Summary: [console] starting up with -console and then closing eclipse causes NPE
Product: [Eclipse Project] Equinox Reporter: Thomas Watson <tjwatson>
Component: ComponentsAssignee: Lazar Kirchev <l.kirchev>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.8.0 Juno   
Target Milestone: Juno M3   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Thomas Watson CLA 2011-10-24 10:17:13 EDT
I get the following NPE when starting with -console (no telnet port) and then shutting down the framework:

Root exception:
java.lang.NullPointerException
	at org.eclipse.equinox.console.telnet.TelnetCommand.removeCommandProcessor(TelnetCommand.java:183)
	at org.eclipse.equinox.console.command.adapter.Activator$ProcessorCustomizer.removedService(Activator.java:105)
	at org.eclipse.equinox.console.command.adapter.Activator$ProcessorCustomizer.removedService(Activator.java:1)
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1006)
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1)
	at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:352)
	at org.osgi.util.tracker.ServiceTracker.close(ServiceTracker.java:412)
	at org.eclipse.equinox.console.command.adapter.Activator.stop(Activator.java:316)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:771)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:764)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:510)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.suspend(AbstractBundle.java:566)
	at org.eclipse.osgi.framework.internal.core.Framework.suspendBundle(Framework.java:1207)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.decFWSL(StartLevelManager.java:592)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:257)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.shutdown(StartLevelManager.java:215)
	at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.suspend(InternalSystemBundle.java:284)
	at org.eclipse.osgi.framework.internal.core.Framework.shutdown(Framework.java:693)
	at org.eclipse.osgi.framework.internal.core.Framework.close(Framework.java:600)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.shutdown(EclipseStarter.java:398)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:198)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:624)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1431)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1407)
Comment 2 Thomas Watson CLA 2011-10-24 10:34:12 EDT
Thanks Lazar.  I confirmed it is fixed with the latest code.  When committing fixes to git it is helpful to use a commit comment that includes a bug number.  For example, you could have used the following for this fix:

Bug 361808 - [console] starting up with -console and then closing eclipse causes NPE
Comment 3 Thomas Watson CLA 2011-10-24 10:34:32 EDT
setting milestone correctly
Comment 4 Lazar Kirchev CLA 2011-10-24 11:11:17 EDT
(In reply to comment #2)
> Thanks Lazar.  I confirmed it is fixed with the latest code.  When committing
> fixes to git it is helpful to use a commit comment that includes a bug number. 
> For example, you could have used the following for this fix:
> 
> Bug 361808 - [console] starting up with -console and then closing eclipse
> causes NPE

Thanks Tom, you are right. I should have created a bug before the submit.