Connected to SonarCloud or SonarQube (and which version):
And a thorough description of the problem / question:
cusFeedback.setPhoneNumber(Optional.ofNullable(userInfo).orElseThrow(() -> new FsnException(Result.USER_NOT_EXISTS)).getPhone());
cusFeedback.setCommitName(userInfo.getName());
I believe that the first line has already checked whether userInfo is null , and if it is null , an exception will be thrown. Therefore, the subsequent userInfo.getName() should not throw an exception.