<commit_before>package edu.wustl.catissuecore.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import edu.wustl.catissuecore.actionForm.CollectionProtocolForm;
import edu.wustl.catissuecore.util.MSRUtil;
import edu.wustl.catissuecore.util.global.Constants;
import edu.wustl.catissuecore.util.listener.CatissueCoreServletContextListener;
import edu.wustl.common.action.BaseAction;
import edu.wustl.common.util.logger.Logger;

/**
 * Sets data for site,user,action and role on page loading and handles the ajax requests.
 * @author vipin_bansal
 */
public class ShowAssignPrivilegePageAction extends BaseAction 
{
	/**
	 * Overrides the execute method of Action class. Initializes the various
	 * fields in AssignPrivilege.jsp Page.
	 */
	private static org.apache.log4j.Logger logger =Logger.getLogger(CatissueCoreServletContextListener.class);  
	public ActionForward executeAction(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception 
	{ 
		ActionForward findForward = null;
		MSRUtil msrUtil=new MSRUtil();
		final CollectionProtocolForm  cpForm = (CollectionProtocolForm)form; 
		final String operation = (String) request.getParameter(Constants.OPERATION);
		final String cpOperation = (String) request.getParameter("cpOperation");
		request.setAttribute("cpOperation", cpOperation);
		if (("AssignPrivilegePage".equals(cpOperation))) 
		{
			findForward=msrUtil.onFirstTimeLoad(mapping, request);
		}
		else 
		{
				findForward =msrUtil.setAJAXResponse(request, response, cpOperation);
				
		} 
		request.setAttribute("CollectionProtocolForm", cpForm);
		request.setAttribute("noOfConsents", cpForm.getConsentTierCounter());

		return findForward;
	}
}
<commit_msg>Refactored.<commit_after>package edu.wustl.catissuecore.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import edu.wustl.catissuecore.actionForm.CollectionProtocolForm;
import edu.wustl.catissuecore.util.MSRUtil;
import edu.wustl.catissuecore.util.global.Constants;
import edu.wustl.catissuecore.util.listener.CatissueCoreServletContextListener;
import edu.wustl.common.action.BaseAction;
import edu.wustl.common.util.logger.Logger;

/**
 * Sets data for site,user,action and role on page loading and handles the ajax requests.
 * @author vipin_bansal
 */
public class ShowAssignPrivilegePageAction extends BaseAction 
{
	/**
	 * Overrides the execute method of Action class. Initializes the various
	 * fields in AssignPrivilege.jsp Page.
	 */
	private static org.apache.log4j.Logger logger =Logger.getLogger(CatissueCoreServletContextListener.class);  
	public ActionForward executeAction(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception 
	{ 
		ActionForward findForward = null;
		String pageOf = request.getParameter(Constants.PAGE_OF);
		MSRUtil msrUtil=new MSRUtil();
		final CollectionProtocolForm  cpForm = (CollectionProtocolForm)form; 
		final String operation = (String) request.getParameter(Constants.OPERATION);
		final String cpOperation = (String) request.getParameter("cpOperation");
		request.setAttribute("cpOperation", cpOperation);
		if (("AssignPrivilegePage".equals(cpOperation))) 
		{
			findForward=msrUtil.onFirstTimeLoad(mapping, request);
		}
		else 
		{
			findForward =msrUtil.setAJAXResponse(request, response, cpOperation);
		} 
		request.setAttribute("CollectionProtocolForm", cpForm);
		request.setAttribute("noOfConsents", cpForm.getConsentTierCounter());

		return findForward;
	}
}

{'fraction_non_alphanumeric': 0.09149837945649464, 'fraction_numerical': 0.0004986287708800798, 'mean_word_length': 5.0604229607250755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2772136', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1181, 'n_words': 229}