Skip to content

Commit

Permalink
[WELD-1999] Fixing failing tests
Browse files Browse the repository at this point in the history
Changed order of field initialization in constructors
Fixed a NPE when creating ParameterInjectionPoint from
MethodInjectionPoint
  • Loading branch information
spyrkob authored and jharting committed Aug 13, 2015
1 parent a453100 commit f0ac1fc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Expand Up @@ -75,9 +75,9 @@ protected FieldInjectionPoint(Bean<?> declaringBean, WeldClass<?> injectionTarge
this.declaringBean = declaringBean;
this.injectionTargetClass = injectionTargetClass;
this.field = field;
this.beanManager = manager;
this.delegate = isAnnotationPresent(Inject.class) && isAnnotationPresent(Delegate.class) && declaringBean instanceof Decorator<?>;
this.cacheable = !delegate && !InjectionPoint.class.isAssignableFrom(field.getJavaMember().getType()) && !Instance.class.isAssignableFrom(field.getJavaMember().getType());
this.beanManager = manager;
}

@Override
Expand Down
Expand Up @@ -57,7 +57,7 @@ private abstract static class ForwardingParameterInjectionPointList<T, X> extend

@Override
public ParameterInjectionPoint<T, X> get(int index) {
return ParameterInjectionPoint.of(declaringBean(), delegate().get(index), null);
return ParameterInjectionPoint.of(declaringBean(), delegate().get(index), beanManager());
}

@Override
Expand Down
Expand Up @@ -69,9 +69,9 @@ public static <T, X> ParameterInjectionPoint<T, X> of(Bean<?> declaringBean, Wel
private ParameterInjectionPoint(Bean<?> declaringBean, WeldParameter<T, X> parameter, WeldManager beanManager) {
this.declaringBean = declaringBean;
this.parameter = parameter;
this.beanManager = beanManager;
this.delegate = isAnnotationPresent(Delegate.class) && declaringBean instanceof Decorator<?>;
this.cacheable = !delegate && !InjectionPoint.class.isAssignableFrom(parameter.getJavaClass()) && !Instance.class.isAssignableFrom(parameter.getJavaClass());
this.beanManager = beanManager;
}

@Override
Expand Down
Expand Up @@ -39,10 +39,10 @@ abstract static class WeldInjectionPointSerializationProxy<T, S> implements Seri
private final WeldManager beanManager;

public WeldInjectionPointSerializationProxy(WeldInjectionPoint<T, S> injectionPoint, WeldManager beanManager) {
this.beanManager = beanManager;
this.declaringBeanId =
injectionPoint.getBean() == null ? null : getService(ContextualStore.class).putIfAbsent(injectionPoint.getBean());
this.declaringClass = injectionPoint.getDeclaringType().getJavaClass();
this.beanManager = beanManager;
}

protected Bean<T> getDeclaringBean() {
Expand Down

0 comments on commit f0ac1fc

Please sign in to comment.