Summary: | Problems in new NamingConventions APIs | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||||
Component: | Core | Assignee: | David Audel <david_audel> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | david_audel, jerome_lanneluc, srikanth_sankaran | ||||||
Version: | 3.5 | ||||||||
Target Milestone: | 3.5 M4 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 251670 | ||||||||
Attachments: |
|
Description
Markus Keller
2008-11-14 08:00:31 EST
(In reply to comment #0) > - see other Javadoc corrections in the attached patch (typos and missing > references to new constants) It seems that you forgot to attach the patch Created attachment 118040 [details] Javadoc patch for NamingConventions > It seems that you forgot to attach the patch Oops, sorry about that. I just realized we had a test failure in CodeCompletionTest#testGetterCompletion1() due to a subtle difference between NamingConventions#getBaseName(..) and the now-deprecated removePrefixAndSuffixFor*Name(..) methods. In the old days, the base name for e.g. field "fWriter" with prefix "f" was "writer". Now, getBaseName() returns "Writer" (with capital first letter). I've put a workaround for this into StubUtility, but I think getBaseName(..) should return uncapitalized names, since it returns a *variable* name, and those are traditionally uncapitalized. Together with 10.c) from bug 38111, this would completely spare clients from having to care about casing of names. Created attachment 118341 [details] Proposed fix This patch contains the following modifications: - VK_STATIC_FINAL_FIELD is added to replace VK_CONSTANT_FIELD. I will remove VK_CONSTANT_FIELD when you will use VK_STATIC_FINAL_FIELD. VK_CONSTANT_FIELD was shorter but VK_STATIC_FINAL_FIELD is closer to the name of the associated options CODEASSIST_STATIC_FINAL_FIELD_*FIXES - suggestVariableNames() returns capitalized type name for base type (int -> INT). - suggestVariableNames() returns capitalized name when the name contains only one letter (a -> A). - Javadoc of getBaseName() is improved. - getBaseName() returns name starting with a lowercase. I also corrected typos and missing references to new constants (thanks for the patch) I did not modify suggestSetter/GetterName. I will fix them with the fix for bug 251693 Released for 3.5M4. Tests added NamingConventions#testSuggestFieldName039() -> testSuggestFieldName040() Tests updated NamingConventions#testGetBaseName001() -> testGetBaseName004() NamingConventions#testSuggestFieldName021() -> testSuggestFieldName022() NamingConventions#testSuggestFieldName025() -> testSuggestFieldName028() Thanks, I've removed the references to VK_CONSTANT_FIELD and the workarounds in JDT/UI. Verified for 3.5M4 using I20081208-1800 build |