# Reorder String Equality Check
To avoid NullPointerExceptions , it is recommended to put string literals in the left-hand-side of
equalsIgnoreCase() when checking for equality.
This order prevents NullPointerExceptions from being raised, as a string literal can never be
null by definition, and therefore makes the code less prone to errors. An example can be seen below.
# Code Changes
🛠️ Auto-refactor Available
You can auto-refactor this with jSparrow.
Drop this button to your Eclipse IDE workspace to install jSparrow for free:
Need help? Check out our installation guide.