Bug 25735

Summary: Non-NLS strings are not reported properly when the ending tag is missing
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: 973867476
Version: 2.1   
Target Milestone: 2.1 M3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Olivier Thomann CLA 2002-11-05 13:24:47 EST
Compiling this code, report a non-nls string on the second one instead of the
first one.
public class A {
		String s = 
			"	public	int	foo() { \n" + //$NON-NLS-1
			"		return 2; \n";//$NON-NLS-1$
}

Note the missing '$' at the end of the first NLS tag.
Comment 1 Olivier Thomann CLA 2002-11-05 13:25:32 EST
The bug is due to an ArrayIndexOutOfBoundsException caused by a -1 for the
position of the ending tag.
Comment 2 Olivier Thomann CLA 2002-11-05 13:34:46 EST
Fixed and released in 2.1 stream.
Regression test (NegativeTest.test291) added.
Comment 3 Olivier Thomann CLA 2002-11-05 13:35:00 EST
Changed milestone.
Comment 4 David Audel CLA 2002-11-13 09:10:12 EST
Verified.