Skip to content

Commit

Permalink
ContextBeanInstance - remove unnecessary ThreadLocal#get() invocations
Browse files Browse the repository at this point in the history
  • Loading branch information
mkouba authored and jharting committed Dec 2, 2013
1 parent b511254 commit 9d6b004
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -85,10 +85,10 @@ public T getInstance() {

WeldCreationalContext<T> creationalContext;
WeldCreationalContext<?> previousCreationalContext = currentCreationalContext.get();
if (currentCreationalContext.get() == null) {
if (previousCreationalContext == null) {
creationalContext = new CreationalContextImpl<T>(bean);
} else {
creationalContext = currentCreationalContext.get().getCreationalContext(bean);
creationalContext = previousCreationalContext.getCreationalContext(bean);
}
final CurrentInjectionPoint currentInjectionPoint = container.services().get(CurrentInjectionPoint.class);
currentCreationalContext.set(creationalContext);
Expand Down

0 comments on commit 9d6b004

Please sign in to comment.