<commit_before>package com.googlecode.objectify.impl.cmd;

import java.util.List;

import com.google.appengine.api.datastore.QueryResultIterable;
import com.google.appengine.api.datastore.QueryResultIterator;
import com.googlecode.objectify.Key;
import com.googlecode.objectify.Ref;
import com.googlecode.objectify.cmd.QueryExecute;
import com.googlecode.objectify.cmd.QueryKeys;
import com.googlecode.objectify.util.ResultProxy;

/**
 * Implementation of QueryKeys.
 *
 * @author <NAME> <<EMAIL>>
 */
class QueryKeysImpl<T> implements QueryKeys<T>, Cloneable
{
	QueryImpl<T> impl;
	
	/** */
	QueryKeysImpl(QueryImpl<T> query) {
		assert query.actual.isKeysOnly();
		this.impl = query;
	}

	@Override
	public Ref<T> first() {
		// We are already keysonly
		return impl.first();
	}

	@Override
	public QueryResultIterable<Key<T>> iterable() {
		return impl.keysIterable();
	}

	@Override
	public List<Key<T>> list() {
		return ResultProxy.makeAsyncList(impl.chunk(Integer.MAX_VALUE).keysIterable());
	}

	@Override
	public QueryResultIterator<Key<T>> iterator() {
		return iterable().iterator();
	}

	@Override
	public QueryExecute<T> asEntities() {
		throw new UnsupportedOperationException("TODO");
	}
	
}<commit_msg>Implemented QueryKeys.asEntities()<commit_after>package com.googlecode.objectify.impl.cmd;

import java.util.List;

import com.google.appengine.api.datastore.QueryResultIterable;
import com.google.appengine.api.datastore.QueryResultIterator;
import com.googlecode.objectify.Key;
import com.googlecode.objectify.Ref;
import com.googlecode.objectify.cmd.QueryExecute;
import com.googlecode.objectify.cmd.QueryKeys;
import com.googlecode.objectify.util.ResultProxy;

/**
 * Implementation of QueryKeys.
 *
 * @author <NAME> <<EMAIL>>
 */
class QueryKeysImpl<T> implements QueryKeys<T>
{
	QueryImpl<T> impl;
	
	/** */
	QueryKeysImpl(QueryImpl<T> query) {
		assert query.actual.isKeysOnly();
		this.impl = query;
	}

	@Override
	public Ref<T> first() {
		// We are already keysonly
		return impl.first();
	}

	@Override
	public QueryResultIterable<Key<T>> iterable() {
		return impl.keysIterable();
	}

	@Override
	public List<Key<T>> list() {
		return ResultProxy.makeAsyncList(impl.chunk(Integer.MAX_VALUE).keysIterable());
	}

	@Override
	public QueryResultIterator<Key<T>> iterator() {
		return iterable().iterator();
	}

	@Override
	public QueryExecute<T> asEntities() {
		// Since we are already keys-only, the original query should spit out partials
		return impl;
	}
	
}
{'fraction_non_alphanumeric': 0.13247691690084304, 'fraction_numerical': 0.0, 'mean_word_length': 5.0632603406326036, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '6015727', 'n_tokens_mistral': 857, 'n_tokens_neox': 822, 'n_words': 155}