Community
Participate
Working Groups
3.2 - create a project and set 'NLS problems' to 'warning' - the following code has no problems - remove the semicolon after the ..toString() - 'unnecessary NLS tag' warning shows up after enclosingType= ""; public class A { public static void getCatchBodyContent(String locationInAST){ String enclosingType= ""; //$NON-NLS-1$ if (locationInAST != null) { enclosingType.toString(); } } }
This problem is caused by statements recovery because StringLiteral's are consumed twice inside a method body.
Created attachment 45365 [details] Proposed patch
Fix released and test added ExternalizeStringLiteralsTest#tesdt017() Released for 3.3 M1
Verified for 3.3 M1 using build I20060804-0010. I think this could be put in 3.2.1 stream...