You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2023/01/03 07:27:23 UTC

[GitHub] [solr] sonatype-lift[bot] commented on a diff in pull request #1266: Solr fkltr 9 1

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


##########
solr/core/src/java/org/apache/solr/search/facet/FacetModule.java:
##########
@@ -380,26 +400,24 @@ public Object getMergedResult() {
       return getDouble();
     }
 
-
     @Override
     public int compareTo(FacetSortableMerger other, FacetRequest.SortDirection direction) {
       return compare(getDouble(), ((FacetDoubleMerger) other).getDouble(), direction);
     }
 
-
     public static int compare(double a, double b, FacetRequest.SortDirection direction) {
       if (a < b) return -1;
       if (a > b) return 1;
 
-      if (a != a) {  // a==NaN
+      if (a != a) { // a==NaN

Review Comment:
   <picture><img alt="26% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/26/display.svg"></picture>
   
   đŸ’Ŧ 2 similar findings have been found in this PR
   
   ---
   
   *opt.semgrep.java.lang.correctness.eqeq.eqeq:*  `a == a` or `a != a` is always true. (Unless the value compared is a float or double).
   To test if `a` is not-a-number, use `Double.isNaN(a)`.
   
   
   ---
   
   <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/search/facet/FacetModule.java | [413](https://github.com/apache/solr/blob/2d823d12393e549fb6322065ceec32af387fe639/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java#L413) |
   | solr/core/src/java/org/apache/solr/search/facet/FacetModule.java | [419](https://github.com/apache/solr/blob/2d823d12393e549fb6322065ceec32af387fe639/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java#L419) |
   <p><a href="https://lift.sonatype.com/results/github.com/apache/solr/01GNV4ZTRYPFJ2RV8SEDYF4ZQK?t=Semgrep|opt.semgrep.java.lang.correctness.eqeq.eqeq" 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=365290274&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=365290274&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365290274&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365290274&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=365290274&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-unsubscribe@solr.apache.org

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


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