<commit_before>package com.netflix.discovery;

import javax.inject.Inject;
import javax.inject.Singleton;

import com.google.common.base.Supplier;
import com.google.inject.AbstractModule;
import com.google.inject.Provider;
import com.google.inject.TypeLiteral;
import com.netflix.appinfo.InstanceInfo;
import com.netflix.governator.annotations.binding.DownStatus;
import com.netflix.governator.annotations.binding.UpStatus;
import com.netflix.governator.guice.lazy.LazySingleton;

/**
 * Specific bindings for eureka status checker.
 *
 * Note that this is an internal modules and ASSUMES that a binding for
 * DiscoveryClient was already set.
 *
 * Exposed bindings,
 *
 * @UpStatus   Supplier<Boolean>
 * @DownStatus Supplier<Boolean>
 * @UpStatus   Observable<Boolean>
 *
 * @author elandau
 *
 */
@Singleton
class InternalEurekaStatusModule extends AbstractModule {

    @LazySingleton
    public static class UpStatusProvider implements Provider<Supplier<Boolean>> {
        @Inject
        private Provider<EurekaUpStatusResolver> upStatus;

        @Override
        public Supplier<Boolean> get() {
            final EurekaUpStatusResolver resolver = upStatus.get();
            return new Supplier<Boolean>() {
                @Override
                public Boolean get() {
                    return resolver.getStatus().equals(InstanceInfo.InstanceStatus.UP);
                }
            };
        }
    }

    @LazySingleton
    public static class DownStatusProvider implements Provider<Supplier<Boolean>> {
        @Inject
        private Provider<EurekaUpStatusResolver> upStatus;

        @Override
        public Supplier<Boolean> get() {
            final EurekaUpStatusResolver resolver = upStatus.get();
            return new Supplier<Boolean>() {
                @Override
                public Boolean get() {
                    return !resolver.getStatus().equals(InstanceInfo.InstanceStatus.UP);
                }
            };
        }
    }

    @Override
    protected void configure() {
        bind(new TypeLiteral<Supplier<Boolean>>() { })
            .annotatedWith(UpStatus.class)
            .toProvider(UpStatusProvider.class);

        bind(new TypeLiteral<Supplier<Boolean>>() { })
            .annotatedWith(DownStatus.class)
            .toProvider(DownStatusProvider.class);
    }
}
<commit_msg>@UpStatus, etc., aren't JavaDoc calls; escape them<commit_after>package com.netflix.discovery;

import javax.inject.Inject;
import javax.inject.Singleton;

import com.google.common.base.Supplier;
import com.google.inject.AbstractModule;
import com.google.inject.Provider;
import com.google.inject.TypeLiteral;
import com.netflix.appinfo.InstanceInfo;
import com.netflix.governator.annotations.binding.DownStatus;
import com.netflix.governator.annotations.binding.UpStatus;
import com.netflix.governator.guice.lazy.LazySingleton;

/**
 * Specific bindings for eureka status checker.
 *
 * Note that this is an internal modules and ASSUMES that a binding for
 * DiscoveryClient was already set.
 *
 * Exposed bindings,
 *
 * &#64;UpStatus   Supplier<Boolean>
 * &#64;DownStatus Supplier<Boolean>
 * &#64;UpStatus   Observable<Boolean>
 *
 * @author elandau
 *
 */
@Singleton
class InternalEurekaStatusModule extends AbstractModule {

    @LazySingleton
    public static class UpStatusProvider implements Provider<Supplier<Boolean>> {
        @Inject
        private Provider<EurekaUpStatusResolver> upStatus;

        @Override
        public Supplier<Boolean> get() {
            final EurekaUpStatusResolver resolver = upStatus.get();
            return new Supplier<Boolean>() {
                @Override
                public Boolean get() {
                    return resolver.getStatus().equals(InstanceInfo.InstanceStatus.UP);
                }
            };
        }
    }

    @LazySingleton
    public static class DownStatusProvider implements Provider<Supplier<Boolean>> {
        @Inject
        private Provider<EurekaUpStatusResolver> upStatus;

        @Override
        public Supplier<Boolean> get() {
            final EurekaUpStatusResolver resolver = upStatus.get();
            return new Supplier<Boolean>() {
                @Override
                public Boolean get() {
                    return !resolver.getStatus().equals(InstanceInfo.InstanceStatus.UP);
                }
            };
        }
    }

    @Override
    protected void configure() {
        bind(new TypeLiteral<Supplier<Boolean>>() { })
            .annotatedWith(UpStatus.class)
            .toProvider(UpStatusProvider.class);

        bind(new TypeLiteral<Supplier<Boolean>>() { })
            .annotatedWith(DownStatus.class)
            .toProvider(DownStatusProvider.class);
    }
}

{'fraction_non_alphanumeric': 0.09415241714165083, 'fraction_numerical': 0.001266624445851805, 'mean_word_length': 2.661514683153014, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '1922227', 'n_tokens_mistral': 1293, 'n_tokens_neox': 1251, 'n_words': 262}