<commit_before>/**
 * 
 */
package com.github.podd.restlet.integrationtest;

import org.openrdf.OpenRDFException;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.Restlet;
import org.restlet.data.Status;
import org.restlet.resource.ResourceException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.github.podd.restlet.ApplicationUtils;
import com.github.podd.restlet.PoddWebServiceApplication;

/**
 * Resets an application using ApplicationUtils.setupApplication.
 * 
 * @author <NAME> <EMAIL>
 * 
 */
public class TestResetResourceImpl extends Restlet
{
    
    private final Logger log = LoggerFactory.getLogger(this.getClass());
    private PoddWebServiceApplication application;
    
    /**
     */
    public TestResetResourceImpl()
    {
        super();
    }
    
    public TestResetResourceImpl(final PoddWebServiceApplication nextApplication)
    {
        this.application = nextApplication;
    }
    
    @Override
    public void handle(final Request request, final Response response)
    {
        super.handle(request, response);
        
        this.log.info("========== Reset called ==========");
        try
        {
            ApplicationUtils.setupApplication(this.application, this.application.getContext());
        }
        catch(final OpenRDFException e)
        {
            this.log.error("Could not reset application", e);
            throw new ResourceException(Status.SERVER_ERROR_INTERNAL, "Could not reset application", e);
        }
        this.log.info("========== Reset complete ==========");
        
        response.setStatus(Status.SUCCESS_NO_CONTENT);
    }
    
}<commit_msg>Reset the aliases configuration to an empty model so it will be regenerated each time<commit_after>/**
 * 
 */
package com.github.podd.restlet.integrationtest;

import org.openrdf.OpenRDFException;
import org.openrdf.model.impl.LinkedHashModel;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.Restlet;
import org.restlet.data.Status;
import org.restlet.resource.ResourceException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.github.podd.restlet.ApplicationUtils;
import com.github.podd.restlet.PoddWebServiceApplication;

/**
 * Resets an application using ApplicationUtils.setupApplication.
 * 
 * @author <NAME> <EMAIL>
 * 
 */
public class TestResetResourceImpl extends Restlet
{
    
    private final Logger log = LoggerFactory.getLogger(this.getClass());
    private PoddWebServiceApplication application;
    
    /**
     */
    public TestResetResourceImpl()
    {
        super();
    }
    
    public TestResetResourceImpl(final PoddWebServiceApplication nextApplication)
    {
        this.application = nextApplication;
    }
    
    @Override
    public void handle(final Request request, final Response response)
    {
        super.handle(request, response);
        
        this.log.info("========== Reset called ==========");
        try
        {
            // Reset the aliases configuration to that it will be regenerated each time
            this.application.setAliasesConfiguration(new LinkedHashModel());
            ApplicationUtils.setupApplication(this.application, this.application.getContext());
        }
        catch(final OpenRDFException e)
        {
            this.log.error("Could not reset application", e);
            throw new ResourceException(Status.SERVER_ERROR_INTERNAL, "Could not reset application", e);
        }
        this.log.info("========== Reset complete ==========");
        
        response.setStatus(Status.SUCCESS_NO_CONTENT);
    }
    
}
{'fraction_non_alphanumeric': 0.11282333516785911, 'fraction_numerical': 0.001100715465052284, 'mean_word_length': 3.0659955257270695, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7064622', 'n_tokens_mistral': 992, 'n_tokens_neox': 978, 'n_words': 210}