Java API: fixed warnings in TermVectorRequest, also called super.validate for index not null check

This commit is contained in:
javanna 2014-08-08 12:05:29 +02:00 committed by Luca Cavanna
parent d49ed93488
commit 7f2b18864c
1 changed files with 6 additions and 13 deletions

View File

@ -168,7 +168,7 @@ public class TermVectorRequest extends SingleShardOperationRequest<TermVectorReq
} }
/** /**
* @returns <code>true</code> if term offsets should be returned. Otherwise * @return <code>true</code> if term offsets should be returned. Otherwise
* <code>false</code> * <code>false</code>
*/ */
public boolean offsets() { public boolean offsets() {
@ -192,7 +192,7 @@ public class TermVectorRequest extends SingleShardOperationRequest<TermVectorReq
} }
/** /**
* @returns <code>true</code> if term payloads should be returned. Otherwise * @return <code>true</code> if term payloads should be returned. Otherwise
* <code>false</code> * <code>false</code>
*/ */
public boolean payloads() { public boolean payloads() {
@ -208,7 +208,7 @@ public class TermVectorRequest extends SingleShardOperationRequest<TermVectorReq
} }
/** /**
* @returns <code>true</code> if term statistics should be returned. * @return <code>true</code> if term statistics should be returned.
* Otherwise <code>false</code> * Otherwise <code>false</code>
*/ */
public boolean termStatistics() { public boolean termStatistics() {
@ -224,7 +224,7 @@ public class TermVectorRequest extends SingleShardOperationRequest<TermVectorReq
} }
/** /**
* @returns <code>true</code> if field statistics should be returned. * @return <code>true</code> if field statistics should be returned.
* Otherwise <code>false</code> * Otherwise <code>false</code>
*/ */
public boolean fieldStatistics() { public boolean fieldStatistics() {
@ -267,10 +267,7 @@ public class TermVectorRequest extends SingleShardOperationRequest<TermVectorReq
@Override @Override
public ActionRequestValidationException validate() { public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null; ActionRequestValidationException validationException = super.validate();
if (index == null) {
validationException = ValidateActions.addValidationError("index is missing", validationException);
}
if (type == null) { if (type == null) {
validationException = ValidateActions.addValidationError("type is missing", validationException); validationException = ValidateActions.addValidationError("type is missing", validationException);
} }
@ -339,15 +336,11 @@ public class TermVectorRequest extends SingleShardOperationRequest<TermVectorReq
public static enum Flag { public static enum Flag {
// Do not change the order of these flags we use // Do not change the order of these flags we use
// the ordinal for encoding! Only append to the end! // the ordinal for encoding! Only append to the end!
Positions, Offsets, Payloads, FieldStatistics, TermStatistics; Positions, Offsets, Payloads, FieldStatistics, TermStatistics
} }
/** /**
* populates a request object (pre-populated with defaults) based on a parser. * populates a request object (pre-populated with defaults) based on a parser.
*
* @param termVectorRequest
* @param parser
* @throws IOException
*/ */
public static void parseRequest(TermVectorRequest termVectorRequest, XContentParser parser) throws IOException { public static void parseRequest(TermVectorRequest termVectorRequest, XContentParser parser) throws IOException {
XContentParser.Token token; XContentParser.Token token;