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

Bug 312691

Summary: ConsoleSession.getService method does not save the service registration properly
Product: [Eclipse Project] Equinox Reporter: Thomas Watson <tjwatson>
Component: FrameworkAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, darin.eclipse
Version: 3.6Flags: aniefer: review+
Target Milestone: 3.6 RC1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
patch none

Description Thomas Watson CLA 2010-05-12 15:07:26 EDT
In testing the patch in bug 312677 I found a bug in the ConsoleSession class in the framework.

The getService call has an incorrect null check against the sessionRegistration.  This prevents the ConsoleSession from ever saving the service registration.  As a result when the ConsoleSession is closed the service associated with the ConsoleSession is never unregistred.  If you open and close the osgi console several times you will see this by running the following command:

services (objectClass=*ConsoleSession)

This will list all the "dead" sessions that should have been unregisted.
Comment 1 Thomas Watson CLA 2010-05-12 15:09:42 EDT
Created attachment 168237 [details]
patch

Fixes the null check to correctly save the service registration.
Comment 2 Thomas Watson CLA 2010-05-12 15:10:19 EDT
Andrew please review.
Comment 3 Andrew Niefer CLA 2010-05-12 15:18:58 EDT
looks good.
Comment 4 Thomas Watson CLA 2010-05-12 15:21:13 EDT
Patch release for RC1.