Versions Compared

Key

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

...

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():

In this example, the code: s1 and s2 are variables of the String type. Clicking Use equals() replaces

Code Block
return (n>s1=0) ? n : -n;

...

=s2);

with the code:

Code Block
ifreturn ((n>=0)) {
            return n;
        } else {
            return -n;
        }
s1.equals(s2));