Bug 87849

Summary: [AST] SimpleName.setIdentifier() not detecting bogus identifiers
Product: [Eclipse Project] JDT Reporter: Jim des Rivieres <jeem>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.0   
Target Milestone: 3.1 M6   
Hardware: All   
OS: All   
Whiteboard:

Description Jim des Rivieres CLA 2005-03-11 21:07:28 EST
Build 3.1 M5a

SimpleName.setIdentifier() is letting through some bogus Java identifiers
which it should be rejecting.

I've beefed up ASTTest.testSimpleName() to include some bogus identifiers.
Here's a log that shows the problem:

Error: SimpleName.setIdentifier("a b") was not rejected
Error: SimpleName.setIdentifier("a ") was not rejected
SimpleName.setIdentifier(" a") was rejected
Error: SimpleName.setIdentifier("a-b") was not rejected
Error: SimpleName.setIdentifier("a[]") was not rejected
Error: SimpleName.setIdentifier("a<T>") was not rejected
SimpleName.setIdentifier("") was rejected
SimpleName.setIdentifier(" ") was rejected
Error: SimpleName.setIdentifier("a.b") was not rejected

Once the problem is fixed, remove the print statements from
the test and reinstate the commented out "assertTrue(false)".
Comment 1 Olivier Thomann CLA 2005-03-11 23:04:49 EST
I guess I don't check that there is just one identifier.
Comment 2 Olivier Thomann CLA 2005-03-12 11:36:29 EST
Fixed and released in HEAD.
Regression test updated in ASTTest.testSimpleName()
Comment 3 Olivier Thomann CLA 2005-03-30 23:27:03 EST
Verified in 20050330-0500