[library] Make local variable final for clarity
[library] Enclose boolean expression with parens
[library] Add {}'s to one-liner if for consistency
[library] Only update empty status when empty view is not null