Skip to content

Commit

Permalink
Mostly reinstate some asMap calls that should have been that.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmiley committed Nov 13, 2024
1 parent 5e8a5c5 commit 6b3f5d0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion solr/core/src/java/org/apache/solr/cli/ApiTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected String callGet(String url, String credentials) throws Exception {
NamedList<Object> response = solrClient.request(req);
// pretty-print the response to stdout
CharArr arr = new CharArr();
new JSONWriter(arr, 2).write(response.asShallowMap());
new JSONWriter(arr, 2).write(response.asMap(10));
return arr.toString();
}
}
Expand Down
2 changes: 1 addition & 1 deletion solr/core/src/java/org/apache/solr/cli/CreateTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ protected void createCollection(CloudSolrClient cloudSolrClient, CommandLine cli
if (isVerbose()) {
// pretty-print the response to stdout
CharArr arr = new CharArr();
new JSONWriter(arr, 2).write(response.asShallowMap());
new JSONWriter(arr, 2).write(response.asMap(10));
echo(arr.toString());
}
String endMessage =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ public void testClassicFacets() throws Exception { // AKA SimpleFacets
assertTrue(
((NamedList<Object>)
response.getResponse().findRecursive("facet_counts", "facet_heatmaps", "course"))
.asMap(0)
.containsKey("counts_" + courseFormat));
.get("counts_" + courseFormat) != null);
}

// ------ Index data
Expand Down
4 changes: 1 addition & 3 deletions solr/solrj/src/java/org/apache/solr/common/ConfigNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public String txt() {

@Override
public Map<String, String> attributes() {
return empty_attrs;
return Map.of();
}

@Override
Expand Down Expand Up @@ -232,8 +232,6 @@ public boolean isNull() {
public void forEachChild(Function<ConfigNode, Boolean> fun) {}
};

Map<String, String> empty_attrs = Map.of();

class Helpers {
static boolean _bool(Object v, boolean def) {
return v == null ? def : Boolean.parseBoolean(v.toString());
Expand Down

0 comments on commit 6b3f5d0

Please sign in to comment.