Summary: | Extract to local variable generates variable called 'enum' | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Benno Baumgartner <benno.baumgartner> | ||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | ||||||||
Version: | 3.2 | ||||||||
Target Milestone: | 3.2 RC1 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Benno Baumgartner
2006-03-28 10:40:32 EST
Moving to jdt.core: We're using NamingConventions.suggestLocalVariableNames to get a name. The problem comes from the fact that the call JavaConventions.validateFieldName(new String(suffixName)) returns true even if the field name is a keyword. The scanner used by JavaConventions is used in 1.3 mode. So technically assert or enum can be returned as valid identifiers (field or variable names). Created attachment 37130 [details]
Proposed fix
With this patch, "enum1" is returned. Created attachment 37132 [details]
Regression test
Fixed and released in HEAD. Regression tests added in org.eclipse.jdt.core.tests.model.NamingConventionTests.testSuggestLocalName001/testSuggestLocalName002 +1 for 3.2RC1 Verified for 3.2 RC1 using build I20060413-0010 |