I20210217-0600
tagged this
15 Feb 06:32
Object::equals on non null
Given:
boolean result = text.equals("foo");
boolean result2 = text.equals(text1 + text2);
boolean result3 = object.equals(DayOfWeek.MONDAY);
boolean result4 = text.equalsIgnoreCase("foo");
When:
Clean up the code enabling "Avoid Object::equals or
String::equalsIgnoreCase on null objects"
Then:
boolean result = "foo".equals(text);
boolean result2 = (text1 + text2).equals(text);
boolean result3 = DayOfWeek.MONDAY.equals(object);
boolean result4 = "foo".equalsIgnoreCase(text);
Change-Id: I795af204f8dff26c9ffd0e447b434c472bf050d7
Signed-off-by: Fabrice Tiercelin <fabrice.tiercelin@yahoo.fr>