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

import org.apache.wicket.core.request.handler.BookmarkablePageRequestHandler;
import org.apache.wicket.core.request.handler.IComponentRequestHandler;
import org.apache.wicket.core.request.handler.IPageRequestHandler;
import org.apache.wicket.core.request.handler.PageProvider;
import org.apache.wicket.request.IRequestHandler;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.component.IRequestablePage;

public class PageInterceptingRequestMapperLogic {
    public static IRequestHandler resolve(Request request, IRequestHandler handler,
            InterceptionDecisions interceptionDecisions,
            Class<? extends IRequestablePage> interceptorPageClass) {
        if (interceptionDecisions.shouldIntercept(request)) {
            boolean alreadyChanging = false;
            if (handler instanceof IPageRequestHandler) {
                IPageRequestHandler pageHandler = (IPageRequestHandler) handler;
                if (pageHandler.getPageClass() == interceptorPageClass) {
                    alreadyChanging = true;
                }
            }
            if (!alreadyChanging) {
                if (handler instanceof IComponentRequestHandler) {
                    IComponentRequestHandler iHandler = (IComponentRequestHandler) handler;
                    if (iHandler.getComponent().getPage().getClass() == interceptorPageClass) {
                        alreadyChanging = true;
                    }
                }
            }
            if (!alreadyChanging) {
                handler = new BookmarkablePageRequestHandler(new PageProvider(interceptorPageClass));
            }
        }
        return handler;
    }

}<commit_msg>Fixed a bug in PageInterceptingRequestMapperLogic: using RenderPageRequestHeader instead of BookmarkablePageRequestHandler<commit_after>package com.payneteasy.superfly.wicket;

import org.apache.wicket.core.request.handler.*;
import org.apache.wicket.request.IRequestHandler;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.component.IRequestablePage;

public class PageInterceptingRequestMapperLogic {
    public static IRequestHandler resolve(Request request, IRequestHandler handler,
            InterceptionDecisions interceptionDecisions,
            Class<? extends IRequestablePage> interceptorPageClass) {
        if (interceptionDecisions.shouldIntercept(request)) {
            boolean alreadyChanging = false;
            if (handler instanceof IPageRequestHandler) {
                IPageRequestHandler pageHandler = (IPageRequestHandler) handler;
                if (pageHandler.getPageClass() == interceptorPageClass) {
                    alreadyChanging = true;
                }
            }
            if (!alreadyChanging) {
                if (handler instanceof IComponentRequestHandler) {
                    IComponentRequestHandler iHandler = (IComponentRequestHandler) handler;
                    if (iHandler.getComponent().getPage().getClass() == interceptorPageClass) {
                        alreadyChanging = true;
                    }
                }
            }
            if (!alreadyChanging) {
                handler = new RenderPageRequestHandler(new PageProvider(interceptorPageClass));
            }
        }
        return handler;
    }

}
{'fraction_non_alphanumeric': 0.07349003272835465, 'fraction_numerical': 0.0, 'mean_word_length': 2.509394572025052, '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': '3878455', 'n_tokens_mistral': 817, 'n_tokens_neox': 796, 'n_words': 149}