yegor256/qulice

Constants should be on the right side of comparison

Open

#716 opened on Feb 16, 2016

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

Repository metrics

Stars
 (320 stars)
PR merge metrics
 (PR metrics pending)

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