Uploaded image for project: 'Java'
  1. Java
  2. SONARJAVA-211

Rule: Local variables should not shadow class fields

    Details

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

      Issue Links

        Activity

        Hide
        freddy.mallet Freddy Mallet added a comment -

        I'm reopening this rule to stop checking method parameters. So this rule should only log an issue when a local variable hide a class field.

        Show
        freddy.mallet Freddy Mallet added a comment - I'm reopening this rule to stop checking method parameters. So this rule should only log an issue when a local variable hide a class field.
        Hide
        dinesh.bolkensteyn Dinesh Bolkensteyn added a comment -

        Done

        Show
        dinesh.bolkensteyn Dinesh Bolkensteyn added a comment - Done
        Hide
        freddy.mallet Freddy Mallet added a comment -

        Almost perfect @Dinesh, could you also prevent the check from logging an issue inside a static method ?

        Show
        freddy.mallet Freddy Mallet added a comment - Almost perfect @Dinesh, could you also prevent the check from logging an issue inside a static method ?
        Hide
        dinesh.bolkensteyn Dinesh Bolkensteyn added a comment -

        Done, it does not apply to static blocks (methods or initializers) anymore.

        Show
        dinesh.bolkensteyn Dinesh Bolkensteyn added a comment - Done, it does not apply to static blocks (methods or initializers) anymore.
        Hide
        freddy.mallet Freddy Mallet added a comment -

        Manually tested !

        Show
        freddy.mallet Freddy Mallet added a comment - Manually tested !

          People

          • Assignee:
            dinesh.bolkensteyn Dinesh Bolkensteyn
            Reporter:
            dinesh.bolkensteyn Dinesh Bolkensteyn
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: