Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused mapStringsOrdered method #42513

Merged
merged 2 commits into from
May 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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