Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9873

Function result is compared with itself

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.3
    • Fix Version/s: 6.4, 7.0
    • Component/s: None
    • Labels:
      None

      Description

      Hi!

      In the method SolrTestCaseJ4.compareSolrDocument

      SolrTestCaseJ4.java
          if(solrDocument1.getFieldNames().size() != solrDocument1.getFieldNames().size()) {
            return false;
          }
      

      "solrDocument1.getFieldNames().size()" compare with itself

      Probably, is should be:

      SolrTestCaseJ4.java
          if(solrDocument1.getFieldNames().size() != solrDocument2.getFieldNames().size()) {
            return false;
          }
      

      This possible defect found by static code analyzer AppChecker

        Attachments

          Activity

            People

            • Assignee:
              yseeley@gmail.com Yonik Seeley
              Reporter:
              AppChecker AppChecker
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: