A Java string comparison can compile even when it checks object identity by mistake. IntelliJ IDEA on the Linux desktop flags code like this through inspections, and you can set how prominently each inspection reports a finding for the project.
IntelliJ IDEA uses the active inspection profile to decide which checks run in the editor. A profile stored in the project gives that project its own settings. PyCharm also manages inspection profiles under Settings > Editor > Inspections.
An inspection's severity determines how the IDE classifies its findings. The File tab in Problems lists the findings for the active file, so you can compare the severity of the same diagnostic after changing the profile.
Steps to configure inspections in JetBrains IDE:
Start with your project inspection profile active and an affected file open after code analysis finishes. The Problems tool window should be closed. The example uses src/Main.java in ~/IdeaProjects/catalog, where == compares two strings on line 7.
- Click the inspection widget at the top right of the editor to open the active file's findings.

- Open Settings with Ctrl+Alt+S.
Before the change, the example's File tab in Problems shows a yellow Warning icon for the string comparison on line 7. If Settings opens on Editor > Inspections, continue at step 5.
- Expand Editor in the settings tree if it is collapsed.

- Select Inspections under Editor.

- Click the inspection filter directly below Profile.
The Profile field shows the active profile, Project Default in the example.
- Enter the inspection name in the filter, replacing any existing text.
The example searches for
String comparison. - Select the enabled inspection that reports the finding.
The example selects String comparison using '==', instead of 'equals()' under Java > Probable bugs. The worked setting applies to an enabled inspection with In All Scopes selected.
- Open the Severity list for the selected inspection.
The current severity is Warning in the example. If you later want to restore the previous severity, the value shown here is the one to restore.
- Choose a severity different from the current one that keeps the finding visible in Problems.
The example changes Warning to Error.
- Click OK to save the profile change.

- Confirm that the icon for the same finding in Problems > File has changed to the severity you selected.
In the example, the string comparison on line 7 of
Main.javachanges from a yellow Warning icon to a red Error icon.