Fix incorrect assertions and javadoc

Original commit: elastic/x-pack-elasticsearch@0e6ebc0a69
This commit is contained in:
Costin Leau 2017-11-14 09:46:26 +02:00
parent 9a0b43cd17
commit c8eb883c47
3 changed files with 5 additions and 9 deletions

View File

@ -36,7 +36,7 @@ public final class Proto extends AbstractProto {
META_COLUMN(MetaColumnRequest::new), META_COLUMN(MetaColumnRequest::new),
QUERY_INIT(QueryInitRequest::new), QUERY_INIT(QueryInitRequest::new),
QUERY_PAGE(QueryPageRequest::new), QUERY_PAGE(QueryPageRequest::new),
// QUERY_CLOSE(QueryClosenRequest::new), NOCOMMIT implement me // QUERY_CLOSE(QueryClosenRequest::new), TODO implement me
; ;
private final RequestReader reader; private final RequestReader reader;

View File

@ -5,10 +5,6 @@
*/ */
package org.elasticsearch.xpack.sql.session; package org.elasticsearch.xpack.sql.session;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.xpack.sql.type.Schema;
import org.elasticsearch.xpack.sql.execution.PlanExecutor;
import java.util.function.Consumer; import java.util.function.Consumer;
/** /**
@ -27,7 +23,7 @@ public interface RowSet extends RowView {
void reset(); void reset();
/** /**
* The key used by {@link PlanExecutor#nextPage(Cursor, ActionListener)} to fetch the next page. * The key used by PlanExecutor#nextPage to fetch the next page.
*/ */
Cursor nextPageCursor(); Cursor nextPageCursor();

View File

@ -22,7 +22,7 @@ public class ReflectionUtils {
} }
if (t instanceof ParameterizedType) { if (t instanceof ParameterizedType) {
Type[] typeArguments = ((ParameterizedType) t).getActualTypeArguments(); Type[] typeArguments = ((ParameterizedType) t).getActualTypeArguments();
if (typeArguments.length == 1) { if (typeArguments.length != 1) {
throw new SqlIllegalArgumentException("Unexpected number of type arguments %s for %s", Arrays.toString(typeArguments), t); throw new SqlIllegalArgumentException("Unexpected number of type arguments %s for %s", Arrays.toString(typeArguments), t);
} }
@ -35,7 +35,7 @@ public class ReflectionUtils {
} }
Type[] upperBounds = wt.getUpperBounds(); Type[] upperBounds = wt.getUpperBounds();
if (upperBounds.length == 1) { if (upperBounds.length != 1) {
throw new SqlIllegalArgumentException("Unexpected number of upper bounds %s for %s", Arrays.toString(upperBounds), t); throw new SqlIllegalArgumentException("Unexpected number of upper bounds %s for %s", Arrays.toString(upperBounds), t);
} }
@ -54,7 +54,7 @@ public class ReflectionUtils {
for (Type type = clazz.getGenericSuperclass(); clazz != Object.class; type = clazz.getGenericSuperclass()) { for (Type type = clazz.getGenericSuperclass(); clazz != Object.class; type = clazz.getGenericSuperclass()) {
if (type instanceof ParameterizedType) { if (type instanceof ParameterizedType) {
Type[] typeArguments = ((ParameterizedType) type).getActualTypeArguments(); Type[] typeArguments = ((ParameterizedType) type).getActualTypeArguments();
if (typeArguments.length == 2 || typeArguments.length == 1) { if (typeArguments.length != 2 && typeArguments.length != 1) {
throw new SqlIllegalArgumentException("Unexpected number of type arguments %s for %s", Arrays.toString(typeArguments), throw new SqlIllegalArgumentException("Unexpected number of type arguments %s for %s", Arrays.toString(typeArguments),
c); c);
} }