Dear SonarSourcers:
Some code in my project was scanned to have bugs, but I thought it is a false positive, as I have checked nullability in the following lines. Could someone help me check about this? Thanks a lot~~
Sonar version: 7.9.3
JDK version: openjdk 11.0.8
CustomerMobile customerMobile = getCustomerMobileByCuidOrFakeId(cuid, fakeId);
if ((StringUtils.isBlank(cuid) && StringUtils.isBlank(fakeId)) || Objects.isNull(customerMobile)) {
log.info("------there is not corresponding cuid or fakeId record, cuid[{}], fakeId[{}]", cuid, fakeId);
CustomerMobile cm = customerMobileDAO.queryByMobile(currentMobile);
if (Objects.isNull(cm)) {
firstLoginFlag = Constant.FIRST_LOGIN_Y;
customer = createCustomer(currentMobile, authLoginDTO.getChannelId());
createCustomerMobile(customer.getCustomerId(), currentMobile, cuid, fakeId);
log.info("------there is not corresponding phone number record, phone number[{}]", currentMobile);
} else {
bindCuidAndFakeIdToCustomerMobile(cm, cuid, fakeId);
customer = customerMapper.selectByPrimaryKey(cm.getCustomerId());
log.info("------there is corresponding phone number record, phone number[{}]", currentMobile);
}
return createCustomerLoginInfo(customer, currentMobile, firstLoginFlag, accessToken);
}
log.info("------there is corresponding cuid or fakeId record, cuid[{}], fakeId[{}]", cuid, fakeId);
if (currentMobile.equals(customerMobile.getMobile())) {
//.....
}