Buggy code:
public abstract class AbstractApplicationContext extends DefaultResourceLoader implements DisposableBean , ConfigurableApplicationContext { public static final String MESSAGE_SOURCE_BEAN_NAME = "messageSource" ; public static final String LIFECYCLE_PROCESSOR_BEAN_NAME = "lifecycleProcessor" ; public static final String APPLICATION_EVENT_MULTICASTER_BEAN_NAME = "applicationEventMulticaster" ; protected final Log logger = LogFactory . getLog ( getClass ( ) ) ; private String id = ObjectUtils . identityToString ( this ) ; private String displayName = ObjectUtils . identityToString ( this ) ; private ApplicationContext parent ; private final List < BeanFactoryPostProcessor > beanFactoryPostProcessors = new ArrayList < BeanFactoryPostProcessor > ( ) ; private long startupDate ; private final AtomicBoolean active = new AtomicBoolean ( ) ; private final AtomicBoolean closed = new AtomicBoolean ( ) ; private final Object startupShutdownMonitor = new Object ( ) ; private Thread shutdownHook ; private ResourcePatternResolver resourcePatternResolver ; private LifecycleProcessor lifecycleProcessor ; private MessageSource messageSource ; private ApplicationEventMulticaster applicationEventMulticaster ; private Set < ApplicationListener < ? > > applicationListeners = new LinkedHashSet < ApplicationListener < ? > > ( ) ; private ConfigurableEnvironment environment ; public AbstractApplicationContext ( ) { } public AbstractApplicationContext ( ApplicationContext parent ) { } @ Override public void setId ( String id ) { } @ Override public String getId ( ) { } @ Override public String getApplicationName ( ) { } public void setDisplayName ( String displayName ) { } @ Override public String getDisplayName ( ) { } @ Override public ApplicationContext getParent ( ) { } @ Override public ConfigurableEnvironment getEnvironment ( ) { } @ Override public void setEnvironment ( ConfigurableEnvironment environment ) { } @ Override public AutowireCapableBeanFactory getAutowireCapableBeanFactory ( ) throws IllegalStateException { } @ Override public long getStartupDate ( ) { } @ Override public void publishEvent ( ApplicationEvent event ) { } ApplicationEventMulticaster getApplicationEventMulticaster ( ) throws IllegalStateException { } LifecycleProcessor getLifecycleProcessor ( ) { } protected ResourcePatternResolver getResourcePatternResolver ( ) { } @ Override public void setParent ( ApplicationContext parent ) { } @ Override public void addBeanFactoryPostProcessor ( BeanFactoryPostProcessor beanFactoryPostProcessor ) { } public List < BeanFactoryPostProcessor > getBeanFactoryPostProcessors ( ) { } @ Override public void addApplicationListener ( ApplicationListener < ? > listener ) { } public Collection < ApplicationListener < ? > > getApplicationListeners ( ) { } protected ConfigurableEnvironment createEnvironment ( ) { } @ Override public void refresh ( ) throws IllegalStateException , BeansException { } protected void prepareRefresh ( ) { } protected void initPropertySources ( ) { } protected ConfigurableListableBeanFactory obtainFreshBeanFactory ( ) { } protected void prepareBeanFactory ( ConfigurableListableBeanFactory beanFactory ) { beanFactory . setBeanClassLoader ( getClassLoader ( ) ) ; <START_BUG> beanFactory . setBeanExpressionResolver ( new StandardBeanExpressionResolver ( ) ) ; <END_BUG> beanFactory . addPropertyEditorRegistrar ( new org . springframework . beans . support . ResourceEditorRegistrar ( this , getEnvironment ( ) ) ) ; beanFactory . addBeanPostProcessor ( new ApplicationContextAwareProcessor ( this ) ) ; beanFactory . ignoreDependencyInterface ( ResourceLoaderAware . class ) ; beanFactory . ignoreDependencyInterface ( ApplicationEventPublisherAware . class ) ; beanFactory . ignoreDependencyInterface ( MessageSourceAware . class ) ; beanFactory . ignoreDependencyInterface ( ApplicationContextAware . class ) ; beanFactory . ignoreDependencyInterface ( EnvironmentAware . class ) ; beanFactory . registerResolvableDependency ( BeanFactory . class , beanFactory ) ; beanFactory . registerResolvableDependency ( ResourceLoader . class , this ) ; beanFactory . registerResolvableDependency ( ApplicationEventPublisher . class , this ) ; beanFactory . registerResolvableDependency ( ApplicationContext . class , this ) ; if ( beanFactory . containsBean ( LOAD_TIME_WEAVER_BEAN_NAME ) ) { beanFactory . addBeanPostProcessor ( new org . springframework . context . weaving . LoadTimeWeaverAwareProcessor ( beanFactory ) ) ; beanFactory . setTempClassLoader ( new ContextTypeMatchClassLoader ( beanFactory . getBeanClassLoader ( ) ) ) ; } if ( ! ( beanFactory . containsLocalBean ( ENVIRONMENT_BEAN_NAME ) ) ) { beanFactory . registerSingleton ( ENVIRONMENT_BEAN_NAME , getEnvironment ( ) ) ; } if ( ! ( beanFactory . containsLocalBean ( SYSTEM_PROPERTIES_BEAN_NAME ) ) ) { beanFactory . registerSingleton ( SYSTEM_PROPERTIES_BEAN_NAME , getEnvironment ( ) . getSystemProperties ( ) ) ; } if ( ! ( beanFactory . containsLocalBean ( SYSTEM_ENVIRONMENT_BEAN_NAME ) ) ) { beanFactory . registerSingleton ( SYSTEM_ENVIRONMENT_BEAN_NAME , getEnvironment ( ) . getSystemEnvironment ( ) ) ; } } protected void postProcessBeanFactory ( ConfigurableListableBeanFactory beanFactory ) { } protected void invokeBeanFactoryPostProcessors ( ConfigurableListableBeanFactory beanFactory ) { } protected void registerBeanPostProcessors ( ConfigurableListableBeanFactory beanFactory ) { } protected void initMessageSource ( ) { } protected void initApplicationEventMulticaster ( ) { } protected void initLifecycleProcessor ( ) { } protected void onRefresh ( ) throws BeansException { } protected void registerListeners ( ) { } protected void finishBeanFactoryInitialization ( ConfigurableListableBeanFactory beanFactory ) { } protected void finishRefresh ( ) { } protected void cancelRefresh ( BeansException ex ) { } @ Override public void registerShutdownHook ( ) { } @ Override public void destroy ( ) { } @ Override public void close ( ) { } protected void doClose ( ) { } protected void destroyBeans ( ) { } protected void onClose ( ) { } @ Override public boolean isActive ( ) { } protected void assertBeanFactoryActive ( ) { } @ Override public Object getBean ( String name ) throws BeansException { } @ Override public < T > T getBean ( String name , Class < T > requiredType ) throws BeansException { } @ Override public < T > T getBean ( Class < T > requiredType ) throws BeansException { } @ Override public Object getBean ( String name , Object ... args ) throws BeansException { } @ Override public boolean containsBean ( String name ) { } @ Override public boolean isSingleton ( String name ) throws NoSuchBeanDefinitionException { } @ Override public boolean isPrototype ( String name ) throws NoSuchBeanDefinitionException { } @ Override public boolean isTypeMatch ( String name , Class < ? > targetType ) throws NoSuchBeanDefinitionException { } @ Override public Class < ? > getType ( String name ) throws NoSuchBeanDefinitionException { }

Fix:
beanFactory . setBeanExpressionResolver ( new org . springframework . context . expression . StandardBeanExpressionResolver ( beanFactory . getBeanClassLoader ( ) ) ) ;