IntelliJ IDEA 2017.3 Help

Ignoring Hard-Coded String Literals

Sometimes you might want to ignore the hardcoded literals. To do that, use Not requiring internationalization annotation.

To ignore a certain hardcoded literal

  1. Press Alt+Enter to show intention actions for the string literal:
  2. Select Annotate as @NonNls from the suggestion list.
  3. In the Select Path dialog that opens, specify the location where annotations.xml file will be stored.

Alternatively, you can add @NonNls annotation:


If you have selected the checkbox Do not show this dialog in the future, you can still choose annotation style in the Settings dialog (Code Style | Java - Code Generation).

Last modified: 6 March 2018

See Also