Skip to content

Commit

Permalink
Minor fix: renaming read/writeNamedWritableList() to read/writeNamedW…
Browse files Browse the repository at this point in the history
…riteabelList() for consistency

The method for reading and writing single instances is called `read/writeNamedWriteable()`,
so the list version should be spelled the same.
  • Loading branch information
cbuescher committed Jun 23, 2015
1 parent 7653376 commit b2606d9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ public <C> C readNamedWriteable() throws IOException {
* Reads a list of {@link NamedWriteable} from the current stream, by first reading its size and then
* reading the individual objects using {@link #readNamedWriteable()}.
*/
public <C> List<C> readNamedWritableList() throws IOException {
public <C> List<C> readNamedWriteableList() throws IOException {
List<C> list = new ArrayList<>();
int size = readInt();
for (int i = 0; i < size; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public void writeNamedWriteable(NamedWriteable namedWriteable) throws IOExceptio
* Writes a list of {@link NamedWriteable} to the current stream, by first writing its size and then iterating over the objects
* in the list
*/
public void writeNamedWritableList(List<? extends NamedWriteable> list) throws IOException {
public void writeNamedWriteableList(List<? extends NamedWriteable> list) throws IOException {
writeInt(list.size());
for (NamedWriteable obj : list) {
writeNamedWriteable(obj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public boolean doEquals(AndQueryBuilder other) {
@Override
public AndQueryBuilder readFrom(StreamInput in) throws IOException {
AndQueryBuilder andQueryBuilder = new AndQueryBuilder();
List<QueryBuilder> queryBuilders = in.readNamedWritableList();
List<QueryBuilder> queryBuilders = in.readNamedWriteableList();
for (QueryBuilder queryBuilder : queryBuilders) {
andQueryBuilder.add(queryBuilder);
}
Expand All @@ -155,7 +155,7 @@ public AndQueryBuilder readFrom(StreamInput in) throws IOException {

@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeNamedWritableList(this.filters);
out.writeNamedWriteableList(this.filters);
out.writeOptionalString(queryName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,13 @@ public boolean doEquals(BoolQueryBuilder other) {
@Override
public BoolQueryBuilder readFrom(StreamInput in) throws IOException {
BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder();
List<QueryBuilder> queryBuilders = in.readNamedWritableList();
List<QueryBuilder> queryBuilders = in.readNamedWriteableList();
boolQueryBuilder.mustClauses.addAll(queryBuilders);
queryBuilders = in.readNamedWritableList();
queryBuilders = in.readNamedWriteableList();
boolQueryBuilder.mustNotClauses.addAll(queryBuilders);
queryBuilders = in.readNamedWritableList();
queryBuilders = in.readNamedWriteableList();
boolQueryBuilder.shouldClauses.addAll(queryBuilders);
queryBuilders = in.readNamedWritableList();
queryBuilders = in.readNamedWriteableList();
boolQueryBuilder.filterClauses.addAll(queryBuilders);
boolQueryBuilder.boost = in.readFloat();
boolQueryBuilder.adjustPureNegative = in.readBoolean();
Expand All @@ -369,10 +369,10 @@ public BoolQueryBuilder readFrom(StreamInput in) throws IOException {

@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeNamedWritableList(this.mustClauses);
out.writeNamedWritableList(this.mustNotClauses);
out.writeNamedWritableList(this.shouldClauses);
out.writeNamedWritableList(this.filterClauses);
out.writeNamedWriteableList(this.mustClauses);
out.writeNamedWriteableList(this.mustNotClauses);
out.writeNamedWriteableList(this.shouldClauses);
out.writeNamedWriteableList(this.filterClauses);
out.writeFloat(this.boost);
out.writeBoolean(this.adjustPureNegative);
out.writeBoolean(this.disableCoord);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public QueryValidationException validate() {
@Override
public DisMaxQueryBuilder readFrom(StreamInput in) throws IOException {
DisMaxQueryBuilder disMax = new DisMaxQueryBuilder();
List<QueryBuilder> queryBuilders = in.readNamedWritableList();
List<QueryBuilder> queryBuilders = in.readNamedWriteableList();
disMax.queries.addAll(queryBuilders);
disMax.tieBreaker = in.readFloat();
disMax.queryName = in.readOptionalString();
Expand All @@ -169,7 +169,7 @@ public DisMaxQueryBuilder readFrom(StreamInput in) throws IOException {

@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeNamedWritableList(this.queries);
out.writeNamedWriteableList(this.queries);
out.writeFloat(tieBreaker);
out.writeOptionalString(queryName);
out.writeFloat(boost);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public boolean doEquals(OrQueryBuilder other) {
@Override
public OrQueryBuilder readFrom(StreamInput in) throws IOException {
OrQueryBuilder orQueryBuilder = new OrQueryBuilder();
List<QueryBuilder> queryBuilders = in.readNamedWritableList();
List<QueryBuilder> queryBuilders = in.readNamedWriteableList();
for (QueryBuilder queryBuilder : queryBuilders) {
orQueryBuilder.add(queryBuilder);
}
Expand All @@ -154,7 +154,7 @@ public OrQueryBuilder readFrom(StreamInput in) throws IOException {

@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeNamedWritableList(this.filters);
out.writeNamedWriteableList(this.filters);
out.writeOptionalString(queryName);
}
}

0 comments on commit b2606d9

Please sign in to comment.