Skip to content

Commit

Permalink
WELD-1820 Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jharting committed Mar 6, 2015
1 parent b17c5e8 commit 5aa31d0
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ T getIfExists(Bean<T> bean, BeanManagerImpl manager) {
}
synchronized (this) {
if (value == null) {
this.value = instance = super.getIfExists(bean, manager);
instance = super.getIfExists(bean, manager);
if (instance != null) {
this.value = instance;
}
}
return instance;
}
Expand All @@ -133,7 +136,7 @@ T get(Bean<T> bean, BeanManagerImpl manager, CreationalContext<?> ctx) {
return instance;
}
synchronized (this) {
if (value == null) {
if ((instance = value) == null) {
this.value = instance = super.get(bean, manager, ctx);
}
return instance;
Expand Down

0 comments on commit 5aa31d0

Please sign in to comment.