Method Annotations

To suppress compiler warnings for test methods written by Diffblue Cover, go to Diffblue > Change Settings > Method Annotations and update the Warnings to suppress list, as needed. The warnings or warning types defined here will be added to all test methods written by Diffblue Cover (as detailed below) using the @SuppressWarnings code annotation. This is especially useful when using SonarQube - see Using SonarQube with Cover Plugin.

Example - all: all

Suppresses all warnings - adds the code annotation @SuppressWarnings({"all"})`

Example - types: unused,raw-types

Suppresses one or more "warning types" - this example adds the code annotation @SuppressWarnings({"unused","raw-types"})

Example - specific: java:S1161

Suppresses one or more specific warnings (using warning codes) - this example, adds the code annotation @SuppressWarnings({"java:S1161"}

Last updated