yegor256/qulice

Constants should be on the right side of comparison

Open

#716 opened on Feb 16, 2016

 (6 comments) (0 reactions) (0 assignees)Java (122 forks)github user discovery
bughelp wantedpostponed

Repository metrics

Stars
 (320 stars)
PR merge metrics
 (Avg merge 4d 5h) (68 merged PRs in 30d)

Description

When comparing variables with constants there are two possible approaches: if (null == variable) or if (variable == null)

Let's enforce the second one, so that constant value (string literal, null or number) is on the right side of comparison.

Contributor guide