Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352553

Summary: [1.7] 'char a\u200b' is being accepted in 1.6 mode
Product: [Eclipse Project] JDT Reporter: Satyam Kandula <satyam.kandula>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: loskutov, Olivier_Thomann, srikanth_sankaran
Version: 3.7   
Target Milestone: 3.7.1   
Hardware: PC   
OS: Windows XP   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=578063
Whiteboard:

Description Satyam Kandula CLA 2011-07-20 05:57:01 EDT
javac6 and Eclipse 3.7 reports an error on using a variable declaration of kind 'char a\u200b;' However, Eclipse with Java 7 support patch doesn't report this as an error in 1.6 mode. 

Note that javac7 doesn't report this as an error and hence it is appropriate that this should not flagged as an error in 1.7 projects, but this may not be right for 1.7- projects. I don't understand the character and hence couldn't comment, but there is a difference.
Comment 1 Srikanth Sankaran CLA 2011-07-20 07:00:38 EDT
(In reply to comment #0)

> but this may not be
> right for 1.7- projects. I don't understand the character and hence couldn't

I think you meant 1.6- (1.6 and below)
Comment 2 Satyam Kandula CLA 2011-07-20 07:44:49 EDT
(In reply to comment #1)
> (In reply to comment #0)
> 
> > but this may not be
> > right for 1.7- projects. I don't understand the character and hence couldn't
> 
> I think you meant 1.6- (1.6 and below)

Yes I did mean 1.6 and below.
Comment 3 Olivier Thomann CLA 2011-07-20 10:17:32 EDT
I'll check if this character's category also changed.
Comment 4 Olivier Thomann CLA 2011-07-20 11:43:43 EDT
Ok, that character was in the Zs group in Unicode 4 and has been moved to the Cf group in Unicode 6. This means that before it was forbidden as part of a java identifier, and now it is permitted.
I can tweak that, but I don't know if this is the right way to fix this issue. It looks like I need to check all Unicode 4 characters based on their original specification even if their categories have been changed since then.
Comment 5 Olivier Thomann CLA 2011-07-20 11:45:16 EDT
I forgot to mention that "Zs" means SPACE_SEPARATOR group. "Cf" means FORMAT group.
Characters in the Zs group are illegal as a java identifier part, but characters in the Cf group are fine. This explains the difference.
Comment 6 Olivier Thomann CLA 2011-07-20 12:36:03 EDT
Released in BETA_JAVA7 branch.
Added regression test in:
org.eclipse.jdt.core.tests.compiler.regression.ScannerTest#test059
Comment 7 Satyam Kandula CLA 2011-08-02 09:37:20 EDT
Verified for 3.8M1 using build I20110729-1200
Comment 8 Andrey Loskutov CLA 2022-01-10 07:38:40 EST
See follow up issue: bug 578063.