sonatype-lift[bot] commented on code in PR #1182:
URL: https://github.com/apache/solr/pull/1182#discussion_r1050663419


##########
solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java:
##########
@@ -268,19 +270,21 @@ public Map<String, SolrPackageInstance> 
getPackagesDeployedAsClusterLevelPlugins
     MultiValuedMap<String, PluginMeta> packagePlugins = new 
HashSetValuedHashMap<>();
     Map<String, Object> result;
     try {
-      result =
-          (Map<String, Object>)
-              Utils.executeGET(
-                  solrClient.getHttpClient(),
-                  solrBaseUrl + PackageUtils.CLUSTERPROPS_PATH,
-                  Utils.JSONCONSUMER);
-    } catch (SolrException ex) {
-      if (ex.code() == ErrorCode.NOT_FOUND.code) {
+      NamedList<Object> response =
+          solrClient.request(
+              new GenericSolrRequest(
+                  SolrRequest.METHOD.GET,
+                  PackageUtils.CLUSTERPROPS_PATH,
+                  new ModifiableSolrParams()));
+      Integer statusCode = (Integer) ((NamedList) 
response.get("responseHeader")).get("status");

Review Comment:
   <picture><img alt="19% of developers fix this issue" 
src="https://lift.sonatype.com/api/commentimage/fixrate/19/display.svg";></picture>
   
   đŸ’Ŧ 3 similar findings have been found in this PR
   
   ---
   
   *NULL_DEREFERENCE:*  object returned by `response.get("responseHeader")` 
could be null and is dereferenced at line 279.
   
   ---
   
   <details><summary><b>🔎 Expand here to view all instances of this 
finding</b></summary><br/>
     
     
   <div align=\"center\">
   
   
   | **File Path** | **Line Number** |
   | ------------- | ------------- |
   | solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java | 
[280](https://github.com/apache/solr/blob/6d3950de6ee760a6cd7fa93014fd9533fb25ea85/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java#L280)
 |
   | solr/core/src/java/org/apache/solr/packagemanager/PackageUtils.java | 
[201](https://github.com/apache/solr/blob/6d3950de6ee760a6cd7fa93014fd9533fb25ea85/solr/core/src/java/org/apache/solr/packagemanager/PackageUtils.java#L201)
 |
   | solr/core/src/java/org/apache/solr/packagemanager/PackageUtils.java | 
[201](https://github.com/apache/solr/blob/6d3950de6ee760a6cd7fa93014fd9533fb25ea85/solr/core/src/java/org/apache/solr/packagemanager/PackageUtils.java#L201)
 |
   <p><a 
href="https://lift.sonatype.com/results/github.com/apache/solr/01GMD9JPHAWQ4DBYVB5ZQF0BNB?t=Infer|NULL_DEREFERENCE"
 target="_blank">Visit the Lift Web Console</a> to find more details in your 
report.</p></div></details>
   
   
   
   ---
   
   <details><summary><b>ℹī¸ Learn about @sonatype-lift commands</b></summary>
   
   You can reply with the following commands. For example, reply with 
***@sonatype-lift ignoreall*** to leave out all findings.
   | **Command** | **Usage** |
   | ------------- | ------------- |
   | `@sonatype-lift ignore` | Leave out the above finding from this PR |
   | `@sonatype-lift ignoreall` | Leave out all the existing findings from this 
PR |
   | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified 
`file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
   
   **Note:** When talking to LiftBot, you need to **refresh** the page to see 
its response.
   <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) 
to add LiftBot to another repo.</sub></details>
   
   
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not 
relevant](https://www.sonatype.com/lift-comment-rating?comment=362095266&lift_comment_rating=1)
 ] - [ [😕 Won't 
fix](https://www.sonatype.com/lift-comment-rating?comment=362095266&lift_comment_rating=2)
 ] - [ [😑 Not critical, will 
fix](https://www.sonatype.com/lift-comment-rating?comment=362095266&lift_comment_rating=3)
 ] - [ [🙂 Critical, will 
fix](https://www.sonatype.com/lift-comment-rating?comment=362095266&lift_comment_rating=4)
 ] - [ [😊 Critical, fixing 
now](https://www.sonatype.com/lift-comment-rating?comment=362095266&lift_comment_rating=5)
 ]



-- 
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