<commit_before>package plugins;

import com.google.inject.AbstractModule;
import com.google.inject.Provider;
import com.typesafe.config.ConfigFactory;
import io.sphere.sdk.categories.Category;
import io.sphere.sdk.categories.CategoryTree;
import io.sphere.sdk.categories.queries.CategoryQuery;
import io.sphere.sdk.client.PlayJavaClient;
import io.sphere.sdk.client.PlayJavaClientImpl;
import io.sphere.sdk.queries.PagedQueryResult;
import play.Application;
import play.Configuration;
import play.Logger;

import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.concurrent.TimeUnit;

/**
 * Configuration for the Guice {@link com.google.inject.Injector} which
 * shall be used in production and integration tests.
 */
class ProductionModule extends AbstractModule {
    private final Application app;

    public ProductionModule(Application app) {
        this.app = app;
    }

    @Override
    protected void configure() {
        bind(PlayJavaClient.class).toProvider(PlayJavaClientProvider.class).in(Singleton.class);
        bind(CategoryTree.class).toProvider(CategoryTreeProvider.class).in(Singleton.class);
        bind(Configuration.class).toInstance(app.configuration());
    }

    @Singleton
    private static class CategoryTreeProvider implements Provider<CategoryTree> {
        private final PlayJavaClient client;

        @Inject
        private CategoryTreeProvider(final PlayJavaClient client) {
            this.client = client;
        }

        @Override
        public CategoryTree get() {
            Logger.info("categoryTreeProvider");
            final PagedQueryResult<Category> pagedQueryResult = client.execute(CategoryQuery.of()).get(2000, TimeUnit.MILLISECONDS);//TODO this will be most likely moved to a plugin
            return CategoryTree.of(pagedQueryResult.getResults());
        }
    }


    @Singleton
    private static class PlayJavaClientProvider implements Provider<PlayJavaClient> {
        @Override
        public PlayJavaClient get() {
            Logger.info("playJavaClientProvider");<commit_msg>Improve DI provider log messages.<commit_after>package plugins;

import com.google.inject.AbstractModule;
import com.google.inject.Provider;
import com.typesafe.config.ConfigFactory;
import io.sphere.sdk.categories.Category;
import io.sphere.sdk.categories.CategoryTree;
import io.sphere.sdk.categories.queries.CategoryQuery;
import io.sphere.sdk.client.PlayJavaClient;
import io.sphere.sdk.client.PlayJavaClientImpl;
import io.sphere.sdk.queries.PagedQueryResult;
import play.Application;
import play.Configuration;
import play.Logger;

import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.concurrent.TimeUnit;

/**
 * Configuration for the Guice {@link com.google.inject.Injector} which
 * shall be used in production and integration tests.
 */
class ProductionModule extends AbstractModule {
    private final Application app;

    public ProductionModule(Application app) {
        this.app = app;
    }

    @Override
    protected void configure() {
        bind(PlayJavaClient.class).toProvider(PlayJavaClientProvider.class).in(Singleton.class);
        bind(CategoryTree.class).toProvider(CategoryTreeProvider.class).in(Singleton.class);
        bind(Configuration.class).toInstance(app.configuration());
    }

    @Singleton
    private static class CategoryTreeProvider implements Provider<CategoryTree> {
        private final PlayJavaClient client;

        @Inject
        private CategoryTreeProvider(final PlayJavaClient client) {
            this.client = client;
        }

        @Override
        public CategoryTree get() {
            Logger.info("execute CategoryTreeProvider.get()");
            final PagedQueryResult<Category> pagedQueryResult = client.execute(CategoryQuery.of()).get(2000, TimeUnit.MILLISECONDS);//TODO this will be most likely moved to a plugin
            return CategoryTree.of(pagedQueryResult.getResults());
        }
    }


    @Singleton
    private static class PlayJavaClientProvider implements Provider<PlayJavaClient> {
        @Override
        public PlayJavaClient get() {
            Logger.info("execute PlayJavaClientProvider.get()");
{'fraction_non_alphanumeric': 0.0913645038167939, 'fraction_numerical': 0.0019083969465648854, 'mean_word_length': 3.786529680365297, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6938799', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1075, 'n_words': 241}