Details

    • Type: Language-Specification
    • Status: Closed
    • Resolution: Duplicate
    • Labels:
    • Message:
      Rename this (variable|parameter).
    • Highlighting:
      Hide

      variable/param name

      Show
      variable/param name
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Default Quality Profiles:
      Sonar way
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      2min

      Description

      In Java 8, underscore (_) cannot be used as a parameter to a lambda, and by Java 9, it's a keyword. To ensure future portability (not to mention current readability), it should not be used now as an identifier.

      Noncompliant Code Example

      private String _;  // Noncompliant
      

      Compliant Solution

      private String foo;
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ann.campbell.2 Ann Campbell
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: