#vulnerable code 
                             public static <T> T getReference(BeanManager beanManager, Class<T> beanClass) {
		return getReference(beanManager, resolve(beanManager, beanClass));
	} 
                            #location 2 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public static <T> T getReference(BeanManager beanManager, Class<T> beanClass) {
		Bean<T> bean = resolve(beanManager, beanClass);
		return (bean != null) ? getReference(beanManager, bean) : null;
	}