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

CSVConfig Invalid Check For Equals

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • 4.6.1, 4.7
    • None
    • Response Writers
    • None

    Description

      When I was checking the source code of Solr I realized that equals method at CSVConfig.java does an unnecessary or invalid checking as follows:

          /**
           * TODO..
           * @see java.lang.Object#equals(java.lang.Object)
           */
          @Override
          public boolean equals(Object obj) {
              if (obj == null && !(obj instanceof CSVConfig)) {
                  return false;
              }
              return super.equals(obj);
      //        CSVConfig config = (CSVConfig) obj;
      //        getFill() == config.getFill()
      //        getFields().equals(config.getFields())
          }
      

      if obj is null it can not be an instance of CSVConfig so it is unnecessary. On the other hand it does not make a valid check so I have changed the equals criteria to OR.

      Attachments

        1. SOLR-5836.patch
          0.6 kB
          Furkan Kamaci

        Activity

          People

            Unassigned Unassigned
            kamaci Furkan Kamaci
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: