Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. In the IDEA main menu, choose File | Settings, and then under Project Settings click Inspections.
  2. In the list of the IntelliJ IDEA inspections, expand the Probable bugs node, and then click '==' or '!=' instead of 'equals()'.
    Image Removed Image Added
  3. Under Options, you can specify the following plugin settings:
    • 1
    • 2
    • From the Severity list, select the severity level (such as Warning, Info, etc.)
    • In the text box under Severity, specify the semicolon separated list of Java classes to be affected by this code inspection.
  4. When finished, click OK.

How It Works?

The plugin inspects your code opened in the IntelliJ IDEA editor or the code you are typing. The plugin highlights the code fragments where two variables of the reference type are separated by == or != and proposes to replace this code fragment with *.equals():

...