Reordering string parameters in equals() check to avoid potential NPEs.

Signed-off-by: Jayanga Dissanayake <jsdjayanga@yahoo.com>