Bug 307486 - DBCS3.6: Fail to propose Ext-B labels with content assist in Java Editor
Summary: DBCS3.6: Fail to propose Ext-B labels with content assist in Java Editor
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-30 03:56 EDT by Masaihko Maedera CLA
Modified: 2010-04-30 02:18 EDT (History)
6 users (show)

See Also:


Attachments
Bug307486.java (import this with UTF-8 encoding) (260 bytes, text/plain)
2010-03-30 04:22 EDT, Masaihko Maedera CLA
no flags Details
Proposed fix + regression test (4.79 KB, patch)
2010-04-07 15:43 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Masaihko Maedera CLA 2010-03-30 03:56:38 EDT
Build Identifier: I20100313-1044

OS: Windows 7 (64bit), XP, SLES11
JRE: IBM JRE 1.6
Build:I20100313-1044

After creating a label that has Ext-B character at the top.
content assist can not propose the correct label.
It drops the first character.
For example, when the label is "U+20B9Fabc", the result is "abc".

Reproducible: Always

Steps to Reproduce:
1.Create a Java project.
2.Edit Java source code and type a label that has Ext-B character at the top.
3.Write "while(true) break " and type Ctrl+Space,
4.You see "abc" is a proposal and it drops the first character.

FYI: this is a sample source code
--------------------------------
public class Test {
	public static void main(String[] args) {
		𠮟abc: // U+20B9F a b c
		while (true) {
			// Type "break " and Ctrl+Space,
			// It drop an Ext-B character at the top
			break 𠮟abc; // You may see "abc",
		}
	}
}
--------------------------------
Comment 1 Dani Megert CLA 2010-03-30 03:58:56 EDT
Could you please attach a sample file and mention the encoding you used to save the file. Thanks.
Comment 2 Masaihko Maedera CLA 2010-03-30 04:22:12 EDT
Created attachment 163374 [details]
Bug307486.java (import this with UTF-8 encoding)

I attached a sample code.
Comment 3 Dani Megert CLA 2010-03-30 07:27:25 EDT
The LABEL_REF proposal from JDT Core is wrong.
Comment 4 Srikanth Sankaran CLA 2010-03-30 08:05:45 EDT
Ayush, please investigate.
Comment 5 Olivier Thomann CLA 2010-04-07 15:31:59 EDT
Ayush, this is similar to the problem I fixed today with codeSelect(..) and surrogates characters.
I'll take care of this.
Comment 6 Olivier Thomann CLA 2010-04-07 15:41:07 EDT
The CompletionScanner doesn't support surrogate characters at the starting position of an identifier.
The fix is trivial.
Comment 7 Olivier Thomann CLA 2010-04-07 15:43:00 EDT
Created attachment 164120 [details]
Proposed fix + regression test
Comment 8 Olivier Thomann CLA 2010-04-07 15:43:34 EDT
Released for 3.6M7.
Added regression test in:
org.eclipse.jdt.core.tests.model.CompletionTests_1_5#testLabel
Comment 9 Dani Megert CLA 2010-04-09 08:56:26 EDT
Verified in N20100408-2000.
Comment 10 Masaihko Maedera CLA 2010-04-30 02:18:29 EDT
I also verified this bug is fixed in I20100426-0852 as the reporter.