Bug 87849 - [AST] SimpleName.setIdentifier() not detecting bogus identifiers
Summary: [AST] SimpleName.setIdentifier() not detecting bogus identifiers
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-11 21:07 EST by Jim des Rivieres CLA
Modified: 2005-03-30 23:27 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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