Long notNull;
--------------------------------------------
if(notNull.longValue() == 0 || notNull == null)
----------------------------------------------
如上判断会出现空指针异常,当notNull为空的时候不会再进行 || 右面的表达式判断;
|| 只要左右两端的表达式有一端成立代表该判断为true的前提是没有异常出现
因此,正确的判断java中长整型的包装类Long是否为空应该如下所示
----------------------------------------------
if(notNull == null || notNull.longValue() == 0)
---------------------------------------------