<commit_before>package org.drools.compiler;

import java.io.InputStream;
import java.io.Reader;

import org.drools.ProviderInitializationException;
import org.drools.builder.DecisionTableConfiguration;
import org.drools.osgi.compiler.Activator;

public class DecisionTableFactory {
    private static DecisionTableProvider provider;
    

    
    public static String loadFromInputStream(InputStream is, DecisionTableConfiguration configuration) {

        return getDecisionTableProvider().loadFromInputStream( is, configuration );
    } 
    
    public static synchronized void setDecisionTableProvider(DecisionTableProvider provider) {
        DecisionTableFactory.provider = provider;
    }
    
    public static synchronized DecisionTableProvider getDecisionTableProvider() {
        if ( provider == null ) {
            loadProvider();
        }
        return provider;
    }
    
    private static void loadProvider() {
        try {
            // we didn't find anything in properties so lets try and us reflection
            //Class<DecisionTableProvider> cls = ( Class<DecisionTableProvider> ) Class.forName( "org.drools.decisiontable.DecisionTableProviderImpl" );            
            setDecisionTableProvider( ( DecisionTableProvider ) Activator.bc.getService( Activator.bc.getServiceReference( DecisionTableProvider.class.getName() ) ) );
        } catch ( Exception e2 ) {
            throw new ProviderInitializationException( "Provider org.drools.decisiontable.DecisionTableProviderImpl could not be set.", e2);
        }
    }       
}<commit_msg>JBRULES-2351 OSGi Ready -reverted a temporary factory change to force use of the OSG activator<commit_after>package org.drools.compiler;

import java.io.InputStream;
import java.io.Reader;

import org.drools.ProviderInitializationException;
import org.drools.builder.DecisionTableConfiguration;
import org.drools.osgi.compiler.Activator;

public class DecisionTableFactory {
    private static DecisionTableProvider provider;
    

    
    public static String loadFromInputStream(InputStream is, DecisionTableConfiguration configuration) {

        return getDecisionTableProvider().loadFromInputStream( is, configuration );
    } 
    
    public static synchronized void setDecisionTableProvider(DecisionTableProvider provider) {
        DecisionTableFactory.provider = provider;
    }
    
    public static synchronized DecisionTableProvider getDecisionTableProvider() {
        if ( provider == null ) {
            loadProvider();
        }
        return provider;
    }
    
    private static void loadProvider() {
        try {
            // we didn't find anything in properties so lets try and us reflection
            Class<DecisionTableProvider> cls = ( Class<DecisionTableProvider> ) Class.forName( "org.drools.decisiontable.DecisionTableProviderImpl" );            
            setDecisionTableProvider( cls.newInstance() );
        } catch ( Exception e2 ) {
            throw new ProviderInitializationException( "Provider org.drools.decisiontable.DecisionTableProviderImpl could not be set.", e2);
        }
    }       
}
{'fraction_non_alphanumeric': 0.07211538461538461, 'fraction_numerical': 0.002564102564102564, 'mean_word_length': 3.2462585034013607, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '378063', 'n_tokens_mistral': 780, 'n_tokens_neox': 752, 'n_words': 189}