<commit_before>package net.spy.memcached.ops;

import java.util.ArrayList;
import java.util.Collection;

import net.spy.memcached.OperationFactory;
import net.spy.memcached.MemcachedNode;

/**
 * Base class for operation factories.
 *
 * <p>
 *   There is little common code between OperationFactory implementations, but
 *   some exists, and is complicated and likely to cause problems.
 * </p>
 */
public abstract class BaseOperationFactory implements OperationFactory {

	private String first(Collection<String> keys) {
		return keys.iterator().next();
	}

	public Collection<Operation> clone(KeyedOperation op) {
		assert op.getState() == OperationState.WRITING
			: "Who passed me an operation in the " + op.getState() + "state?";
		assert !op.isCancelled() : "Attempted to clone a canceled op";<commit_msg>Also check for RETRY during clone.<commit_after>package net.spy.memcached.ops;

import java.util.ArrayList;
import java.util.Collection;

import net.spy.memcached.OperationFactory;
import net.spy.memcached.MemcachedNode;

/**
 * Base class for operation factories.
 *
 * <p>
 *   There is little common code between OperationFactory implementations, but
 *   some exists, and is complicated and likely to cause problems.
 * </p>
 */
public abstract class BaseOperationFactory implements OperationFactory {

	private String first(Collection<String> keys) {
		return keys.iterator().next();
	}

	public Collection<Operation> clone(KeyedOperation op) {
		assert (op.getState() == OperationState.WRITING || op.getState() == OperationState.RETRY)
			: "Who passed me an operation in the " + op.getState() + "state?";
		assert !op.isCancelled() : "Attempted to clone a canceled op";
{'fraction_non_alphanumeric': 0.10841232227488151, 'fraction_numerical': 0.0, 'mean_word_length': 4.725423728813559, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4042806', 'n_tokens_mistral': 500, 'n_tokens_neox': 476, 'n_words': 150}