<commit_before>/*
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 */
package org.gridlab.gridsphere.portlet.impl;

import org.gridlab.gridsphere.portlet.*;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpSession;
import java.util.Enumeration;
import java.util.List;
import java.util.Locale;
import java.io.UnsupportedEncodingException;


/**
 * A <code>SportletRequestImpl</code> provides an implementation of the
 * <code>PortletRequest</code> by following the decorator patterm.
 * A HttpServletRequest object is used in composition to perform most of
 * the required methods.
 */
public class SportletRequestImpl extends HttpServletRequestWrapper implements SportletRequest {

    private static PortletLog log = SportletLog.getInstance(SportletRequest.class);

    private PortletSession portletSession = null;

    /**
     * Constructor creates a proxy for a HttpServletRequest
     * All PortletRequest objects come from request or session attributes
     *
     * @param req the HttpServletRequest
     */
    public SportletRequestImpl(HttpServletRequest req) {
        super(req);
    }

    /**
     * Returns an object representing the client device that the user connects to the portal with.
     *
     * @return the client device
     */
    public Client getClient() {
        Client client = (Client) this.getHttpServletRequest().getSession().getAttribute(SportletProperties.CLIENT);
        if (client == null) {
            client = new ClientImpl(this.getHttpServletRequest());
            this.getHttpServletRequest().getSession().setAttribute(SportletProperties.CLIENT, client);
        }
        return client;<commit_msg>don't log request by default<commit_after>/*
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 */
package org.gridlab.gridsphere.portlet.impl;

import org.gridlab.gridsphere.portlet.*;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpSession;
import java.util.Enumeration;
import java.util.List;
import java.util.Locale;
import java.io.UnsupportedEncodingException;


/**
 * A <code>SportletRequestImpl</code> provides an implementation of the
 * <code>PortletRequest</code> by following the decorator patterm.
 * A HttpServletRequest object is used in composition to perform most of
 * the required methods.
 */
public class SportletRequestImpl extends HttpServletRequestWrapper implements SportletRequest {

    private static PortletLog log = SportletLog.getInstance(SportletRequest.class);

    private PortletSession portletSession = null;

    /**
     * Constructor creates a proxy for a HttpServletRequest
     * All PortletRequest objects come from request or session attributes
     *
     * @param req the HttpServletRequest
     */
    public SportletRequestImpl(HttpServletRequest req) {
        super(req);
        //logRequest();
    }

    /**
     * Returns an object representing the client device that the user connects to the portal with.
     *
     * @return the client device
     */
    public Client getClient() {
        Client client = (Client) this.getHttpServletRequest().getSession().getAttribute(SportletProperties.CLIENT);
        if (client == null) {
            client = new ClientImpl(this.getHttpServletRequest());
            this.getHttpServletRequest().getSession().setAttribute(SportletProperties.CLIENT, client);
        }
        return client;
{'fraction_non_alphanumeric': 0.09210895815782083, 'fraction_numerical': 0.0, 'mean_word_length': 3.8265582655826558, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '4740054', 'n_tokens_mistral': 923, 'n_tokens_neox': 918, 'n_words': 258}