Skip to content

Commit

Permalink
Use beanManager.isNormalScope() instead of beanManager.getServices().…
Browse files Browse the repository at this point in the history
…get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal()
  • Loading branch information
luksa authored and jharting committed Aug 5, 2013
1 parent 835d159 commit 8c7810b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
4 changes: 0 additions & 4 deletions impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
Expand Up @@ -202,10 +202,6 @@ public boolean isDependent() {
return Dependent.class.equals(getScope());
}

public boolean isNormalScoped() {
return getBeanManager().getServices().get(MetaAnnotationStore.class).getScopeModel(getScope()).isNormal();
}

public boolean isSpecializing() {
return getAnnotated().isAnnotationPresent(Specializes.class);
}
Expand Down
4 changes: 4 additions & 0 deletions impl/src/main/java/org/jboss/weld/bean/RIBean.java
Expand Up @@ -89,6 +89,10 @@ public boolean isDependent() {
return getScope().equals(Dependent.class);
}

public boolean isNormalScoped() {
return getBeanManager().isNormalScope(getScope());
}

public abstract boolean isProxyable();

public abstract boolean isPassivationCapableBean();
Expand Down
Expand Up @@ -54,11 +54,7 @@ public void preInitialize() {

@Override
public void internalInitialize(BeanDeployerEnvironment environment) {
if (getScope() != null) {
proxyRequired = getBeanManager().getServices().get(MetaAnnotationStore.class).getScopeModel(getScope()).isNormal();
} else {
proxyRequired = false;
}
proxyRequired = getScope() != null && isNormalScoped();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion impl/src/main/java/org/jboss/weld/bootstrap/Validator.java
Expand Up @@ -965,7 +965,7 @@ private static void validatePseudoScopedInjectionPoint(InjectionPoint ij, BeanMa
if (bean != null) {
if (!(bean instanceof AbstractBuiltInBean<?>)) {
if (!ij.isDelegate()) {
boolean normalScoped = beanManager.getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal();
boolean normalScoped = beanManager.isNormalScope(bean.getScope());
if (!normalScoped) {
reallyValidatePseudoScopedBean(bean, beanManager, dependencyPath, validatedBeans);
}
Expand Down
Expand Up @@ -988,7 +988,7 @@ public BeanManagerImpl createActivity() {
}

public BeanManagerImpl setCurrent(Class<? extends Annotation> scopeType) {
if (!getServices().get(MetaAnnotationStore.class).getScopeModel(scopeType).isNormal()) {
if (!isNormalScope(scopeType)) {
throw new IllegalArgumentException(NON_NORMAL_SCOPE, scopeType);
}
currentActivities.add(new CurrentActivity(getContext(scopeType), this));
Expand Down

0 comments on commit 8c7810b

Please sign in to comment.