[ https://issues.apache.org/jira/browse/OWB-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16589907#comment-16589907 ]
Mark Struberg edited comment on OWB-1252 at 8/23/18 8:32 AM: ------------------------------------------------------------- Right now our WebContextsService smells a bit fishy anyway. {code:java} public Context getCurrentContext(Class<? extends Annotation> scopeType) {code} vs {code:java} public Context getCurrentContext(Class<? extends {color}Annotation> scopeType, boolean createIfNotExists) {code} The first one calls {code:java} return getRequestContext(true); {code} which is imo wrong as the javadoc clearly says that NO context will get created if not exists! was (Author: struberg): Right now our WebContextsService smells a bit fishy anyway. {{{color:#000080}public {color}Context getCurrentContext(Class<? {color:#000080}extends {color}Annotation> scopeType) }} {{vs}} {{{color:#000080}public {color}Context getCurrentContext(Class<? {color:#000080}extends {color}Annotation> scopeType, {color:#000080}boolean {color}createIfNotExists)}} The first one calls {{{color:#000080}return {color}getRequestContext({color:#000080}true{color}); }} which is imo wrong as the javadoc clearly says that NO context will get created if not exists! > WebContextsService lazyStartRequestContext fails on first access. > ----------------------------------------------------------------- > > Key: OWB-1252 > URL: https://issues.apache.org/jira/browse/OWB-1252 > Project: OpenWebBeans > Issue Type: Improvement > Components: Context and Scopes > Affects Versions: 2.0.6 > Reporter: Mark Struberg > Assignee: Mark Struberg > Priority: Major > Fix For: 2.0.7 > > > As reported by Tamas Kimmel on our mailing list > [https://lists.apache.org/thread.html/e3490fa84afa06b95a776ef34f9c8d9aee9fe662d150680a346b37ba@%3Cuser.openwebbeans.apache.org%3E] > > It seems that WebContextsService#getRequestContext does lazily create the > RequestContext for a Thread, but does not return the created Context for the > first invocation but only on subsequent invocations. -- This message was sent by Atlassian JIRA (v7.6.3#76005)