<commit_before>package org.ohmage.request;

import java.util.HashMap;
import java.util.Map;

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

import org.apache.log4j.Logger;
import org.json.JSONException;
import org.json.JSONObject;
import org.ohmage.cache.PreferenceCache;
import org.ohmage.exception.CacheMissException;

/**
 * <p>This class is responsible for updating a class.</p>
 * <p>There are no required parameters for this call.</p>
 * 
 * @author <NAME>
 */
public class ConfigReadRequest extends Request {
	private static final Logger LOGGER = Logger.getLogger(ConfigReadRequest.class);
	
	private final JSONObject result;
	
	/**
	 * Default constructor.
	 */
	public ConfigReadRequest() {
		super(null);
		
		result = new JSONObject();
	}
	
	/**
	 * Gathers the appropriate information and stores the result in the result
	 * object.
	 */
	@Override
	public void service() {
		LOGGER.info("Gathering information about the system.");
		
		// Get the response values to be returned to the requestor and place
		// them in the response.
		try {
			// Get the application's name.
			result.put("application_name", PreferenceCache.instance().lookup(PreferenceCache.KEY_APPLICATION_NAME));
			
			// Get the application's version.
			result.put("application_version", PreferenceCache.instance().lookup(PreferenceCache.KEY_APPLICATION_VERSION));
			
			// Get the Git build hash.
			result.put("application_build", PreferenceCache.instance().lookup(PreferenceCache.KEY_APPLICATION_BUILD));
			
			// Get the default survey response sharing state.
			result.put("default_survey_response_sharing_state", PreferenceCache.instance().lookup(PreferenceCache.KEY_DEFAULT_SURVEY_RESPONSE_SHARING_STATE));
		}
		catch(CacheMissException e) {
			setFailed();
			LOGGER.error("Unknown value for 'known' key '" + PreferenceCache.KEY_DEFAULT_SURVEY_RESPONSE_SHARING_STATE + "'. Is the cache database missing a key-value pair?", e);
		}<commit_msg>Typo.<commit_after>package org.ohmage.request;

import java.util.HashMap;
import java.util.Map;

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

import org.apache.log4j.Logger;
import org.json.JSONException;
import org.json.JSONObject;
import org.ohmage.cache.PreferenceCache;
import org.ohmage.exception.CacheMissException;

/**
 * <p>This class is responsible for updating a class.</p>
 * <p>There are no required parameters for this call.</p>
 * 
 * @author <NAME>
 */
public class ConfigReadRequest extends Request {
	private static final Logger LOGGER = Logger.getLogger(ConfigReadRequest.class);
	
	private final JSONObject result;
	
	/**
	 * Default constructor.
	 */
	public ConfigReadRequest() {
		super(null);
		
		result = new JSONObject();
	}
	
	/**
	 * Gathers the appropriate information and stores the result in the result
	 * object.
	 */
	@Override
	public void service() {
		LOGGER.info("Gathering information about the system.");
		
		// Get the response values to be returned to the requester and place
		// them in the response.
		try {
			// Get the application's name.
			result.put("application_name", PreferenceCache.instance().lookup(PreferenceCache.KEY_APPLICATION_NAME));
			
			// Get the application's version.
			result.put("application_version", PreferenceCache.instance().lookup(PreferenceCache.KEY_APPLICATION_VERSION));
			
			// Get the Git build hash.
			result.put("application_build", PreferenceCache.instance().lookup(PreferenceCache.KEY_APPLICATION_BUILD));
			
			// Get the default survey response sharing state.
			result.put("default_survey_response_sharing_state", PreferenceCache.instance().lookup(PreferenceCache.KEY_DEFAULT_SURVEY_RESPONSE_SHARING_STATE));
		}
		catch(CacheMissException e) {
			setFailed();
			LOGGER.error("Unknown value for 'known' key '" + PreferenceCache.KEY_DEFAULT_SURVEY_RESPONSE_SHARING_STATE + "'. Is the cache database missing a key-value pair?", e);
		}
{'fraction_non_alphanumeric': 0.10625946491670873, 'fraction_numerical': 0.0005047955577990914, 'mean_word_length': 4.566011235955056, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '5554685', 'n_tokens_mistral': 1256, 'n_tokens_neox': 1134, 'n_words': 290}