<commit_before>package net.forkbox.weblogic;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
import java.util.Arrays;

import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;
import javax.security.auth.x500.X500Principal;

public class WildcardHostnameVerifier implements weblogic.security.SSL.HostnameVerifier {
    public WildcardHostnameVerifier() {
        super();
    }

    /**
     * Parses the Distinguished Name, specifically looking for Common Names.
     * Attempts to adhere relatively strictly to RFC2253.
     */
    public static class DistinguishedNameParser {
        private CharacterIterator iter;
        private String string;
        private DistinguishedNameParser(String name) {
            string = name;
            iter = new StringCharacterIterator(name);
        }
        
        public static String parse(String name) throws UnsupportedEncodingException {
            return (new DistinguishedNameParser(name)).parseDistinguishedName();
        }
        
        /**
         * Expects the iterator to be at the beginning of the string.
         * @return the Common Name contained within this distinguished name
         */
        private String parseDistinguishedName() throws UnsupportedEncodingException {
        	// Parse the first component first
            String name = parseNameComponent();
            if (name != null)
                return name;
            <commit_msg>Shouldn't need public, and it can be imported now.<commit_after>package net.forkbox.weblogic;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
import java.util.Arrays;

import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;
import javax.security.auth.x500.X500Principal;

import weblogic.security.SSL.HostnameVerifier;

public class WildcardHostnameVerifier implements HostnameVerifier {
    public WildcardHostnameVerifier() {
        super();
    }

    /**
     * Parses the Distinguished Name, specifically looking for Common Names.
     * Attempts to adhere relatively strictly to RFC2253.
     */
    private static class DistinguishedNameParser {
        private CharacterIterator iter;
        private String string;
        private DistinguishedNameParser(String name) {
            string = name;
            iter = new StringCharacterIterator(name);
        }
        
        public static String parse(String name) throws UnsupportedEncodingException {
            return (new DistinguishedNameParser(name)).parseDistinguishedName();
        }
        
        /**
         * Expects the iterator to be at the beginning of the string.
         * @return the Common Name contained within this distinguished name
         */
        private String parseDistinguishedName() throws UnsupportedEncodingException {
        	// Parse the first component first
            String name = parseNameComponent();
            if (name != null)
                return name;
            
{'fraction_non_alphanumeric': 0.06960304513322457, 'fraction_numerical': 0.0070690592713431215, 'mean_word_length': 3.092324805339266, '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': '6341787', 'n_tokens_mistral': 925, 'n_tokens_neox': 885, 'n_words': 250}