Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (3.4k points)

In Eclipse source code, I've found some '$NON-NLS-1$' in comments used like that :

private String toolTip = ""; //$NON-NLS-1$

What does that mean ?

1 Answer

0 votes
by (46k points)
They quell a signal that Eclipse issues when it meets string literals (and has been configured to complain).

The design is that UI advice should not be installed as string literals, but preferably sourced from a resource file (so that they can be translated, proofed, etc). Consequently, Eclipse can be configured to identify string literals, so that you don't randomly have consent unexternalized UI strings in the code; nevertheless, there are strings which should not be externalized (such as regexp) and so, //$NON-NLS-1$ supplies you a way to express that point to the compiler.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...