[
https://issues.apache.org/jira/browse/FELIX-4317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13825252#comment-13825252
]
Guillaume Nodet commented on FELIX-4317:
----------------------------------------
The use case I hit was that the framework threw an invalid component context
exception while logging an exception itself.
So this of course will not remove the fact that the bundle can be stopped at
any time, but it avoids exceptions which are not needed (such exceptions will
always be thrown when actually accessing the bundle context).
> SCR implementation should avoid using bundleContext.getBundle()
> ---------------------------------------------------------------
>
> Key: FELIX-4317
> URL: https://issues.apache.org/jira/browse/FELIX-4317
> Project: Felix
> Issue Type: Improvement
> Components: Declarative Services (SCR)
> Affects Versions: scr-1.8.0
> Reporter: Guillaume Nodet
> Assignee: Guillaume Nodet
> Fix For: scr-1.8.2
>
>
> The reason is that the bundle context can be invalidated by the framework, so
> keeping the bundle as a member property avoids running into such exceptions
--
This message was sent by Atlassian JIRA
(v6.1#6144)