I have the following DTO and I pass the objects to the ArrayLists to prevent objects to be changed and fix the SonarQube error as “Message: Store a copy of allergenInfoList”, etc. However, this approach requires null check and it makes my code ugly as shown below: So, is there any better approach to fix the problem without null check?
Tag: sonarqube-scan
Kotlin, Java 8 and Sonar coverage showing as 0
I have a kotlin project using Java 8 and I use Sonar to measure code coverage I am using the latest version of Sonar and noticed the coverage has gone down due to changes in the openjdk. My tests are using Mockito and PowerMockito. Some tests are failing due to reflection errors. When I add the following jvm args –