Bug 416654: Ensure system bundle context servicesInUse field provisioned

There was a corner case where a hook would need to be notified before
the system bundle had used BundleContext.getService. This would result
in the system bundle context servicesInUse field not being initialized
when the hook notification occurred. The code would then NPE when
attempting to synchronize on the null servicesInUse value.

The change refactors the code to provision the servicesInUse field into
a method. The ServiceRegistry constructor then calls this method to
ensure the field is provisioned in the system bundle context before any
hooks are notified.

Signed-off-by: BJ Hargrave <hargrave@us.ibm.com>
2 files changed