Buggy code:
public abstract class Application { public static final String CONFIGURATION = "configuration" ; public static final String CONTEXTPATH = "contextpath" ; public static final String DEPLOYMENT = "deployment" ; public static final String DEVELOPMENT = "development" ; private static final Map applicationKeyToApplication = new HashMap ( 1 ) ; private static final ThreadLocal current = new ThreadLocal ( ) ; private static final Logger log = LoggerFactory . getLogger ( Application . class ) ; public static boolean exists ( ) { } public static Application get ( ) { } public static Application get ( String applicationKey ) { } public static void set ( final Application application ) { } public static void unset ( ) { } private IComponentInstantiationListener [ ] componentInstantiationListeners = new IComponentInstantiationListener [ 0 ] ; private IConverterLocator converterLocator ; private final List initializers = new ArrayList ( ) ; private MetaDataEntry [ ] metaData ; private final String name ; private IRequestLogger requestLogger ; private ISessionStore sessionStore ; private Settings settings ; private boolean settingsAccessible ; private final SharedResources sharedResources ; public Application ( ) { } public final void addComponentInstantiationListener ( final IComponentInstantiationListener listener ) { } public final void configure ( ) { } public abstract String getApplicationKey ( ) { } public IApplicationSettings getApplicationSettings ( ) { } public abstract String getConfigurationType ( ) { } public final IConverterLocator getConverterLocator ( ) { } public IDebugSettings getDebugSettings ( ) { } public IExceptionSettings getExceptionSettings ( ) { } public IFrameworkSettings getFrameworkSettings ( ) { } public abstract Class getHomePage ( ) { } public final IMarkupCache getMarkupCache ( ) { } public IMarkupSettings getMarkupSettings ( ) { } public final Serializable getMetaData ( final MetaDataKey key ) { } public final String getName ( ) { } public IPageSettings getPageSettings ( ) { } public IRequestCycleSettings getRequestCycleSettings ( ) { } public final IRequestLogger getRequestLogger ( ) { } public IRequestLoggerSettings getRequestLoggerSettings ( ) { } public IResourceSettings getResourceSettings ( ) { } public ISecuritySettings getSecuritySettings ( ) { } public ISessionSettings getSessionSettings ( ) { } public final ISessionStore getSessionStore ( ) { } public final SharedResources getSharedResources ( ) { } public final void initializeComponents ( ) { } public void logEventTarget ( IRequestTarget target ) { } public void logResponseTarget ( IRequestTarget requestTarget ) { } public abstract RequestCycle newRequestCycle ( final Request request , final Response response ) { } public final RequestCycle newRequestCycle ( Application application , Request request , Response response ) { } public abstract Session newSession ( Request request , Response response ) { } public final void removeComponentInstantiationListener ( final IComponentInstantiationListener listener ) { } public final synchronized void setMetaData ( final MetaDataKey key , final Serializable object ) { } private final void addInitializer ( String className ) { } private final void callDestroyers ( ) { } private final void callInitializers ( ) { } private Settings getSettings ( ) { } private final void load ( final Properties properties ) { } protected final void destroy ( ) { } protected void onDestroy ( ) { } protected final Object getRequestCycleFactory ( ) { } protected final Object getSessionFactory ( ) { } protected void init ( ) { } protected void internalDestroy ( ) { PropertyResolver . destroy ( this ) ; <START_BUG> getMarkupSettings ( ) . getMarkupCache ( ) . clear ( ) ; <END_BUG> onDestroy ( ) ; callDestroyers ( ) ; Application . applicationKeyToApplication . remove ( getApplicationKey ( ) ) ; } protected void internalInit ( ) { } protected IConverterLocator newConverterLocator ( ) { } protected IRequestLogger newRequestLogger ( ) { } protected abstract ISessionStore newSessionStore ( ) { } final void notifyComponentInstantiationListeners ( final Component component ) { } private List componentOnBeforeRenderListeners = null ; public final void addComponentOnBeforeRenderListener ( IComponentOnBeforeRenderListener listener ) { } public final void removeComponentOnBeforeRenderListener ( IComponentOnBeforeRenderListener listener ) { } final void notifyComponentOnBeforeRenderListeners ( Component component ) { } private List componentOnAfterRenderListeners = null ; public final void addComponentOnAfterRenderListener ( IComponentOnAfterRenderListener listener ) { } public final void removeComponentOnAfterRenderListener ( IComponentOnAfterRenderListener listener ) { } final void notifyComponentOnAfterRenderListeners ( Component component ) { } }

Fix:
getMarkupSettings ( ) . getMarkupCache ( ) . shutdown ( ) ;