osgi / bugzilla-archive

Archive of OSGi Alliance Specification Bugzilla bugs. The Specification Bugzilla system was decommissioned with the move to GitHub. The issues in this repository are imported from the Specification Bugzilla system for archival purposes.
0 stars 1 forks source link

[log] ServiceEvent mapping for LogEntry could result in null bundle? #2981

Closed bjhargrave closed 5 years ago

bjhargrave commented 5 years ago

Original bug ID: BZ#3113 From: @tjwatson Reported version: R7

bjhargrave commented 5 years ago

Comment author: @tjwatson

https://osgi.org/hudson/job/build.cmpn/1210/artifact/osgi.specs/generated/html/cmpn/service.log.html#d0e2986

ServiceEvents are fired by the framework while not holding any locks. So when the log implementation gets the ServiceEvent to map to a LogEntry it will attempt to get the Bundle object for the LogEntry by calling BundleEvent.getServiceReference().getBundle(). But ServiceReference.getBundle() returns null if the service is unregistered. So if another thread unregisters the event before the Bundle is saved from the Service event then the LogEntry.getBundle() may end up being null. But the LogEntry doc does allow null from getBundle().

bjhargrave commented 5 years ago

Comment author: @tjwatson

Looks like the javadoc for LogEntry.getBundle does allow null to be returned.