sonatype-lift[bot] commented on a change in pull request #560:
URL: https://github.com/apache/solr/pull/560#discussion_r805289794



##########
File path: solr/core/src/java/org/apache/solr/util/PackageTool.java
##########
@@ -105,12 +120,38 @@ protected void runImpl(CommandLine cli) throws Exception {
                 break;
               case "list-available":
                 PackageUtils.printGreen("Available packages:\n-----");
+
+
+                AsciiTable table = new AsciiTable();
+                table.addRule();
+                table.addRow("Name", "Description", "Versions", "Repository");
+                table.addRule();
+
+                SolrResponse resp = new V2Request.Builder("/node/packages")
+                        .withMethod(SolrRequest.METHOD.GET)
+                        .build().process(cloudSolrClient);
+                Map<String, Object> local = (Map<String, Object>) new 
ObjectMapper().readValue(resp.jsonStr(), Map.class);
+                local = (Map<String, Object>) local.get("packages");
+                for (String pkg: local.keySet()) {
+                  String versions = "";
+                  for (Map<String, Object> version: ((List<Map<String, 
Object>>) ((Map<String, Object>) local.get(pkg)).get("versions"))) {

Review comment:
       *INEFFICIENT_KEYSET_ITERATOR:*  Accessing a value using a key that was 
retrieved from a `keySet` iterator. It is more efficient to use an iterator on 
the `entrySet` of the map, avoiding the extra `HashMap.get(key)` lookup.
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with 
`help` or `ignore`)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to