<commit_before>package gov.nih.nci.ispy.util;

import org.apache.log4j.Logger;
import org.apache.commons.pool.ObjectPool;
import org.apache.commons.pool.PoolableObjectFactory;
import org.apache.commons.pool.impl.StackObjectPool;

/**
 * This class uses the loadLists method from list loader to read any text files
 * placed in the dat_files directory of the project. It also loads (as "userLists")
 * all the predefined clinical status groups found in the ISPY study(e.g ER+, ER-, etc)
 * @author rossok
 * @param 
 *
 */

public class ISPYPublicUserPool {
	private static Logger logger = Logger.getLogger(ISPYPublicUserPool.class);
	private static ISPYPublicUserPool instance = null;

    private ObjectPool pool;

    private ISPYPublicUserPool()
    {
        PoolableObjectFactory factory = new ISPYPublicUserFactory();
        String size = System.getProperty("gov.nih.nci.ispyportal.gp.publicuser.poolsize");
        pool = new StackObjectPool(factory, Integer.parseInt(size));
    }
    
    public static ISPYPublicUserPool getInstance(){
    	if (instance != null)
    		return instance;
    	else 
    		return new ISPYPublicUserPool();
    }
    public String borrowPublicUser(){
    	try{
    		return (String)pool.borrowObject();
    	}catch (Exception e){
    		logger.error(e.getMessage());
    		return null;
    	}
    }
    public void returnPublicUser(String user){
    	try{
    		pool.returnObject(user);
    	}catch (Exception e){
    		logger.error(e.getMessage());
    	}
    }
}
<commit_msg>Now implement PublicUserPool interface for the sake of SessionTracker class.<commit_after>package gov.nih.nci.ispy.util;

import org.apache.log4j.Logger;
import org.apache.commons.pool.ObjectPool;
import org.apache.commons.pool.PoolableObjectFactory;
import org.apache.commons.pool.impl.StackObjectPool;
import gov.nih.nci.caintegrator.security.PublicUserPool;
/**
 * This class uses the loadLists method from list loader to read any text files
 * placed in the dat_files directory of the project. It also loads (as "userLists")
 * all the predefined clinical status groups found in the ISPY study(e.g ER+, ER-, etc)
 * @author rossok
 * @param 
 *
 */

public class ISPYPublicUserPool implements PublicUserPool{
	private static Logger logger = Logger.getLogger(ISPYPublicUserPool.class);
	private static PublicUserPool instance = null;

    private ObjectPool pool;

    private ISPYPublicUserPool()
    {
        PoolableObjectFactory factory = new ISPYPublicUserFactory();
        String size = System.getProperty("gov.nih.nci.ispyportal.gp.publicuser.poolsize");
        pool = new StackObjectPool(factory, Integer.parseInt(size));
    }
    
    public static PublicUserPool getInstance(){
    	if (instance != null)
    		return instance;
    	else 
    		return new ISPYPublicUserPool();
    }
    public String borrowPublicUser(){
    	try{
    		return (String)pool.borrowObject();
    	}catch (Exception e){
    		logger.error(e.getMessage());
    		return null;
    	}
    }
    public void returnPublicUser(String user){
    	try{
    		pool.returnObject(user);
    	}catch (Exception e){
    		logger.error(e.getMessage());
    	}
    }
}

{'fraction_non_alphanumeric': 0.09690656565656566, 'fraction_numerical': 0.0006313131313131314, 'mean_word_length': 3.4259776536312847, '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': '5929849', 'n_tokens_mistral': 957, 'n_tokens_neox': 951, 'n_words': 249}