Object comparison - handling the null case

Short-circuited

return (s1 == s2)
||
(
(s1 == null && s2 != null)
||
!s1.equals(s2)
)

Comments

Popular posts from this blog

Sites, Newsletters, and Blogs

Oracle JDBC ReadTimeout QueryTimeout

Locks held on Oracle for hours after sessions abnormally terminated by node failure