<commit_before>package com.payneteasy.superfly.web.wicket;

import org.apache.wicket.Session;
import org.apache.wicket.core.request.mapper.MountedMapper;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Response;
import org.apache.wicket.request.mapper.parameter.IPageParametersEncoder;
import org.apache.wicket.request.mapper.parameter.PageParametersEncoder;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
import org.apache.wicket.util.file.Path;

public abstract class BaseApplication extends WebApplication {

    private IPageParametersEncoder parametersEncoder = new PageParametersEncoder();

    protected final void mountBookmarkablePage(String path, Class<? extends WebPage> pageClass) {
        mount(new MountedMapper(path, pageClass, parametersEncoder));
    }

	@Override
	protected final void init() {
        super.init();

        getResourceSettings().getResourceFinders().add(0, new Path("src/main/java"));
        getComponentInstantiationListeners().add(new SpringComponentInjector(this));
        getDebugSettings().setOutputMarkupContainerClassName(false);
        
        customInit();
	}

    protected abstract void customInit();

	@Override
	public Session newSession(Request request, Response response) {
		return new SuperflySession(request);
	}

}<commit_msg>If src/main/java folder is absent, it does not cause application startup to fail; and it is used only in development mode<commit_after>package com.payneteasy.superfly.web.wicket;

import org.apache.wicket.RuntimeConfigurationType;
import org.apache.wicket.Session;
import org.apache.wicket.core.request.mapper.MountedMapper;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Response;
import org.apache.wicket.request.mapper.parameter.IPageParametersEncoder;
import org.apache.wicket.request.mapper.parameter.PageParametersEncoder;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
import org.apache.wicket.util.file.Path;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;

public abstract class BaseApplication extends WebApplication {

    private static final Logger logger = LoggerFactory.getLogger(BaseApplication.class);

    private IPageParametersEncoder parametersEncoder = new PageParametersEncoder();

    protected final void mountBookmarkablePage(String path, Class<? extends WebPage> pageClass) {
        mount(new MountedMapper(path, pageClass, parametersEncoder));
    }

	@Override
	protected final void init() {
        super.init();

        if (getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT) {
            String path = "src/main/java";
            if (new File(path).exists()) {
                getResourceSettings().getResourceFinders().add(0, new Path(path));
            } else {
                logger.warn("No src/main/java folder found, dynamic resource reloading is not available");
            }
        }
        getComponentInstantiationListeners().add(new SpringComponentInjector(this));
        getDebugSettings().setOutputMarkupContainerClassName(false);
        
        customInit();
	}

    protected abstract void customInit();

	@Override
	public Session newSession(Request request, Response response) {
		return new SuperflySession(request);
	}

}
{'fraction_non_alphanumeric': 0.09650865739426626, 'fraction_numerical': 0.0011353959693443088, 'mean_word_length': 4.50625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4048440', 'n_tokens_mistral': 962, 'n_tokens_neox': 944, 'n_words': 200}