Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

sebhoss/suppress-warnings

Repository files navigation

Suppress-Warnings Discuss on Google Groups Chat on IRC

CC Zero Maven Central Read JavaDocs Repository size Open Hub statistics

Build Status Coverity Scan Result Codacy Code Quality Can this project be forked? Is this thing still maintained? Bounties on open tickets

Java utility library which contains constants for @SuppressWarnings annotations.

Usage

Use the CompilerWarnings class to suppress compiler warnings like this:

@SuppressWarnings(CompilerWarnings.NLS)
final String myText = "hello world!";

Add de.xn__ho_hia.quality.suppression.CompilerWarnings.* as a favorite to your IDE, e.g. use Java > Editor > Content Assist > Favorites in Eclipse. This allows will instruct Eclipse to auto import the constant you specified statically which reduces the code to this:

@SuppressWarnings(NLS)
final String myText = "hello world!";

Take a look at the JavaDoc to see a list of all available constants. All of them contain a (short) description which should help out developers who have not seen those suppressions before. Referencing those constants instead of using plain strings will make sure that all suppressions are correct.

Integration

To use this project just declare the following dependency inside your POM:

<dependency>
  <groupId>de.xn--ho-hia.quality</groupId>
  <artifactId>suppress-warnings</artifactId>
  <version>${version.suppress-warnings}</version>
</dependency

Replace ${version.suppress-warnings} with the latest release. This project follows the semantic versioning guidelines.

Compatibility

This project is compatible with the following Java versions:

Table 1. Java compatibility
4.X.Y

Java 8

License

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.

You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.