<commit_before>/*
 * Copyright 2006-2008 Sxip Identity Corporation
 */

package org.openid4java.discovery;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.net.*;
import java.util.Set;
import java.util.HashSet;
import java.io.UnsupportedEncodingException;

/**
 * @author <NAME>, <NAME>
 */
public class UrlIdentifier implements Identifier
{
    private static Log _log = LogFactory.getLog(UrlIdentifier.class);
    private static final boolean DEBUG = _log.isDebugEnabled();

    private static final Set UNRESERVED_CHARACTERS = new HashSet();

    static
    {
        for (char c = 'a'; c <= 'z'; c++)
            UNRESERVED_CHARACTERS.add(new Character(c));

        for (char c = 'A'; c <= 'A'; c++)
            UNRESERVED_CHARACTERS.add(new Character(c));

        for (char c = '0'; c <= '9'; c++)
            UNRESERVED_CHARACTERS.add(new Character(c));

        UNRESERVED_CHARACTERS.add(new Character('-'));
        UNRESERVED_CHARACTERS.add(new Character('.'));
        UNRESERVED_CHARACTERS.add(new Character('_'));<commit_msg>Fixed bug in URL encoding normalization. Thanks <NAME> for finding this!<commit_after>/*
 * Copyright 2006-2008 Sxip Identity Corporation
 */

package org.openid4java.discovery;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.net.*;
import java.util.Set;
import java.util.HashSet;
import java.io.UnsupportedEncodingException;

/**
 * @author <NAME>, <NAME>
 */
public class UrlIdentifier implements Identifier
{
    private static Log _log = LogFactory.getLog(UrlIdentifier.class);
    private static final boolean DEBUG = _log.isDebugEnabled();

    private static final Set UNRESERVED_CHARACTERS = new HashSet();

    static
    {
        for (char c = 'a'; c <= 'z'; c++)
            UNRESERVED_CHARACTERS.add(new Character(c));

        for (char c = 'A'; c <= 'Z'; c++)
            UNRESERVED_CHARACTERS.add(new Character(c));

        for (char c = '0'; c <= '9'; c++)
            UNRESERVED_CHARACTERS.add(new Character(c));

        UNRESERVED_CHARACTERS.add(new Character('-'));
        UNRESERVED_CHARACTERS.add(new Character('.'));
        UNRESERVED_CHARACTERS.add(new Character('_'));
{'fraction_non_alphanumeric': 0.13321412606168975, 'fraction_numerical': 0.009834599910594547, 'mean_word_length': 3.4404761904761907, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 8, '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': '6639916', 'n_tokens_mistral': 720, 'n_tokens_neox': 694, 'n_words': 169}