SonarQube Java
  1. SonarQube Java
  2. SONARJAVA-245

Rule: Case insensitive comparison of Strings should be done without converting Strings to lower/upper case

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: Rules
    • Labels:
      None
    • Number of attachments :
      0

      Activity

      Hide
      Freddy Mallet added a comment -

      @Dinesh, here is an example of false-negative :

      "exit".toLowerCase().equals("EXIT");
      
      Show
      Freddy Mallet added a comment - @Dinesh, here is an example of false-negative : "exit" .toLowerCase().equals( "EXIT" );
      Hide
      Dinesh Bolkensteyn added a comment -

      Yep well spotted, it's really a nightmare to implement this kind of checks, the AST is slightly different for every possible syntax.

      Show
      Dinesh Bolkensteyn added a comment - Yep well spotted, it's really a nightmare to implement this kind of checks, the AST is slightly different for every possible syntax.
      Hide
      Dinesh Bolkensteyn added a comment -

      Postponed

      Show
      Dinesh Bolkensteyn added a comment - Postponed
      Hide
      Dinesh Bolkensteyn added a comment -

      Okie it's not fully reimplemented and much simpler - should cover all cases properly.

      Show
      Dinesh Bolkensteyn added a comment - Okie it's not fully reimplemented and much simpler - should cover all cases properly.
      Hide
      Freddy Mallet added a comment -

      Works well Dinesh and even better than the PMD rule. I found the first version of the issue message more meaningful but this is subjective.

      Show
      Freddy Mallet added a comment - Works well Dinesh and even better than the PMD rule. I found the first version of the issue message more meaningful but this is subjective.
      Hide
      Dinesh Bolkensteyn added a comment -

      You're right, I'll slightly improve it.

      Show
      Dinesh Bolkensteyn added a comment - You're right, I'll slightly improve it.
      Hide
      Dinesh Bolkensteyn added a comment -

      Done

      Show
      Dinesh Bolkensteyn added a comment - Done

        People

        • Assignee:
          Dinesh Bolkensteyn
          Reporter:
          Freddy Mallet
        • Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: