<commit_before>package com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.client;

import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.AuthProvider;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.AccountRemoteRestpoint;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.ChangesetRemoteRestpoint;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.GroupRemoteRestpoint;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.RepositoryLinkRemoteRestpoint;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.RepositoryRemoteRestpoint;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.SSHRemoteRestpoint;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.ServicesRepositoryRemoteRestpoint;

/**
 * 
 * <h3>Example of use</h3>
 * <pre>
 * RepositoryRemoteRestpoint repositoriesRest = 
 * 				new BitbucketRemoteClient( new TwoLeggedOauthProvider("https://www.bitbucket.org", "coolkey9b9...", "coolsecret040oerre....") ).getRepositoriesRest();
 *
 * List&lt;BitbucketRepository&gt; repositories = repositoriesRest.getAllRepositories("teamname");
 *		
 * <pre>
 *
 * 
 * <br /><br />
 * Created on 12.7.2012, 17:04:43
 * <br /><br />
 * 
 * @see AuthProvider
 * 
 * @author <EMAIL>
 *
 */
public class BitbucketRemoteClient
{
    public static final String BITBUCKET_URL = "https://bitbucket.org";
    
    
	private final AuthProvider provider;
	
	public BitbucketRemoteClient(AuthProvider provider)
	{
		super();
		this.provider = provider;
	}
	
	public GroupRemoteRestpoint getGroupsRest()
    {
		return new GroupRemoteRestpoint(provider.provideRequestor());
	}
	
	public ChangesetRemoteRestpoint getChangesetsRest()
    {
		return new ChangesetRemoteRestpoint(provider.provideRequestor());
	}
	
	public RepositoryRemoteRestpoint getRepositoriesRest()
    {
		return new RepositoryRemoteRestpoint(provider.provideRequestor());
	}
	
	public ServicesRepositoryRemoteRestpoint getServicesRest()
    {
		return new ServicesRepositoryRemoteRestpoint(provider.provideRequestor());
	}
	
	public RepositoryLinkRemoteRestpoint getRepositoryLinksRest()
    {
		return new RepositoryLinkRemoteRestpoint(provider.provideRequestor());
	}
    
    public SSHRemoteRestpoint getSSHRest()
    {
        return new SSHRemoteRestpoint(provider.provideRequestor());
    }
    
    public AccountRemoteRestpoint getAccountRest()
    {
        return new AccountRemoteRestpoint(provider.provideRequestor());
    }

	public AuthProvider getProvider()
	{
		return provider;
	}
	
}
<commit_msg>BBC-217 - BitbcuketRemoteClient will not create new object for every method call (objects are immutable)<commit_after>package com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.client;

import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.AuthProvider;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.RemoteRequestor;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.AccountRemoteRestpoint;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.ChangesetRemoteRestpoint;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.GroupRemoteRestpoint;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.RepositoryLinkRemoteRestpoint;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.RepositoryRemoteRestpoint;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.SSHRemoteRestpoint;
import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.ServiceRemoteRestpoint;

/**
 * 
 * <h3>Example of use</h3>
 * <pre>
 * RepositoryRemoteRestpoint repositoriesRest = 
 * 				new BitbucketRemoteClient( new TwoLeggedOauthProvider("https://www.bitbucket.org", "coolkey9b9...", "coolsecret040oerre....") ).getRepositoriesRest();
 *
 * List&lt;BitbucketRepository&gt; repositories = repositoriesRest.getAllRepositories("teamname");
 *		
 * <pre>
 *
 * 
 * <br /><br />
 * Created on 12.7.2012, 17:04:43
 * <br /><br />
 * 
 * @see AuthProvider
 * 
 * @author <EMAIL>
 *
 */
public class BitbucketRemoteClient
{
    public static final String BITBUCKET_URL = "https://bitbucket.org";
    
    
	private final AuthProvider provider;
    private final AccountRemoteRestpoint        accountRemoteRestpoint;
    private final ChangesetRemoteRestpoint      changesetRemoteRestpoint;
    private final GroupRemoteRestpoint          groupRemoteRestpoint;
    private final RepositoryLinkRemoteRestpoint repositoryLinkRemoteRestpoint;
    private final RepositoryRemoteRestpoint     repositoryRemoteRestpoint;
    private final SSHRemoteRestpoint            sshRemoteRestpoint;
    private final ServiceRemoteRestpoint        serviceRemoteRestpoint;
    
	
	public BitbucketRemoteClient(AuthProvider provider)
	{
		this.provider = provider;
        
        RemoteRequestor requestor = provider.provideRequestor();
        
        this.accountRemoteRestpoint        = new AccountRemoteRestpoint       (requestor);
        this.changesetRemoteRestpoint      = new ChangesetRemoteRestpoint     (requestor);
        this.groupRemoteRestpoint          = new GroupRemoteRestpoint         (requestor);
        this.repositoryLinkRemoteRestpoint = new RepositoryLinkRemoteRestpoint(requestor);
        this.repositoryRemoteRestpoint     = new RepositoryRemoteRestpoint    (requestor);
        this.sshRemoteRestpoint            = new SSHRemoteRestpoint           (requestor);
        this.serviceRemoteRestpoint        = new ServiceRemoteRestpoint       (requestor);
	}
	
    public AccountRemoteRestpoint getAccountRest()
    {
        return accountRemoteRestpoint;
    }
    
	public ChangesetRemoteRestpoint getChangesetsRest()
    {
		return changesetRemoteRestpoint;
	}
    
    public GroupRemoteRestpoint getGroupsRest()
    {
		return groupRemoteRestpoint;
	}
    
	public RepositoryLinkRemoteRestpoint getRepositoryLinksRest()
    {
		return repositoryLinkRemoteRestpoint;
	}
	
	public RepositoryRemoteRestpoint getRepositoriesRest()
    {
		return repositoryRemoteRestpoint;
	}
	
    public SSHRemoteRestpoint getSSHRest()
    {
        return sshRemoteRestpoint;
    }
    
	public ServiceRemoteRestpoint getServicesRest()
    {
		return serviceRemoteRestpoint;
	}

	public AuthProvider getProvider()
	{
		return provider;
	}	
}

{'fraction_non_alphanumeric': 0.08979654275661618, 'fraction_numerical': 0.006577940951506807, 'mean_word_length': 4.416735708367854, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '6726749', 'n_tokens_mistral': 1989, 'n_tokens_neox': 1874, 'n_words': 291}