<commit_before>package com.justbuyit.auth;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

import oauth.signpost.OAuthConsumer;
import oauth.signpost.basic.DefaultOAuthConsumer;
import oauth.signpost.exception.OAuthException;

/**
 * OAuth-based outgoing connection signer.
 */
public class ConnectionSigner {

    private OAuthConsumer consumer;

    /**
     * Creates a connection signer with the given consumer key/secret
     * 
     * @param consumerKey
     *            the consumer key
     * @param consumerSecret
     *            the consumer secret
     */
    public ConnectionSigner(String consumerKey, String consumerSecret) {
        consumer = new DefaultOAuthConsumer(consumerKey, consumerSecret);
    }

    /**
     * Opens and signs a HTTP connection to the given URL.
     * 
     * @param url
     *            the URL
     * @return the connection
     * @throws IOException
     * @throws OAuthException
     */
    public HttpURLConnection openSignedConnection(URL url) throws IOException, OAuthException {
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        consumer.sign(conn);
        conn.connect();
        return conn;
    }

}<commit_msg>Minor update to comments<commit_after>package com.justbuyit.auth;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

import oauth.signpost.OAuthConsumer;
import oauth.signpost.basic.DefaultOAuthConsumer;
import oauth.signpost.exception.OAuthException;

/**
 * OAuth-based outgoing connection signer.
 */
public class ConnectionSigner {

    private OAuthConsumer consumer;

    /**
     * Creates a connection signer with the given consumer key/secret
     * 
     * @param consumerKey
     *            the consumer key
     * @param consumerSecret
     *            the consumer secret
     */
    public ConnectionSigner(String consumerKey, String consumerSecret) {
        consumer = new DefaultOAuthConsumer(consumerKey, consumerSecret);
    }

    /**
     * Opens a HTTP connection to the given URL, signs it with the app's OAuth credentials, then connects to it.
     * 
     * @param url
     *            the URL
     * @return the signed connection
     * @throws IOException
     * @throws OAuthException
     */
    public HttpURLConnection openSignedConnection(URL url) throws IOException, OAuthException {
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        consumer.sign(conn);
        conn.connect();
        return conn;
    }

}
{'fraction_non_alphanumeric': 0.07870007830853563, 'fraction_numerical': 0.0, 'mean_word_length': 2.779585798816568, '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': '2764321', 'n_tokens_mistral': 685, 'n_tokens_neox': 665, 'n_words': 189}