Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-8047

Comparison of String objects using == or !=

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 7.0.1
    • None
    • modules/analysis
    • Ubuntu 14.04.5 LTS

    • New

    Description

      My tool has scanned the whole codebase of Lucene and found there are eight practice issues of string comparison, in which strings are compared by using ==/!= instead of equals( ).

      analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java

      conditionPattern == SUFFIX_CONDITION_REGEX_PATTERN
      

      analysis/common/src/java/org/apache/lucene/analysis/cjk/CJKBigramFilter.java

        if (type == doHan || type == doHiragana || type == doKatakana || type == doHangul) {
      

      analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicFilter.java

       if (type == APOSTROPHE_TYPE &&...){
      
       } else if (type == ACRONYM_TYPE) {  
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            wangsonging song
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: