| <html> |
| <body> |
| Reports any <b>if</b> |
| statements with then and <b>else</b> branches which |
| are both assignment expressions or both <b>return</b> |
| statements. The same semantics can be expressed more compactly, and arguably |
| more clearly, with a conditional expression. Example: |
| <pre> |
| <b>if</b> (foo == null) { |
| bar = null; |
| } <b>else</b> { |
| bar = foo.get(); |
| } |
| </pre> |
| may be expressed as: |
| <pre> |
| bar = foo == null ? null : foo.get(); |
| </pre> |
| <!-- tooltip end --> |
| <p> |
| Use the checkbox below to let this inspection report <b>if</b> statements containing method calls which can be replaced with a single |
| method call with a conditional expression argument. |
| <p> |
| |
| </body> |
| </html> |