Suppress “variable is never assigned” warning in IntelliJ IDEA

You could use an annotation to mark it as an injected field. (similar to how it would treat @EJB). The IntelliJ inspections (at least with version 10.5) allow you to configure your own annotations to mark fields as being injected. Select Analyze, Inspect Code from the menu and then go to the unused declaration inspection … Read more

Android Studio – remove Security Exception warning

You are looking for (updated to improve clarity): @Override @SuppressWarnings({“MissingPermission”}) public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (LOCATION_REQUEST_CODE == requestCode) { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { lastLocation = LocationServices.FusedLocationApi.getLastLocation(googleApiClient); } } EDITED: The correct lint rule is MissingPermission, but there seems to be a bug that … Read more

Disable/suppress warning CS0649 in C# for a specific field of class

You could use #pragma warning to disable and then re-enable particular warnings: public class MyClass { #pragma warning disable 0649 // field declarations for which to disable warning private object foo; #pragma warning restore 0649 // rest of class } Refer to Suppressing “is never used” and “is never assigned to” warnings in C# for … Read more

Class is a raw type. References to generic type Class should be parameterized

The interface declares the method with a raw type. In that case, you can’t override it nicely without having the warning. The origin of your problem is that the Spring interface was declared to be Java 1.4 compliant. Note that Spring 3.0 is supposed to deliver all classes as Java 1.5 compliant, so that would … Read more

Is it possible to make valgrind ignore certain libraries?

Assuming you are running the memcheck tool and you want to ignore Leak errors in libcrypto only, you could put a suppression like: { ignore_libcrypto_conditional_jump_errors Memcheck:Leak … obj:*/libcrypto.so.* } … into a file and pass it to valgrind with –suppressions=*FILENAME*. To ignore Leak errors in all shared libraries under any lib directory (/lib, /lib64, /usr/lib, … Read more

Unnecessary @SuppressWarnings(“unused”)

In the code in your question, the @SuppressWarnings(“unused”) annotation is unnecessary because the method is either overriding another method from a superclass or implementing an interface. Even if you don’t actually use the whatever parameter it’s mandatory to declare it, otherwise the @Override annotation will produce an error (you’d be changing the signature of the … Read more

Can I get PyCharm to suppress a particular warning on a single line?

To suppress PyCharm code inspections for a particular line of code you can use the following construct: # noinspection INSPECTION_NAME your_line_of_code_to_suppress where the name of the inspection (INSPECTION_NAME above) you can take from the list of inspection names (they are pretty descriptive). To suppress pylint command line messages explicitly you have to use different comments/commands, … Read more