Buggy code:
@ SuppressWarnings ( "serial" ) public abstract class FrameworkServlet extends HttpServletBean { public static final String DEFAULT_NAMESPACE_SUFFIX = "-servlet" ; public static final Class < ? > DEFAULT_CONTEXT_CLASS = XmlWebApplicationContext . class ; public static final String SERVLET_CONTEXT_PREFIX = ( FrameworkServlet . class . getName ( ) ) + ".CONTEXT." ; private static final String INIT_PARAM_DELIMITERS = ",;<seq2seq4repair_space>\t\n" ; private String contextAttribute ; private Class < ? > contextClass = FrameworkServlet . DEFAULT_CONTEXT_CLASS ; private String contextId ; private String namespace ; private String contextConfigLocation ; private boolean publishContext = true ; private boolean publishEvents = true ; private boolean threadContextInheritable = false ; private boolean dispatchOptionsRequest = false ; private boolean dispatchTraceRequest = false ; private WebApplicationContext webApplicationContext ; private boolean refreshEventReceived = false ; private String contextInitializerClasses ; private ArrayList < ApplicationContextInitializer < ConfigurableApplicationContext > > contextInitializers = new ArrayList < ApplicationContextInitializer < ConfigurableApplicationContext > > ( ) ; public FrameworkServlet ( ) { } public FrameworkServlet ( WebApplicationContext webApplicationContext ) { } public void setContextAttribute ( String contextAttribute ) { } public String getContextAttribute ( ) { } public void setContextClass ( Class < ? > contextClass ) { } public Class < ? > getContextClass ( ) { } public void setContextId ( String contextId ) { } public String getContextId ( ) { } public void setNamespace ( String namespace ) { } public String getNamespace ( ) { } public void setContextInitializerClasses ( String contextInitializerClasses ) { } public void setContextInitializers ( ApplicationContextInitializer < ConfigurableApplicationContext > ... contextInitializers ) { } public void setContextConfigLocation ( String contextConfigLocation ) { } public String getContextConfigLocation ( ) { } public void setPublishContext ( boolean publishContext ) { } public void setPublishEvents ( boolean publishEvents ) { } public void setThreadContextInheritable ( boolean threadContextInheritable ) { } public void setDispatchOptionsRequest ( boolean dispatchOptionsRequest ) { } public void setDispatchTraceRequest ( boolean dispatchTraceRequest ) { } @ Override protected final void initServletBean ( ) throws ServletException { } protected WebApplicationContext initWebApplicationContext ( ) { } protected WebApplicationContext findWebApplicationContext ( ) { } protected WebApplicationContext createWebApplicationContext ( ApplicationContext parent ) { Class < ? > contextClass = getContextClass ( ) ; if ( this . logger . isDebugEnabled ( ) ) { this . logger . debug ( ( ( ( ( ( ( ( "Servlet<seq2seq4repair_space>with<seq2seq4repair_space>name<seq2seq4repair_space>'" + ( getServletName ( ) ) ) + "'<seq2seq4repair_space>will<seq2seq4repair_space>try<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>custom<seq2seq4repair_space>WebApplicationContext<seq2seq4repair_space>context<seq2seq4repair_space>of<seq2seq4repair_space>class<seq2seq4repair_space>'" ) + ( contextClass . getName ( ) ) ) + "'" ) + ",<seq2seq4repair_space>using<seq2seq4repair_space>parent<seq2seq4repair_space>context<seq2seq4repair_space>[" ) + parent ) + "]" ) ) ; } if ( ! ( ConfigurableWebApplicationContext . class . isAssignableFrom ( contextClass ) ) ) { throw new org . springframework . context . ApplicationContextException ( ( ( ( ( "Fatal<seq2seq4repair_space>initialization<seq2seq4repair_space>error<seq2seq4repair_space>in<seq2seq4repair_space>servlet<seq2seq4repair_space>with<seq2seq4repair_space>name<seq2seq4repair_space>'" + ( getServletName ( ) ) ) + "':<seq2seq4repair_space>custom<seq2seq4repair_space>WebApplicationContext<seq2seq4repair_space>class<seq2seq4repair_space>[" ) + ( contextClass . getName ( ) ) ) + "]<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>ConfigurableWebApplicationContext" ) ) ; } ConfigurableWebApplicationContext wac = ( ( ConfigurableWebApplicationContext ) ( BeanUtils . instantiateClass ( contextClass ) ) ) ; <START_BUG> wac . setEnvironment ( this . getEnvironment ( ) ) ; <END_BUG> wac . setParent ( parent ) ; wac . setConfigLocation ( getContextConfigLocation ( ) ) ; configureAndRefreshWebApplicationContext ( wac ) ; return wac ; } protected void configureAndRefreshWebApplicationContext ( ConfigurableWebApplicationContext wac ) { } protected WebApplicationContext createWebApplicationContext ( WebApplicationContext parent ) { } @ SuppressWarnings ( "unchecked" ) protected void applyInitializers ( ConfigurableApplicationContext wac ) { } protected void postProcessWebApplicationContext ( ConfigurableWebApplicationContext wac ) { } public String getServletContextAttributeName ( ) { } public final WebApplicationContext getWebApplicationContext ( ) { } protected void initFrameworkServlet ( ) throws ServletException { } public void refresh ( ) { } public void onApplicationEvent ( ContextRefreshedEvent event ) { } protected void onRefresh ( ApplicationContext context ) { } @ Override protected void service ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected final void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected final void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected final void doPut ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected final void doDelete ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected void doOptions ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected void doTrace ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } protected final void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } protected LocaleContext buildLocaleContext ( HttpServletRequest request ) { } private void initContextHolders ( HttpServletRequest request , LocaleContext localeContext , RequestAttributes attributes ) { } private void resetContextHolders ( HttpServletRequest request , LocaleContext prevLocaleContext , RequestAttributes previousAttributes ) { } private CallableProcessingInterceptor createRequestBindingInterceptor ( final HttpServletRequest request ) { } protected String getUsernameForRequest ( HttpServletRequest request ) { } protected abstract void doService ( HttpServletRequest request , HttpServletResponse response ) throws Exception { } @ Override public void destroy ( ) { } private class ContextRefreshListener implements ApplicationListener < ContextRefreshedEvent > { public void onApplicationEvent ( ContextRefreshedEvent event ) { } } }

Fix:
wac . setEnvironment ( getEnvironment ( ) ) ;