Skip to content

Commit

Permalink
Remove unused mapStringsOrdered method (elastic#42513)
Browse files Browse the repository at this point in the history
Remove unused mapStringsOrdered method
  • Loading branch information
przemekwitek committed Jun 25, 2019
1 parent c702cd7 commit be4e4e3
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,9 @@ enum NumberType {

Map<String, String> mapStrings() throws IOException;

Map<String, String> mapStringsOrdered() throws IOException;

/**
* Returns an instance of {@link Map} holding parsed map.
* Serves as a replacement for the "map", "mapOrdered", "mapStrings" and "mapStringsOrdered" methods above.
* Serves as a replacement for the "map", "mapOrdered" and "mapStrings" methods above.
*
* @param mapFactory factory for creating new {@link Map} objects
* @param mapValueParser parser for parsing a single map value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ public Map<String, String> mapStrings() throws IOException {
return parser.mapStrings();
}

@Override
public Map<String, String> mapStringsOrdered() throws IOException {
return parser.mapStringsOrdered();
}

@Override
public <T> Map<String, T> map(
Supplier<Map<String, T>> mapFactory, CheckedFunction<XContentParser, T, IOException> mapValueParser) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,6 @@ public Map<String, String> mapStrings() throws IOException {
return readMapStrings(this);
}

@Override
public Map<String, String> mapStringsOrdered() throws IOException {
return readOrderedMapStrings(this);
}

@Override
public <T> Map<String, T> map(
Supplier<Map<String, T>> mapFactory, CheckedFunction<XContentParser, T, IOException> mapValueParser) throws IOException {
Expand All @@ -303,8 +298,6 @@ public List<Object> listOrderedMap() throws IOException {

static final Supplier<Map<String, String>> SIMPLE_MAP_STRINGS_FACTORY = HashMap::new;

static final Supplier<Map<String, String>> ORDERED_MAP_STRINGS_FACTORY = LinkedHashMap::new;

static Map<String, Object> readMap(XContentParser parser) throws IOException {
return readMap(parser, SIMPLE_MAP_FACTORY);
}
Expand All @@ -314,11 +307,7 @@ static Map<String, Object> readOrderedMap(XContentParser parser) throws IOExcept
}

static Map<String, String> readMapStrings(XContentParser parser) throws IOException {
return readMapStrings(parser, SIMPLE_MAP_STRINGS_FACTORY);
}

static Map<String, String> readOrderedMapStrings(XContentParser parser) throws IOException {
return readMapStrings(parser, ORDERED_MAP_STRINGS_FACTORY);
return readGenericMap(parser, SIMPLE_MAP_STRINGS_FACTORY, XContentParser::text);
}

static List<Object> readList(XContentParser parser) throws IOException {
Expand All @@ -333,10 +322,6 @@ static Map<String, Object> readMap(XContentParser parser, Supplier<Map<String, O
return readGenericMap(parser, mapFactory, p -> readValue(p, mapFactory));
}

static Map<String, String> readMapStrings(XContentParser parser, Supplier<Map<String, String>> mapFactory) throws IOException {
return readGenericMap(parser, mapFactory, XContentParser::text);
}

static <T> Map<String, T> readGenericMap(
XContentParser parser,
Supplier<Map<String, T>> mapFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private Map<String, String> readMapStrings(String source) throws IOException {
assertThat(parser.currentName(), equalTo("foo"));
token = parser.nextToken();
assertThat(token, equalTo(XContentParser.Token.START_OBJECT));
return randomBoolean() ? parser.mapStringsOrdered() : parser.mapStrings();
return parser.mapStrings();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@ public Map<String, String> mapStrings() throws IOException {
return parser.mapStrings();
}

@Override
public Map<String, String> mapStringsOrdered() throws IOException {
return parser.mapStringsOrdered();
}

@Override
public <T> Map<String, T> map(
Supplier<Map<String, T>> mapFactory, CheckedFunction<XContentParser, T, IOException> mapValueParser) throws IOException {
Expand Down

0 comments on commit be4e4e3

Please sign in to comment.