org.elasticsearch.common.collect.Tuple have 2 identical methods, closes #1922.

This commit is contained in:
Shay Banon 2012-05-08 13:38:14 +03:00
parent 68a321ec0c
commit 927b4385a8
3 changed files with 3 additions and 14 deletions

View File

@ -171,7 +171,7 @@ public class TransportShardBulkAction extends TransportShardReplicationOperation
if (mappingsToUpdate == null) {
mappingsToUpdate = Sets.newHashSet();
}
mappingsToUpdate.add(Tuple.create(indexRequest.index(), indexRequest.type()));
mappingsToUpdate.add(Tuple.tuple(indexRequest.index(), indexRequest.type()));
}
// if we are going to percolate, then we need to keep this op for the postPrimary operation

View File

@ -63,15 +63,4 @@ public class Tuple<V1, V2> {
result = 31 * result + (v2 != null ? v2.hashCode() : 0);
return result;
}
/**
* Helper function to create a tuple.
*
* @param v1 the first element for the resulting tuple
* @param v2 the second element for the resulting tuple
* @return the tuple (<code>v1</code>,<code>v2</code>)
*/
public static <V1, V2> Tuple<V1, V2> create(V1 v1, V2 v2) {
return new Tuple<V1, V2>(v1, v2);
}
}

View File

@ -65,9 +65,9 @@ public class XContentHelper {
parser = XContentFactory.xContent(contentType).createParser(data, offset, length);
}
if (ordered) {
return Tuple.create(contentType, parser.mapOrderedAndClose());
return Tuple.tuple(contentType, parser.mapOrderedAndClose());
} else {
return Tuple.create(contentType, parser.mapAndClose());
return Tuple.tuple(contentType, parser.mapAndClose());
}
} catch (IOException e) {
throw new ElasticSearchParseException("Failed to parse content to map", e);