Conditional can be pushed inside branch expression
Reports conditional expressions with then
and else
branches that are similar enough so that the expression can be moved inside. This action shortens the code.
Example:
After the quick-fix is applied:
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
ConditionalCanBePushedInsideExpression- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
New in 2017.2
Inspection options
Here you can find the description of settings available for the Conditional can be pushed inside branch expression inspection, and the reference of their default values.
- Ignore when conditional will be only argument of a method call
Default: Selected
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Java, 243.23126 |