<commit_before>package com.wesabe.servlet.normalizers;

import java.util.Locale;

import com.wesabe.servlet.normalizers.util.CaseInsensitiveSet;

/**
 * Normalizes HTTP request method names.
 * 
 * @author coda
 *
 */
public class MethodNormalizer implements Normalizer<String> {
	private static final Locale METHOD_LOCALE = Locale.US;
	private static final CaseInsensitiveSet METHOD_NAMES = CaseInsensitiveSet.of(METHOD_LOCALE, "GET", "PUT", "POST", "DELETE", "HEAD", "OPTIONS");
	
	@Override
	public String normalize(String method) throws ValidationException {
		if (METHOD_NAMES.contains(method)) {
			return method.toUpperCase(METHOD_LOCALE);
		}
		
		throw new ValidationException(method, "not a member of " + METHOD_NAMES);
	}

}<commit_msg>Moved MethodNormalizer to use CaseInsensitiveSet#uppercase.<commit_after>package com.wesabe.servlet.normalizers;

import java.util.Locale;

import com.wesabe.servlet.normalizers.util.CaseInsensitiveSet;

/**
 * Normalizes HTTP request method names.
 * 
 * @author coda
 *
 */
public class MethodNormalizer implements Normalizer<String> {
	private static final CaseInsensitiveSet METHODS = CaseInsensitiveSet.of(
		Locale.US,
		"GET", "PUT", "POST", "DELETE", "HEAD", "OPTIONS"
	);
	
	@Override
	public String normalize(String method) throws ValidationException {
		if (METHODS.contains(method)) {
			return METHODS.uppercase(method);
		}
		
		throw new ValidationException(method, "not a member of " + METHODS);
	}

}
{'fraction_non_alphanumeric': 0.1092896174863388, 'fraction_numerical': 0.0, 'mean_word_length': 5.181434599156118, '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': '6035933', 'n_tokens_mistral': 484, 'n_tokens_neox': 437, 'n_words': 109}