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

Bug 325143

Summary: IllegalStateException unhandled by org.osgi.framework.BundleContext.ungetService(ServiceReference)
Product: [Tools] CDT Reporter: Kirk Beitz <kirk.beitz>
Component: cdt-debug-dsfAssignee: Project Inbox <cdt-debug-dsf-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: pawel.1.piech
Version: 7.0.1Flags: kirk.beitz: review?
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
catch IllegalStateException thrown by BundleContext.ungetService()
kirk.beitz: review?
log containing numerous IllegalStateException tracebacks from single run none

Description Kirk Beitz CLA 2010-09-13 13:53:13 EDT
Created attachment 178765 [details]
catch IllegalStateException thrown by BundleContext.ungetService()

recently, one time, upon quitting a debug-session, the error log collected a several "IllegalStateException" exceptions unhandled.  the log is will be attached.

in org.osgi.framework.BundleContext, the javadoc for ungetService() has two @throws tags, but the interface itself doesn't actually include the throws clauses.  i've submitted a suggestion to the osgi-dev mailing list to rectify this.

in the meantime, the attached patch catches the exception.

in org.eclipse.cdt.dsf.service.DsfServicesTracker, fListener is a service Listener that has a "catch" block in it's handler to deal with "RejectedExecutionException", and there's a comment that catching the throw is the same as not getting an exception for this unregister event.

the catch in the attachment is based upon the catch block in the cited instance.
Comment 1 Pawel Piech CLA 2010-09-14 00:13:23 EDT
Hi Kirk,
Could you still attach the full exception trace?
Thanks!
Comment 2 Kirk Beitz CLA 2010-09-14 00:36:47 EDT
Created attachment 178784 [details]
log containing numerous IllegalStateException tracebacks from single run