Open mickaelistria opened 6 months ago
Thanks @srikanth-sankaran I'm going to quote the insight from @stephan-herrmann here
This would be trivial to change in CompilationUnitDeclaration in either of recordStringLiteral() or reportNLSProblems().
1960 matches in platform workspace:
I guess changing this after so many years would lead to more trouble because of "unneeded annotation" warnings/errors then it helps to prevent false positives.
I think the request is still valid: I just hope empty string wouldn't trigger NLS warning, I don't really need to show a warning if the annotation is used. The reportNLSProblems()
method seems to be a relatively easy place where to add a condition of the form
if (Arrays.stream(this.stringLiterals).allMatch(literal -> literal.sourceEnd == literal.sourceStart + 2 /* length of "" */)
&& this.nlsTags.length <= this.stringLiterals.length) {
return;
}
Empty string is already internationalized, it should require //$NON-NLS-1$ annotations.