<commit_before>/*
 * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
/**
 * Generated file

 * Generated from: yang module name: reconnect-strategy  yang module local name: timed-reconnect-strategy
 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
 * Generated at: Tue Nov 12 13:27:18 CET 2013
 *
 * Do not modify this file unless it is present under src/main directory
 */
package org.opendaylight.controller.config.yang.reconnectstrategy;

import io.netty.util.concurrent.EventExecutor;

import org.opendaylight.controller.config.api.JmxAttributeValidationException;
import org.opendaylight.protocol.framework.ReconnectStrategy;
import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
import org.opendaylight.protocol.framework.TimedReconnectStrategy;

import com.google.common.base.Preconditions;

/**
*
*/
public final class TimedReconnectStrategyModule extends
        org.opendaylight.controller.config.yang.reconnectstrategy.AbstractTimedReconnectStrategyModule {

    public TimedReconnectStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
            org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
        super(identifier, dependencyResolver);
    }

    public TimedReconnectStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
            org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
            TimedReconnectStrategyModule oldModule, java.lang.AutoCloseable oldInstance) {
        super(identifier, dependencyResolver, oldModule, oldInstance);
    }

    @Override
    public void validate() {
        super.validate();
        JmxAttributeValidationException.checkNotNull(getSleepFactor(), "value is not set.", sleepFactorJmxAttribute);
        JmxAttributeValidationException.checkCondition(getSleepFactor().doubleValue() >= 1, "value " + getSleepFactor()
                + " is less than 1", sleepFactorJmxAttribute);

        JmxAttributeValidationException.checkNotNull(getConnectTime(), "value is not set.", connectTimeJmxAttribute);
        JmxAttributeValidationException.checkCondition(getConnectTime() >= 0, "value " + getConnectTime()
                + " is less than 0", connectTimeJmxAttribute);

        JmxAttributeValidationException.checkNotNull(getMinSleep(), "value is not set.", minSleepJmxAttribute);
        JmxAttributeValidationException.checkCondition(getMaxSleep() == null || getMinSleep() <= getMaxSleep(),
                "value " + getMinSleep() + " is greter than MaxSleep " + getMaxSleep(), minSleepJmxAttribute);
    }

    @Override
    public java.lang.AutoCloseable createInstance() {
        return new TimedReconnectStrategyFactory(getExecutorDependency(),
                getConnectTime(), getMinSleep(), getSleepFactor().doubleValue(), getMaxSleep(), getMaxAttempts(),
                getDeadline());
    }

    private static final class TimedReconnectStrategyFactory implements ReconnectStrategyFactory, AutoCloseable {

        private final EventExecutor executor;
        private final long deadline, maxAttempts, maxSleep;
        private final double sleepFactor;
        private final int connectTime;
        private final long minSleep;

        public TimedReconnectStrategyFactory(final EventExecutor executor, final int connectTime, final long minSleep, final double sleepFactor,
                final Long maxSleep, final Long maxAttempts, final Long deadline) {
            Preconditions.checkArgument(maxSleep == null || minSleep <= maxSleep);
            Preconditions.checkArgument(sleepFactor >= 1);
            Preconditions.checkArgument(connectTime >= 0);
            this.executor = Preconditions.checkNotNull(executor);
            this.deadline = deadline;
            this.maxAttempts = maxAttempts;
            this.minSleep = minSleep;
            this.maxSleep = maxSleep;
            this.sleepFactor = sleepFactor;
            this.connectTime = connectTime;
        }

        @Override
        public void close() throws Exception {
            // no-op
        }

        @Override
        public ReconnectStrategy createReconnectStrategy() {
            return new TimedReconnectStrategy(this.executor,
                    this.connectTime, this.minSleep, this.sleepFactor, this.maxSleep, this.maxAttempts,
                    this.deadline);
        }

    }<commit_msg>Fix TimedReconnectStrategyFactory - optional parameters must be objects not simple types.<commit_after>/*
 * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
/**
 * Generated file

 * Generated from: yang module name: reconnect-strategy  yang module local name: timed-reconnect-strategy
 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
 * Generated at: Tue Nov 12 13:27:18 CET 2013
 *
 * Do not modify this file unless it is present under src/main directory
 */
package org.opendaylight.controller.config.yang.reconnectstrategy;

import io.netty.util.concurrent.EventExecutor;

import org.opendaylight.controller.config.api.JmxAttributeValidationException;
import org.opendaylight.protocol.framework.ReconnectStrategy;
import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
import org.opendaylight.protocol.framework.TimedReconnectStrategy;

import com.google.common.base.Preconditions;

/**
*
*/
public final class TimedReconnectStrategyModule extends
        org.opendaylight.controller.config.yang.reconnectstrategy.AbstractTimedReconnectStrategyModule {

    public TimedReconnectStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
            org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
        super(identifier, dependencyResolver);
    }

    public TimedReconnectStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
            org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
            TimedReconnectStrategyModule oldModule, java.lang.AutoCloseable oldInstance) {
        super(identifier, dependencyResolver, oldModule, oldInstance);
    }

    @Override
    public void validate() {
        super.validate();
        JmxAttributeValidationException.checkNotNull(getSleepFactor(), "value is not set.", sleepFactorJmxAttribute);
        JmxAttributeValidationException.checkCondition(getSleepFactor().doubleValue() >= 1, "value " + getSleepFactor()
                + " is less than 1", sleepFactorJmxAttribute);

        JmxAttributeValidationException.checkNotNull(getConnectTime(), "value is not set.", connectTimeJmxAttribute);
        JmxAttributeValidationException.checkCondition(getConnectTime() >= 0, "value " + getConnectTime()
                + " is less than 0", connectTimeJmxAttribute);

        JmxAttributeValidationException.checkNotNull(getMinSleep(), "value is not set.", minSleepJmxAttribute);
        JmxAttributeValidationException.checkCondition(getMaxSleep() == null || getMinSleep() <= getMaxSleep(),
                "value " + getMinSleep() + " is greter than MaxSleep " + getMaxSleep(), minSleepJmxAttribute);
    }

    @Override
    public java.lang.AutoCloseable createInstance() {
        return new TimedReconnectStrategyFactory(getExecutorDependency(),
                getConnectTime(), getMinSleep(), getSleepFactor().doubleValue(), getMaxSleep(), getMaxAttempts(),
                getDeadline());
    }

    private static final class TimedReconnectStrategyFactory implements ReconnectStrategyFactory, AutoCloseable {

        private final EventExecutor executor;
        private final Long deadline, maxAttempts, maxSleep;
        private final double sleepFactor;
        private final int connectTime;
        private final long minSleep;

        public TimedReconnectStrategyFactory(final EventExecutor executor, final int connectTime, final long minSleep, final double sleepFactor,
                final Long maxSleep, final Long maxAttempts, final Long deadline) {
            Preconditions.checkArgument(maxSleep == null || minSleep <= maxSleep);
            Preconditions.checkArgument(sleepFactor >= 1);
            Preconditions.checkArgument(connectTime >= 0);
            this.executor = Preconditions.checkNotNull(executor);
            this.deadline = deadline;
            this.maxAttempts = maxAttempts;
            this.minSleep = minSleep;
            this.maxSleep = maxSleep;
            this.sleepFactor = sleepFactor;
            this.connectTime = connectTime;
        }

        @Override
        public void close() throws Exception {
            // no-op
        }

        @Override
        public ReconnectStrategy createReconnectStrategy() {
            return new TimedReconnectStrategy(this.executor,
                    this.connectTime, this.minSleep, this.sleepFactor, this.maxSleep, this.maxAttempts,
                    this.deadline);
        }

    }
{'fraction_non_alphanumeric': 0.08243500317057705, 'fraction_numerical': 0.00549566687803847, 'mean_word_length': 3.4827096162955944, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, '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': '6208860', 'n_tokens_mistral': 2490, 'n_tokens_neox': 2308, 'n_words': 559}